Skip to content

Commit a052afd

Browse files
committed
BLE: Update APIs to take advantage of ble::peer_address_type_t
Deprecation: * Gap::AdvertisementCallback::addressType has been deprecated in favor of Gap::AdvertisementCallback::peerAddrType. * Gap::ConnectionCallbackParams::peerAddrType has been deprecated in favor of Gap::ConnectionCallbackParams::peerAddressType. * Gap::ConnectionCallbackParams::ownAddr has been deprecated in favor of nothing else as this information may be not available. Overloads added to accept a peer_address_t: * Gap::connect * Gap::processConnectionEvent * Gap::processAdvertisingReport
1 parent 0eb680a commit a052afd

File tree

4 files changed

+593
-98
lines changed

4 files changed

+593
-98
lines changed

features/FEATURE_BLE/ble/BLE.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,7 @@ class BLE
457457
ble_error_t setAddress(
458458
BLEProtocol::AddressType_t type,
459459
const BLEProtocol::AddressBytes_t address
460-
) {
461-
return gap().setAddress(type, address);
462-
}
460+
);
463461

464462
/**
465463
* Fetch the Bluetooth Low Energy MAC address and type.
@@ -1009,9 +1007,7 @@ class BLE
10091007
ble_error_t connect(const BLEProtocol::AddressBytes_t peerAddr,
10101008
BLEProtocol::AddressType_t peerAddrType = BLEProtocol::AddressType::RANDOM_STATIC,
10111009
const Gap::ConnectionParams_t *connectionParams = NULL,
1012-
const GapScanningParams *scanParams = NULL) {
1013-
return gap().connect(peerAddr, peerAddrType, connectionParams, scanParams);
1014-
}
1010+
const GapScanningParams *scanParams = NULL);
10151011

10161012
/**
10171013
* This call initiates the disconnection procedure, and its completion is
@@ -1045,9 +1041,7 @@ class BLE
10451041
* connection.
10461042
*/
10471043
MBED_DEPRECATED("Use ble.gap().disconnect(...)")
1048-
ble_error_t disconnect(Gap::DisconnectionReason_t reason) {
1049-
return gap().disconnect(reason);
1050-
}
1044+
ble_error_t disconnect(Gap::DisconnectionReason_t reason);
10511045

10521046
/**
10531047
* Returns the current Gap state of the device using a bitmask that

0 commit comments

Comments
 (0)