BLE_API_Tiny_BLE

Dependents:   CSSE4011_BLE_IMU

Fork of BLE_API by Bluetooth Low Energy

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Wed May 13 08:51:08 2015 +0100
Parent:
384:48412313df56
Child:
386:d30591c3d39c
Commit message:
Synchronized with git rev c2e9d871
Author: Rohit Grover
add API for startScanning()

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	Wed May 13 08:51:07 2015 +0100
+++ b/public/BLEDevice.h	Wed May 13 08:51:08 2015 +0100
@@ -761,6 +761,11 @@
 }
 
 inline ble_error_t
+BLEDevice::startScanning(Gap::AdvertisementReportCallback_t callback) {
+    return transport->getGap().startScanning(scanningParams, callback);
+}
+
+inline ble_error_t
 BLEDevice::disconnect(Gap::DisconnectionReason_t reason)
 {
     return transport->getGap().disconnect(reason);
--- a/public/Gap.h	Wed May 13 08:51:07 2015 +0100
+++ b/public/Gap.h	Wed May 13 08:51:08 2015 +0100
@@ -19,6 +19,7 @@
 
 #include "GapAdvertisingData.h"
 #include "GapAdvertisingParams.h"
+#include "GapScanningParams.h"
 #include "GapEvents.h"
 #include "CallChain.h"
 
@@ -166,6 +167,7 @@
     virtual ble_error_t setAdvertisingData(const GapAdvertisingData &, const GapAdvertisingData &) = 0;
     virtual ble_error_t startAdvertising(const GapAdvertisingParams &)                             = 0;
     virtual ble_error_t stopAdvertising(void)                                                      = 0;
+    virtual ble_error_t startScanning(const GapScanningParams &scanningParams, AdvertisementReportCallback_t callback) = 0;
     virtual uint16_t    getMinAdvertisingInterval(void) const                                      = 0;
     virtual uint16_t    getMinNonConnectableAdvertisingInterval(void) const                        = 0;
     virtual uint16_t    getMaxAdvertisingInterval(void) const                                      = 0;
@@ -349,6 +351,7 @@
     LinkSecuredCallback_t            onLinkSecured;
     HandleSpecificEvent_t            onSecurityContextStored;
     PasskeyDisplayCallback_t         onPasskeyDisplay;
+    AdvertisementReportCallback_t    onAdvertisementReport;
     CallChain                        disconnectionCallChain;
 
 private: