High level Bluetooth Low Energy API and radio abstraction layer

Dependencies:   nRF51822

Dependents:   LinkNode_LIS3DH

Fork of BLE_API by Bluetooth Low Energy

Revision:
591:0545b8836f53
Parent:
590:60b07657557e
Child:
592:58244650991b
--- a/public/BLEDevice.h	Fri Jun 19 15:52:51 2015 +0100
+++ b/public/BLEDevice.h	Fri Jun 19 15:52:51 2015 +0100
@@ -319,8 +319,16 @@
      */
     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);
+    /**
+     * [connect description]
+     * @param  peerAddr     [description]
+     * @param  peerAddrType [description]
+     * @return              [description]
+     */
+    ble_error_t connect(const Gap::Address_t           peerAddr,
+                        Gap::AddressType_t             peerAddrType     = Gap::ADDR_TYPE_RANDOM_STATIC,
+                        const Gap::ConnectionParams_t *connectionParams = NULL,
+                        const GapScanningParams       *scanParams       = NULL);
 
     /**
      * This call initiates the disconnection procedure, and its completion will
@@ -861,26 +869,11 @@
 }
 
 inline ble_error_t
-BLEDevice::connect(const Gap::Address_t peerAddr, Gap::AddressType_t peerAddrType) {
-    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 = {
-        .minConnectionInterval = 30,
-        .maxConnectionInterval = 100,
-        .slaveLatency = 0,
-        .connectionSupervisionTimeout = 400
-    };
-
-    return transport->getGap().connect(peerAddr, peerAddrType, scanParams, connectionParams);
+BLEDevice::connect(const Gap::Address_t           peerAddr,
+                   Gap::AddressType_t             peerAddrType,
+                   const Gap::ConnectionParams_t *connectionParams,
+                   const GapScanningParams       *scanParams) {
+    return transport->getGap().connect(peerAddr, peerAddrType, connectionParams, scanParams);
 }
 
 inline ble_error_t