shunpei kataoka / nRF51822

Fork of nRF51822 by Shuta Nakamae

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Fri Jun 19 15:55:36 2015 +0100
Parent:
347:b5d18c33fd8a
Child:
349:4a930be118d8
Commit message:
Synchronized with git rev a6b456c7
Author: Rohit Grover
make use of GapAdvertisingData::Appearance instead of uint16_t

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	Fri Jun 19 15:55:35 2015 +0100
+++ b/nRF51Gap.cpp	Fri Jun 19 15:55:36 2015 +0100
@@ -423,7 +423,7 @@
     }
 }
 
-ble_error_t nRF51Gap::setAppearance(uint16_t appearance)
+ble_error_t nRF51Gap::setAppearance(GapAdvertisingData::Appearance appearance)
 {
     if (sd_ble_gap_appearance_set(appearance) == NRF_SUCCESS) {
         return BLE_ERROR_NONE;
@@ -432,9 +432,9 @@
     }
 }
 
-ble_error_t nRF51Gap::getAppearance(uint16_t *appearanceP)
+ble_error_t nRF51Gap::getAppearance(GapAdvertisingData::Appearance *appearanceP)
 {
-    if (sd_ble_gap_appearance_get(appearanceP)) {
+    if (sd_ble_gap_appearance_get(reinterpret_cast<uint16_t *>(appearanceP))) {
         return BLE_ERROR_NONE;
     } else {
         return BLE_ERROR_PARAM_OUT_OF_RANGE;
--- a/nRF51Gap.h	Fri Jun 19 15:55:35 2015 +0100
+++ b/nRF51Gap.h	Fri Jun 19 15:55:36 2015 +0100
@@ -61,8 +61,8 @@
 
     virtual ble_error_t setDeviceName(const uint8_t *deviceName);
     virtual ble_error_t getDeviceName(uint8_t *deviceName, unsigned *lengthP);
-    virtual ble_error_t setAppearance(uint16_t appearance);
-    virtual ble_error_t getAppearance(uint16_t *appearanceP);
+    virtual ble_error_t setAppearance(GapAdvertisingData::Appearance appearance);
+    virtual ble_error_t getAppearance(GapAdvertisingData::Appearance *appearanceP);
 
     virtual ble_error_t setTxPower(int8_t txPower);
     virtual void        getPermittedTxPowerValues(const int8_t **valueArrayPP, size_t *countP);