adding typedef for address_t

This commit is contained in:
Rohit Grover 2014-11-18 15:08:45 +00:00
parent 1af30a8952
commit 44f26b4024
2 changed files with 7 additions and 6 deletions

View file

@ -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);
}

View file

@ -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;