Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: WeatherStation.h
- Revision:
- 12:856286ad4cdc
- Parent:
- 11:dbc310addbf6
- Child:
- 14:c5578b5edabe
diff -r dbc310addbf6 -r 856286ad4cdc WeatherStation.h
--- 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];
};