Nordic stack and drivers for the mbed BLE API

Dependents:   BLE_Health_Thermometer2

Fork of nRF51822 by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
Rohit Grover
Date:
Thu May 22 15:03:55 2014 +0100
Parent:
2:49e7ee9e88ab
Child:
4:534c2146e5ec
Commit message:
adding use of consts for GAP related apis

Changed in this revision

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/nRF51Gap.cpp	Thu Apr 03 02:00:35 2014 +0100
+++ b/nRF51Gap.cpp	Thu May 22 15:03:55 2014 +0100
@@ -58,7 +58,7 @@
     @endcode
 */
 /**************************************************************************/
-ble_error_t nRF51Gap::setAdvertisingData(GapAdvertisingData & advData, GapAdvertisingData & scanResponse)
+ble_error_t nRF51Gap::setAdvertisingData(const GapAdvertisingData & advData, const GapAdvertisingData & scanResponse)
 {
     /* Make sure we don't exceed the advertising payload length */
     if (advData.getPayloadLen() > GAP_ADVERTISING_DATA_MAX_PAYLOAD)
@@ -119,7 +119,7 @@
     @endcode
 */
 /**************************************************************************/
-ble_error_t nRF51Gap::startAdvertising(GapAdvertisingParams & params)
+ble_error_t nRF51Gap::startAdvertising(const GapAdvertisingParams & params)
 {
       /* Make sure we support the advertising type */
     if (params.getAdvertisingType() == GapAdvertisingParams::ADV_CONNECTABLE_DIRECTED)
@@ -270,7 +270,7 @@
     @endcode
 */
 /**************************************************************************/
-ble_error_t nRF51Gap::setAddress(addr_type_t type, uint8_t address[6])
+ble_error_t nRF51Gap::setAddress(addr_type_t type, const uint8_t address[6])
 {
   if ( type > ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE) return BLE_ERROR_PARAM_OUT_OF_RANGE;
  
--- a/nRF51Gap.h	Thu Apr 03 02:00:35 2014 +0100
+++ b/nRF51Gap.h	Thu May 22 15:03:55 2014 +0100
@@ -40,9 +40,11 @@
         }
 
         /* Functions that must be implemented from Gap */
-        virtual ble_error_t setAddress(addr_type_t type, uint8_t address[6]);
-        virtual ble_error_t setAdvertisingData(GapAdvertisingData &, GapAdvertisingData &);
-        virtual ble_error_t startAdvertising(GapAdvertisingParams &);
+        virtual ble_error_t setAddress(addr_type_t type,
+                                       const uint8_t address[6]);
+        virtual ble_error_t setAdvertisingData(const GapAdvertisingData &,
+                                               const GapAdvertisingData &);
+        virtual ble_error_t startAdvertising(const GapAdvertisingParams &);
         virtual ble_error_t stopAdvertising(void);
         virtual ble_error_t disconnect(void);