ST / Mbed OS Node_BLE_Sensors_Device

Dependencies:   X_NUCLEO_IKS01A2

Fork of Node_BLE_Switch_Device by ST

Bluetooth Low Energy enabled device with environmental and inertial features, i.e. "Pressure", "Humidity", "Temperature", "Accelerometer", "Gyroscope", and "Magnetometer", plus "Switch" feature, compatible with BlueST Protocol.

Revision:
5:445024130101
Parent:
4:a10e2c94c8c8
Child:
6:01d49589410e
--- a/source/CustomService.h	Wed May 16 17:20:48 2018 +0000
+++ b/source/CustomService.h	Fri May 18 18:41:27 2018 +0000
@@ -93,9 +93,12 @@
         memset (packed_sensors, 0, SENSORS_DATA_LENGTH);
         int p = 0;
         STORE_LE_16(&packed_sensors[p], time_stamp);
-        STORE_LE_32(&packed_sensors[p += TIMESTAMP_LENGTH], pressure);
-        STORE_LE_16(&packed_sensors[p += PRESSURE_LENGTH], humidity);
-        STORE_LE_16(&packed_sensors[p += HUMIDITY_LENGTH], temperature);
+        p += TIMESTAMP_LENGTH;
+        STORE_LE_32(&packed_sensors[p], pressure);
+        p += PRESSURE_LENGTH;
+        STORE_LE_16(&packed_sensors[p], humidity);
+        p += HUMIDITY_LENGTH;
+        STORE_LE_16(&packed_sensors[p], temperature);
         ble.gattServer().write(get_sensors_handle(), (uint8_t *) &packed_sensors, SENSORS_DATA_LENGTH, 0);
     }