yes Spada / Mbed OS programme
Revision:
12:856286ad4cdc
Parent:
11:dbc310addbf6
Child:
14:c5578b5edabe
--- a/WeatherStation.h	Tue Mar 19 20:48:48 2019 +0000
+++ b/WeatherStation.h	Mon Mar 25 14:54:43 2019 +0000
@@ -7,6 +7,7 @@
 #include "MeasurementHistory.h"
 #include "ble/BLE.h"
 #include "GAPPeripheral.h"
+#include <ctime>
 
 
 class WeatherStation : public GAPPeripheral {
@@ -18,10 +19,11 @@
   // it will start getting measurements and advertise with data measurements
   void start();
   
-  void advertise(void);
-  
   // called by timer
   void performMeasurements(void);
+  
+  //  Called at the end of performMeasurements(void): encode and send values to the GAP Peripheral
+  void setupAdvertisementPayload(double pressure, double temp, double humidity);
     
 private:
   // data members
@@ -35,6 +37,9 @@
   // blink interval
   static const int m_blinkInterval;
   
+  //Station name
+  static const string m_stationName;
+  
   // reference to dev kit
   IDevKit& m_iDevKit;
   
@@ -46,6 +51,10 @@
   
   HDC1000Device m_hdc1000;
   
+  //  reference to values' history storage
   MeasurementHistory m_history;
+  
+  //  reference to advertising payload
+  ServiceDataPayload dataPayload[1];
 
 };