High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
Revision 441:2d864886aeca, committed 2015-06-19
- Comitter:
- rgrover1
- Date:
- Fri Jun 19 15:51:56 2015 +0100
- Parent:
- 440:21c83c010895
- Child:
- 442:c120ffca22fa
- Commit message:
- Synchronized with git rev b899ac13
Author: Rohit Grover
introduce API for BLEDevice::connect(peerAddr, peerAddrType)
Changed in this revision
public/BLEDevice.h | Show annotated file Show diff for this revision Revisions of this file |
public/Gap.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/public/BLEDevice.h Fri Jun 19 15:51:55 2015 +0100 +++ b/public/BLEDevice.h Fri Jun 19 15:51:56 2015 +0100 @@ -319,6 +319,8 @@ */ ble_error_t stopScan(void); + ble_error_t connect(const Gap::Address_t peerAddr, Gap::AddressType_t peerAddrType = Gap::ADDR_TYPE_RANDOM_STATIC); + /** * This call initiates the disconnection procedure, and its completion will * be communicated to the application with an invocation of the @@ -858,6 +860,11 @@ } inline ble_error_t +BLEDevice::connect(const Gap::Address_t peerAddr, Gap::AddressType_t peerAddrType) { + return transport->getGap().connect(peerAddr, peerAddrType); +} + +inline ble_error_t BLEDevice::disconnect(Gap::DisconnectionReason_t reason) { return transport->getGap().disconnect(reason);
--- a/public/Gap.h Fri Jun 19 15:51:55 2015 +0100 +++ b/public/Gap.h Fri Jun 19 15:51:56 2015 +0100 @@ -177,6 +177,7 @@ virtual uint16_t getMinAdvertisingInterval(void) const = 0; virtual uint16_t getMinNonConnectableAdvertisingInterval(void) const = 0; virtual uint16_t getMaxAdvertisingInterval(void) const = 0; + virtual ble_error_t connect(const Address_t peerAddr, Gap::AddressType_t peerAddrType) = 0; virtual ble_error_t disconnect(DisconnectionReason_t reason) = 0; virtual ble_error_t getPreferredConnectionParams(ConnectionParams_t *params) = 0; virtual ble_error_t setPreferredConnectionParams(const ConnectionParams_t *params) = 0;