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); }