Goran Mahovlic / nRF51822_BLE_MIDI

Dependents:   BLE_MIDI

Fork of nRF51822 by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Fri Nov 21 10:00:41 2014 +0000
Parent:
76:ce629a504851
Child:
78:9a5ba2c5d53c
Commit message:
Synchronized with git rev 6cd60389
Author: Rohit Grover
extending ConnectionCallbackParameters_t

Changed in this revision

btle/btle.cpp Show annotated file Show diff for this revision Revisions of this file
nRF51Gap.cpp Show annotated file Show diff for this revision Revisions of this file
nRF51Gap.h Show annotated file Show diff for this revision Revisions of this file
--- a/btle/btle.cpp	Fri Nov 21 10:00:41 2014 +0000
+++ b/btle/btle.cpp	Fri Nov 21 10:00:41 2014 +0000
@@ -128,7 +128,8 @@
             Gap::Handle_t handle = p_ble_evt->evt.gap_evt.conn_handle;
             nRF51Gap::getInstance().setConnectionHandle(handle);
             const Gap::ConnectionParams_t *params = reinterpret_cast<Gap::ConnectionParams_t *>(&(p_ble_evt->evt.gap_evt.params.connected.conn_params));
-            nRF51Gap::getInstance().processConnectionEvent(handle, params);
+            const ble_gap_addr_t *peer = &p_ble_evt->evt.gap_evt.params.connected.peer_addr;
+            nRF51Gap::getInstance().processConnectionEvent(handle, static_cast<Gap::addr_type_t>(peer->addr_type), peer->addr, params);
             break;
         }
 
@@ -281,4 +282,4 @@
 {
     ASSERT_STATUS_RET_VOID( error_code );
     NVIC_SystemReset();
-}
+}
\ No newline at end of file
--- a/nRF51Gap.cpp	Fri Nov 21 10:00:41 2014 +0000
+++ b/nRF51Gap.cpp	Fri Nov 21 10:00:41 2014 +0000
@@ -304,7 +304,7 @@
     @endcode
 */
 /**************************************************************************/
-ble_error_t nRF51Gap::setAddress(addr_type_t type, const uint8_t address[ADDR_LEN])
+ble_error_t nRF51Gap::setAddress(addr_type_t type, const address_t address)
 {
     if (type > ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE) {
         return BLE_ERROR_PARAM_OUT_OF_RANGE;
@@ -319,7 +319,7 @@
     return BLE_ERROR_NONE;
 }
 
-ble_error_t nRF51Gap::getAddress(addr_type_t *typeP, uint8_t addressP[ADDR_LEN])
+ble_error_t nRF51Gap::getAddress(addr_type_t *typeP, address_t address)
 {
     ble_gap_addr_t dev_addr;
     if (sd_ble_gap_address_get(&dev_addr) != NRF_SUCCESS) {
@@ -329,8 +329,8 @@
     if (typeP != NULL) {
         *typeP = static_cast<addr_type_t>(dev_addr.addr_type);
     }
-    if (addressP != NULL) {
-        memcpy(addressP, dev_addr.addr, ADDR_LEN);
+    if (address != NULL) {
+        memcpy(address, dev_addr.addr, ADDR_LEN);
     }
     return BLE_ERROR_NONE;
 }
--- a/nRF51Gap.h	Fri Nov 21 10:00:41 2014 +0000
+++ b/nRF51Gap.h	Fri Nov 21 10:00:41 2014 +0000
@@ -39,8 +39,8 @@
     }
 
     /* Functions that must be implemented from Gap */
-    virtual ble_error_t setAddress(addr_type_t  type,  const uint8_t address[ADDR_LEN]);
-    virtual ble_error_t getAddress(addr_type_t *typeP, uint8_t addressP[ADDR_LEN]);
+    virtual ble_error_t setAddress(addr_type_t  type,  const address_t address);
+    virtual ble_error_t getAddress(addr_type_t *typeP, address_t address);
     virtual ble_error_t setAdvertisingData(const GapAdvertisingData &, const GapAdvertisingData &);
     virtual ble_error_t startAdvertising(const GapAdvertisingParams &);
     virtual ble_error_t stopAdvertising(void);
@@ -68,4 +68,4 @@
     void operator=(nRF51Gap const &);
 };
 
-#endif // ifndef __NRF51822_GAP_H__
+#endif // ifndef __NRF51822_GAP_H__
\ No newline at end of file