simplify BLE_GAP_ADDR_LEN to ADDR_LEN defined in Gap.h
This commit is contained in:
parent
2220853d1e
commit
c3d07e49ea
2 changed files with 6 additions and 6 deletions
|
@ -304,7 +304,7 @@ uint16_t nRF51Gap::getConnectionHandle(void)
|
|||
@endcode
|
||||
*/
|
||||
/**************************************************************************/
|
||||
ble_error_t nRF51Gap::setAddress(addr_type_t type, const uint8_t address[BLE_GAP_ADDR_LEN])
|
||||
ble_error_t nRF51Gap::setAddress(addr_type_t type, const uint8_t address[ADDR_LEN])
|
||||
{
|
||||
if (type > ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE) {
|
||||
return BLE_ERROR_PARAM_OUT_OF_RANGE;
|
||||
|
@ -312,14 +312,14 @@ ble_error_t nRF51Gap::setAddress(addr_type_t type, const uint8_t address[BLE_GAP
|
|||
|
||||
ble_gap_addr_t dev_addr;
|
||||
dev_addr.addr_type = type;
|
||||
memcpy(dev_addr.addr, address, BLE_GAP_ADDR_LEN);
|
||||
memcpy(dev_addr.addr, address, ADDR_LEN);
|
||||
|
||||
ASSERT_INT(ERROR_NONE, sd_ble_gap_address_set(BLE_GAP_ADDR_CYCLE_MODE_NONE, &dev_addr), BLE_ERROR_PARAM_OUT_OF_RANGE);
|
||||
|
||||
return BLE_ERROR_NONE;
|
||||
}
|
||||
|
||||
ble_error_t nRF51Gap::getAddress(addr_type_t *typeP, uint8_t addressP[BLE_GAP_ADDR_LEN])
|
||||
ble_error_t nRF51Gap::getAddress(addr_type_t *typeP, uint8_t addressP[ADDR_LEN])
|
||||
{
|
||||
ble_gap_addr_t dev_addr;
|
||||
if (sd_ble_gap_address_get(&dev_addr) != NRF_SUCCESS) {
|
||||
|
@ -330,7 +330,7 @@ ble_error_t nRF51Gap::getAddress(addr_type_t *typeP, uint8_t addressP[BLE_GAP_AD
|
|||
*typeP = static_cast<addr_type_t>(dev_addr.addr_type);
|
||||
}
|
||||
if (addressP != NULL) {
|
||||
memcpy(addressP, dev_addr.addr, BLE_GAP_ADDR_LEN);
|
||||
memcpy(addressP, dev_addr.addr, ADDR_LEN);
|
||||
}
|
||||
return BLE_ERROR_NONE;
|
||||
}
|
||||
|
|
|
@ -39,8 +39,8 @@ public:
|
|||
}
|
||||
|
||||
/* Functions that must be implemented from Gap */
|
||||
virtual ble_error_t setAddress(addr_type_t type, const uint8_t address[BLE_GAP_ADDR_LEN]);
|
||||
virtual ble_error_t getAddress(addr_type_t *typeP, uint8_t addressP[BLE_GAP_ADDR_LEN]);
|
||||
virtual ble_error_t setAddress(addr_type_t type, const uint8_t address[ADDR_LEN]);
|
||||
virtual ble_error_t getAddress(addr_type_t *typeP, uint8_t addressP[ADDR_LEN]);
|
||||
virtual ble_error_t setAdvertisingData(const GapAdvertisingData &, const GapAdvertisingData &);
|
||||
virtual ble_error_t startAdvertising(const GapAdvertisingParams &);
|
||||
virtual ble_error_t stopAdvertising(void);
|
||||
|
|
Loading…
Reference in a new issue