prova invio BLE

Dependents:   BLE_HeartRate_IDB04A1

Fork of BLE_API by Bluetooth Low Energy

Revision:
547:f84c514eee35
Parent:
546:9fdf3d960d12
Child:
548:623e4c0f0b6e
diff -r 9fdf3d960d12 -r f84c514eee35 public/BLE.h
--- a/public/BLE.h	Fri Jun 19 15:52:09 2015 +0100
+++ b/public/BLE.h	Fri Jun 19 15:52:09 2015 +0100
@@ -1131,9 +1131,18 @@
      *
      * @Note: it is also possible to setup a callback into a member function of
      * some object.
+     *
+     * @note: This API is now *deprecated* and will be dropped in the future.
+     * You should use the parallel API from GattServer directly. A former call
+     * to ble.onDataSent(...) should be replaced with
+     * ble.gap().onDataSent(...).
      */
-    void onDataSent(void (*callback)(unsigned count));
-    template <typename T> void onDataSent(T * objPtr, void (T::*memberPtr)(unsigned count));
+    void onDataSent(void (*callback)(unsigned count)) {
+        gattServer().onDataSent(callback);
+    }
+    template <typename T> void onDataSent(T * objPtr, void (T::*memberPtr)(unsigned count)) {
+        gattServer().onDataSent(objPtr, memberPtr);
+    }
 
     /**
      * Setup a callback for when a characteristic has its value updated by a
@@ -1268,16 +1277,6 @@
  * transport.*/
 
 inline void
-BLE::onDataSent(void (*callback)(unsigned count)) {
-    transport->getGattServer().setOnDataSent(callback);
-}
-
-template <typename T> inline void
-BLE::onDataSent(T *objPtr, void (T::*memberPtr)(unsigned count)) {
-    transport->getGattServer().setOnDataSent(objPtr, memberPtr);
-}
-
-inline void
 BLE::onDataWritten(void (*callback)(const GattWriteCallbackParams *eventDataP)) {
     transport->getGattServer().setOnDataWritten(callback);
 }