BLE_API_Tiny_BLE
Fork of BLE_API by
Revision 130:e6726fd8fc08, committed 2014-11-21
- Comitter:
- rgrover1
- Date:
- Fri Nov 21 09:23:22 2014 +0000
- Parent:
- 129:fca6e5ba7d39
- Child:
- 131:cb0cf2e6775f
- Commit message:
- Synchronized with git rev 44f26b40
Author: Rohit Grover
adding typedef for address_t
Changed in this revision
public/BLEDevice.h | Show annotated file Show diff for this revision Revisions of this file |
public/Gap.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/public/BLEDevice.h Fri Nov 21 09:23:22 2014 +0000 +++ b/public/BLEDevice.h Fri Nov 21 09:23:22 2014 +0000 @@ -43,13 +43,13 @@ * Set the BTLE MAC address and type. * @return BLE_ERROR_NONE on success. */ - ble_error_t setAddress(Gap::addr_type_t type, const uint8_t address[Gap::ADDR_LEN]); + ble_error_t setAddress(Gap::addr_type_t type, const Gap::address_t address); /** * Fetch the BTLE MAC address and type. * @return BLE_ERROR_NONE on success. */ - ble_error_t getAddress(Gap::addr_type_t *typeP, uint8_t address[Gap::ADDR_LEN]); + ble_error_t getAddress(Gap::addr_type_t *typeP, Gap::address_t address); /** * @param[in] advType @@ -366,13 +366,13 @@ } inline ble_error_t -BLEDevice::setAddress(Gap::addr_type_t type, const uint8_t address[Gap::ADDR_LEN]) +BLEDevice::setAddress(Gap::addr_type_t type, const Gap::address_t address) { return transport->getGap().setAddress(type, address); } inline ble_error_t -BLEDevice::getAddress(Gap::addr_type_t *typeP, uint8_t address[Gap::ADDR_LEN]) +BLEDevice::getAddress(Gap::addr_type_t *typeP, Gap::address_t address) { return transport->getGap().getAddress(typeP, address); }
--- a/public/Gap.h Fri Nov 21 09:23:22 2014 +0000 +++ b/public/Gap.h Fri Nov 21 09:23:22 2014 +0000 @@ -41,6 +41,7 @@ } addr_type_t; static const unsigned ADDR_LEN = 6; + typedef uint8_t address_t[ADDR_LEN]; /** * enumeration for disconnection reasons. The values for these reasons are @@ -72,8 +73,8 @@ public: /* These functions must be defined in the sub-class */ - virtual ble_error_t setAddress(addr_type_t type, const uint8_t address[ADDR_LEN]) = 0; - virtual ble_error_t getAddress(addr_type_t *typeP, uint8_t address[ADDR_LEN]) = 0; + virtual ble_error_t setAddress(addr_type_t type, const address_t address) = 0; + virtual ble_error_t getAddress(addr_type_t *typeP, address_t address) = 0; virtual ble_error_t setAdvertisingData(const GapAdvertisingData &, const GapAdvertisingData &) = 0; virtual ble_error_t startAdvertising(const GapAdvertisingParams &) = 0; virtual ble_error_t stopAdvertising(void) = 0;