BLE lib

Fork of Nucleo_BLE_BlueNRG by STM32 eKairn

Revision:
3:89230b3e003b
Parent:
0:a948f5f3904c
Child:
4:c8ed8022e996
--- a/btle/src/btle.cpp	Mon Dec 22 18:25:34 2014 +0000
+++ b/btle/src/btle.cpp	Tue Jan 20 12:11:36 2015 +0000
@@ -263,6 +263,15 @@
                             if((p_char->getProperties() &
                                         (GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE|
                                             GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE))) {
+
+                                // Copy the Data to the Buffer
+                                if ((p_char->getValueAttribute().getValuePtr() != NULL) && (p_char->getValueAttribute().getInitialLength() >= evt->data_length)) {
+                                        uint8_t *dst, *src;
+                                        dst= p_char->getValueAttribute().getValuePtr();
+                                        src = evt->att_data;
+                                        for(int i=0;i<evt->data_length;i++) dst[i]=src[i];
+                                    }
+
                                 
                                 BlueNRGGattServer::getInstance().handleEvent(GattServerEvents::GATT_EVENT_DATA_WRITTEN, evt->attr_handle);
                                 //Write the actual Data to the Attr Handle? (uint8_1[])evt->att_data contains the data