Merge pull request #88 from rgrover/develop

follow the extraction of address related types from Gap.h into BLEProtocol.h
This commit is contained in:
Rohit Grover 2015-12-15 13:03:38 +00:00
commit 752e2ba43b
2 changed files with 5 additions and 5 deletions

View File

@ -154,8 +154,8 @@ static void btle_handler(ble_evt_t *p_ble_evt)
const ble_gap_addr_t *own = &p_ble_evt->evt.gap_evt.params.connected.own_addr;
nRF5xGap::getInstance().processConnectionEvent(handle,
role,
static_cast<Gap::AddressType_t>(peer->addr_type), peer->addr,
static_cast<Gap::AddressType_t>(own->addr_type), own->addr,
static_cast<BLEProtocol::AddressType::Type>(peer->addr_type), peer->addr,
static_cast<BLEProtocol::AddressType::Type>(own->addr_type), own->addr,
params);
break;
}

View File

@ -367,7 +367,7 @@ uint16_t nRF5xGap::getConnectionHandle(void)
@code
uint8_t device_address[6] = { 0xca, 0xfe, 0xf0, 0xf0, 0xf0, 0xf0 };
nrf.getGap().setAddress(Gap::ADDR_TYPE_RANDOM_STATIC, device_address);
nrf.getGap().setAddress(Gap::BLEProtocol::AddressType::RANDOM_STATIC, device_address);
@endcode
*/
@ -381,12 +381,12 @@ ble_error_t nRF5xGap::setAddress(AddressType_t type, const Address_t address)
When using Random Private addresses, the cycle mode must be Auto.
In auto mode, the given address is ignored.
*/
if ((type == ADDR_TYPE_PUBLIC) || (type == ADDR_TYPE_RANDOM_STATIC))
if ((type == BLEProtocol::AddressType::PUBLIC) || (type == BLEProtocol::AddressType::RANDOM_STATIC))
{
cycle_mode = BLE_GAP_ADDR_CYCLE_MODE_NONE;
memcpy(dev_addr.addr, address, ADDR_LEN);
}
else if ((type == ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE) || (type == ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE))
else if ((type == BLEProtocol::AddressType::RANDOM_PRIVATE_RESOLVABLE) || (type == BLEProtocol::AddressType::RANDOM_PRIVATE_NON_RESOLVABLE))
{
cycle_mode = BLE_GAP_ADDR_CYCLE_MODE_AUTO;
// address is ignored when in auto mode