From 44f26b40246c0adfa30d597bf6bc471429b7fc62 Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Tue, 18 Nov 2014 15:08:45 +0000 Subject: [PATCH] adding typedef for address_t --- public/BLEDevice.h | 8 ++++---- public/Gap.h | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/public/BLEDevice.h b/public/BLEDevice.h index e22c99c..c454dfd 100644 --- a/public/BLEDevice.h +++ b/public/BLEDevice.h @@ -43,13 +43,13 @@ public: * 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 @@ BLEDevice::reset(void) } 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); } diff --git a/public/Gap.h b/public/Gap.h index 7ed3110..9ea6b86 100644 --- a/public/Gap.h +++ b/public/Gap.h @@ -41,6 +41,7 @@ public: } 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: 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;