add ScanParams to connect()

This commit is contained in:
Rohit Grover 2015-05-20 12:12:39 +01:00
parent b899ac13e9
commit 25bef2bd6e
2 changed files with 7 additions and 2 deletions

View file

@ -320,6 +320,7 @@ public:
ble_error_t stopScan(void);
ble_error_t connect(const Gap::Address_t peerAddr, Gap::AddressType_t peerAddrType = Gap::ADDR_TYPE_RANDOM_STATIC);
ble_error_t connect(const Gap::Address_t peerAddr, Gap::AddressType_t peerAddrType, const GapScanningParams &scanParams);
/**
* This call initiates the disconnection procedure, and its completion will
@ -861,7 +862,11 @@ BLEDevice::stopScan(void) {
inline ble_error_t
BLEDevice::connect(const Gap::Address_t peerAddr, Gap::AddressType_t peerAddrType) {
return transport->getGap().connect(peerAddr, peerAddrType);
return transport->getGap().connect(peerAddr, peerAddrType, scanningParams);
}
inline ble_error_t
BLEDevice::connect(const Gap::Address_t peerAddr, Gap::AddressType_t peerAddrType, const GapScanningParams &scanParams) {
return transport->getGap().connect(peerAddr, peerAddrType, scanParams);
}
inline ble_error_t

View file

@ -177,7 +177,7 @@ private:
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 connect(const Address_t peerAddr, Gap::AddressType_t peerAddrType, const GapScanningParams &scanParams) = 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;