adaptation for book and plug demo

Dependents:   BookAndPlug

Fork of BLE_API by Bluetooth Low Energy

Files at this revision

API Documentation at this revision

Comitter:
vrou44
Date:
Mon May 14 12:32:05 2018 +0000
Parent:
1208:65474dc93927
Commit message:
changes for Book And Plug Proto

Changed in this revision

ble/SecurityManager.h Show annotated file Show diff for this revision Revisions of this file
ble/UUID.h Show annotated file Show diff for this revision Revisions of this file
ble/services/UARTService.h Show annotated file Show diff for this revision Revisions of this file
source/services/UARTService.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 65474dc93927 -r a593e0ecff7d ble/SecurityManager.h
--- a/ble/SecurityManager.h	Wed Sep 14 14:18:00 2016 +0100
+++ b/ble/SecurityManager.h	Mon May 14 12:32:05 2018 +0000
@@ -106,7 +106,8 @@
      * @return BLE_ERROR_NONE on success.
      */
     virtual ble_error_t init(bool                     enableBonding = true,
-                             bool                     requireMITM   = true,
+                             // bool                     requireMITM   = true, HD
+                             bool                     requireMITM   = false,
                              SecurityIOCapabilities_t iocaps        = IO_CAPS_NONE,
                              const Passkey_t          passkey       = NULL) {
         /* Avoid compiler warnings about unused variables. */
diff -r 65474dc93927 -r a593e0ecff7d ble/UUID.h
--- a/ble/UUID.h	Wed Sep 14 14:18:00 2016 +0100
+++ b/ble/UUID.h	Mon May 14 12:32:05 2018 +0000
@@ -313,7 +313,8 @@
         return !(*this == other);
     }
 
-private:
+//private:                  // HD !!!!
+public:
     /**
      * The UUID type. Refer to UUID_Type_t.
      */
diff -r 65474dc93927 -r a593e0ecff7d ble/services/UARTService.h
--- a/ble/services/UARTService.h	Wed Sep 14 14:18:00 2016 +0100
+++ b/ble/services/UARTService.h	Mon May 14 12:32:05 2018 +0000
@@ -164,13 +164,15 @@
         return receiveBuffer[receiveBufferIndex++];
     }
 
-protected:
+//protected:
+public:                         //HD
     /**
      * This callback allows the UART service to receive updates to the
      * txCharacteristic. The application should forward the call to this
      * function from the global onDataWritten() callback handler; if that's
      * not used, this method can be used as a callback directly.
      */
+#if 0                           //HD
     void onDataWritten(const GattWriteCallbackParams *params) {
         if (params->handle == getTXCharacteristicHandle()) {
             uint16_t bytesRead = params->len;
@@ -181,8 +183,12 @@
             }
         }
     }
+#else
+    void onDataWritten(const GattWriteCallbackParams *params) ;
+#endif
 
-protected:
+//protected:
+public:                         //HD
     BLE                &ble;
 
     uint8_t             receiveBuffer[BLE_UART_SERVICE_MAX_DATA_LEN]; /**< The local buffer into which we receive
diff -r 65474dc93927 -r a593e0ecff7d source/services/UARTService.cpp
--- a/source/services/UARTService.cpp	Wed Sep 14 14:18:00 2016 +0100
+++ b/source/services/UARTService.cpp	Mon May 14 12:32:05 2018 +0000
@@ -20,6 +20,7 @@
     0x6E, 0x40, 0x00, 0x00, 0xB5, 0xA3, 0xF3, 0x93,
     0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E,
 };
+
 const uint16_t UARTServiceShortUUID                 = 0x0001;
 const uint16_t UARTServiceTXCharacteristicShortUUID = 0x0002;
 const uint16_t UARTServiceRXCharacteristicShortUUID = 0x0003;
@@ -38,4 +39,5 @@
 const uint8_t  UARTServiceRXCharacteristicUUID[UUID::LENGTH_OF_LONG_UUID] = {
     0x6E, 0x40, (uint8_t)(UARTServiceRXCharacteristicShortUUID >> 8), (uint8_t)(UARTServiceRXCharacteristicShortUUID & 0xFF), 0xB5, 0xA3, 0xF3, 0x93,
     0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E,
-};
\ No newline at end of file
+};
+