From cc30c92fa5a3034b671f00f14d51ca12f2381b03 Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Wed, 20 May 2015 12:54:18 +0100 Subject: [PATCH] pass in some useful connection paramters from connect() --- public/BLEDevice.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/public/BLEDevice.h b/public/BLEDevice.h index 7cb4e86..de47f4d 100644 --- a/public/BLEDevice.h +++ b/public/BLEDevice.h @@ -862,12 +862,24 @@ BLEDevice::stopScan(void) { inline ble_error_t BLEDevice::connect(const Gap::Address_t peerAddr, Gap::AddressType_t peerAddrType) { - Gap::ConnectionParams_t connectionParams; + Gap::ConnectionParams_t connectionParams = { + .minConnectionInterval = 30, + .maxConnectionInterval = 100, + .slaveLatency = 0, + .connectionSupervisionTimeout = 400 + }; + return transport->getGap().connect(peerAddr, peerAddrType, scanningParams, connectionParams); } inline ble_error_t BLEDevice::connect(const Gap::Address_t peerAddr, Gap::AddressType_t peerAddrType, const GapScanningParams &scanParams) { - Gap::ConnectionParams_t connectionParams; + Gap::ConnectionParams_t connectionParams = { + .minConnectionInterval = 30, + .maxConnectionInterval = 100, + .slaveLatency = 0, + .connectionSupervisionTimeout = 400 + }; + return transport->getGap().connect(peerAddr, peerAddrType, scanParams, connectionParams); }