Graduation Thesis, use Nucleo and X-Nucleo BLE

Dependencies:   PulseSensor GSM Thermometer KalmanFilter

Revision:
2:16f6cfcd7505
Parent:
1:9eadd2dc4b6e
--- a/application/ble_healthcare_service.h	Wed Feb 14 01:29:53 2018 +0000
+++ b/application/ble_healthcare_service.h	Wed Feb 14 02:20:37 2018 +0000
@@ -53,25 +53,32 @@
         ble(_ble), 
         temperatureValueByte(initialTemp),
         hrmValueByte(hrmCounter),
-        tempMeasurement(GattCharacteristic::UUID_TEMPERATURE_MEASUREMENT_CHAR, 
-                       (TemperatureValueBytes *)temperatureValueByte.getPointer(), 
-                       GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
-        tempLocation(GattCharacteristic::UUID_TEMPERATURE_TYPE_CHAR, 
-                    &_tempLocation),
-        hrmRate(GattCharacteristic::UUID_HEART_RATE_MEASUREMENT_CHAR,
-               (HeartRateValueBytes *)hrmValueByte.getPointer(),
-//                hrmValueByte.getNumValueBytes(),
-//                HeartRateValueBytes::MAX_VALUE_BYTES,
-                GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
+        tempMeasurement(
+            GattCharacteristic::UUID_TEMPERATURE_MEASUREMENT_CHAR, 
+           (TemperatureValueBytes *)temperatureValueByte.getPointer(), 
+            GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
+        tempLocation(
+            GattCharacteristic::UUID_TEMPERATURE_TYPE_CHAR, 
+           &_tempLocation),
+        hrmRate(
+            GattCharacteristic::UUID_HEART_RATE_MEASUREMENT_CHAR,
+            hrmValueByte.getPointer(),
+            hrmValueByte.getNumValueBytes(),
+            HeartRateValueBytes::MAX_VALUE_BYTES,
+            GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
         hrmLocation(
             GattCharacteristic::UUID_BODY_SENSOR_LOCATION_CHAR,
             reinterpret_cast<uint8_t*>(&_hrmLocation))                    
         
         {
-            GattCharacteristic *HealthCareChars[] = {&tempMeasurement, &tempLocation, &hrmRate,&hrmLocation};
-            GattService         HealthCareService(GattService::UUID_HEART_RATE_SERVICE , HealthCareChars, sizeof(HealthCareChars) / sizeof(GattCharacteristic *));
+            GattCharacteristic *HealthThermChars[] = {&tempMeasurement, &tempLocation};
+            GattService         HealthThermService(GattService::UUID_HEALTH_THERMOMETER_SERVICE  , HealthThermChars, sizeof(HealthThermChars) / sizeof(GattCharacteristic *));
 
-            ble.addService(HealthCareService);
+            ble.addService(HealthThermService);
+            
+            GattCharacteristic *HRMChars[] = {&hrmRate,&hrmLocation};
+            GattService         HRMService(GattService::UUID_HEART_RATE_SERVICE , HRMChars, sizeof(HRMChars) / sizeof(GattCharacteristic *));
+            ble.addService(HRMService);
         }
 
     /**
@@ -223,7 +230,7 @@
     ReadOnlyGattCharacteristic<TemperatureValueBytes>  tempMeasurement;
     ReadOnlyGattCharacteristic<uint8_t>                tempLocation;
 
-    ReadOnlyGattCharacteristic<HeartRateValueBytes>                                hrmRate;
+    GattCharacteristic                                 hrmRate;
     ReadOnlyGattCharacteristic<uint8_t>                hrmLocation;    
 };