HW layer for the Nucleo board, it only work with old BLE_API

Dependents:   Hello_BLE F446RE-BLE

Fork of X_NUCLEO_IDB0XA1 by ST

Revision:
94:2993df23d1ac
Parent:
90:26c0c9807ab4
Child:
97:a89d28ad6092
diff -r 728699ac5613 -r 2993df23d1ac platform/src/btle.cpp
--- a/platform/src/btle.cpp	Thu Jul 23 14:48:36 2015 +0200
+++ b/platform/src/btle.cpp	Fri Jul 24 15:00:36 2015 +0000
@@ -311,7 +311,7 @@
                     {
                         DEBUG("EVT_BLUE_GATT_READ_PERMIT_REQ_OK\n\r");
                         evt_gatt_read_permit_req *pr = (evt_gatt_read_permit_req*)blue_evt->data;                        
-                        BlueNRGGattServer::getInstance().Read_Request_CB(pr->attr_handle);                                                
+                        BlueNRGGattServer::getInstance().Read_Request_CB(pr->attr_handle-1);                                                
                     }
                     break;
                     
@@ -327,7 +327,7 @@
                         
                         //Extract the GattCharacteristic from p_characteristics[] and find the properties mask
                         //If the char has handle 'x', then the value declaration will have the handle 'x+1'
-                        GattCharacteristic *p_char = BlueNRGGattServer::getInstance().getCharacteristicFromHandle(evt->attr_handle-1);
+                        GattCharacteristic *p_char = BlueNRGGattServer::getInstance().getCharacteristicFromHandle(evt->attr_handle);
                         if(p_char!=NULL) {
                             DEBUG("getProperties 0x%x\n\r",p_char->getProperties());
                             if((p_char->getProperties() &  (GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY
@@ -350,7 +350,7 @@
                                             GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE))) {
                                 
                                 GattWriteCallbackParams writeParams;
-                                writeParams.handle=evt->attr_handle;
+                                writeParams.handle=evt->attr_handle-1;
                                 writeParams.writeOp=GattWriteCallbackParams::OP_WRITE_REQ;//Where to find this property in BLUENRG?
                                 writeParams.len=evt->data_length;
                                 writeParams.data=evt->att_data;