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.
WeatherStation.h@11:dbc310addbf6, 2019-03-19 (annotated)
- Committer:
- loicguibert
- Date:
- Tue Mar 19 20:48:48 2019 +0000
- Revision:
- 11:dbc310addbf6
- Parent:
- 5:0d9e292a9d06
- Child:
- 12:856286ad4cdc
Point 5 done
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| loicguibert | 4:bfe306335065 | 1 | #pragma once |
| loicguibert | 4:bfe306335065 | 2 | |
| loicguibert | 4:bfe306335065 | 3 | #include "Logger.h" |
| loicguibert | 11:dbc310addbf6 | 4 | #include "IDevKit.h" |
| loicguibert | 4:bfe306335065 | 5 | #include "LPS25HBDevice.h" |
| loicguibert | 4:bfe306335065 | 6 | #include "HDC1000Device.h" |
| loicguibert | 11:dbc310addbf6 | 7 | #include "MeasurementHistory.h" |
| loicguibert | 11:dbc310addbf6 | 8 | #include "ble/BLE.h" |
| loicguibert | 11:dbc310addbf6 | 9 | #include "GAPPeripheral.h" |
| loicguibert | 4:bfe306335065 | 10 | |
| loicguibert | 11:dbc310addbf6 | 11 | |
| loicguibert | 11:dbc310addbf6 | 12 | class WeatherStation : public GAPPeripheral { |
| loicguibert | 4:bfe306335065 | 13 | public: |
| loicguibert | 4:bfe306335065 | 14 | // constructor |
| loicguibert | 11:dbc310addbf6 | 15 | WeatherStation(IDevKit& iDevKit, Logger& logger, BLE& ble); |
| loicguibert | 4:bfe306335065 | 16 | |
| loicguibert | 4:bfe306335065 | 17 | // called for starting the weather station |
| loicguibert | 4:bfe306335065 | 18 | // it will start getting measurements and advertise with data measurements |
| loicguibert | 4:bfe306335065 | 19 | void start(); |
| loicguibert | 4:bfe306335065 | 20 | |
| loicguibert | 11:dbc310addbf6 | 21 | void advertise(void); |
| loicguibert | 11:dbc310addbf6 | 22 | |
| loicguibert | 4:bfe306335065 | 23 | // called by timer |
| loicguibert | 4:bfe306335065 | 24 | void performMeasurements(void); |
| loicguibert | 4:bfe306335065 | 25 | |
| loicguibert | 4:bfe306335065 | 26 | private: |
| loicguibert | 4:bfe306335065 | 27 | // data members |
| loicguibert | 4:bfe306335065 | 28 | |
| loicguibert | 4:bfe306335065 | 29 | // event queue for handling all events (including timers) |
| loicguibert | 4:bfe306335065 | 30 | events::EventQueue m_eventQueue; |
| loicguibert | 4:bfe306335065 | 31 | |
| loicguibert | 4:bfe306335065 | 32 | // measurement interval |
| loicguibert | 4:bfe306335065 | 33 | static const int m_measurementInterval; |
| loicguibert | 4:bfe306335065 | 34 | |
| loicguibert | 4:bfe306335065 | 35 | // blink interval |
| loicguibert | 4:bfe306335065 | 36 | static const int m_blinkInterval; |
| loicguibert | 4:bfe306335065 | 37 | |
| loicguibert | 4:bfe306335065 | 38 | // reference to dev kit |
| loicguibert | 11:dbc310addbf6 | 39 | IDevKit& m_iDevKit; |
| loicguibert | 4:bfe306335065 | 40 | |
| loicguibert | 4:bfe306335065 | 41 | // reference to logger |
| loicguibert | 4:bfe306335065 | 42 | Logger& m_logger; |
| loicguibert | 4:bfe306335065 | 43 | |
| loicguibert | 5:0d9e292a9d06 | 44 | // reference to devices |
| loicguibert | 4:bfe306335065 | 45 | LPS25HBDevice m_lps25hb; |
| loicguibert | 4:bfe306335065 | 46 | |
| loicguibert | 4:bfe306335065 | 47 | HDC1000Device m_hdc1000; |
| loicguibert | 11:dbc310addbf6 | 48 | |
| loicguibert | 11:dbc310addbf6 | 49 | MeasurementHistory m_history; |
| loicguibert | 11:dbc310addbf6 | 50 | |
| loicguibert | 4:bfe306335065 | 51 | }; |