|
Data Gator
Hardware and software documentation for the Data Gator project.
|
Singleton used to identify and parse BLE transmissions from MinewS1 BLE Temperature and Humidity sensors. Inherits from BLESensor.hpp. More...
#include <MinewS1.hpp>


Public Member Functions | |
| bool | advertisedDeviceIsS1 (NimBLEAdvertisedDevice *dev) |
| Check if the advertised device is a Minew S1 sensor. | |
| MQTTMail * | parseAdvertisedData (NimBLEAdvertisedDevice *dev) |
| Retrieve data advertised by the device and save it if of interest. | |
| float | getTemp () |
| Read the temperature from the sensor data packet. | |
| float | getHumidity () |
| Read the humidity from the sensor data packet. | |
| int | getVoltage () |
| Read the sensor's battery voltage from the sensor data packet. | |
| uint32_t | timeUp () |
| Read the time the sensor has been running from the sensor data packet. | |
| BLEAddress | getMAC () |
| Read the sensor BLE MAC address from the sensor data packet. | |
| std::string | toJSON (double temp, double humidity) |
| Convert temperature and humidity values to a JSON object string. | |
| std::string | getSensorType () |
| Get the string identifier for the sensor brand and model. | |
Static Public Member Functions | |
| static MinewS1 & | getInstance () |
Private Member Functions | ||
| struct { | ||
| uint8_t id = 0x00 | ||
| uint16_t unknown = 0x0000 | ||
| int16_t temp = 0x0000 | ||
| uint16_t humidity = 0x0000 | ||
| uint8_t address [6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00} | ||
| } | __attribute__ ((packed)) HT_Frame | |
| HT data struct. | ||
| struct { | ||
| uint8_t id = 0x00 | ||
| uint16_t unknown = 0x0000 | ||
| uint8_t address [6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00} | ||
| char name [2] = {0x00, 0x00} | ||
| } | __attribute__ ((packed)) INFO_Frame | |
| Info struct. | ||
| struct { | ||
| uint8_t frameType = 0x00 | ||
| uint8_t version = 0x00 | ||
| uint16_t volt = 0x0000 | ||
| int16_t temp = 0x0000 | ||
| uint32_t advCount = 0x00000000 | ||
| uint32_t tmil = 0x00000000 | ||
| } | __attribute__ ((packed)) TLM_Frame | |
| Eddystone struct. | ||
| struct { | ||
| uint8_t manufacturerID [6] | ||
| } | __attribute__ ((packed)) iBeacon_Frame | |
| iBeacon struct | ||
Private Attributes | |
| int | serviceCount = 3 |
| NimBLEUUID | s1_services [3] |
Additional Inherited Members | |
Public Attributes inherited from BLESensor | |
| std::string | name |
| Name of the sensor... not unique, generally something generic such as brand and model. | |
| std::string | mac_address |
| Mac address of sensor BLE for unique ID. | |
Singleton used to identify and parse BLE transmissions from MinewS1 BLE Temperature and Humidity sensors. Inherits from BLESensor.hpp.
| bool MinewS1::advertisedDeviceIsS1 | ( | NimBLEAdvertisedDevice * | dev | ) |
Check if the advertised device is a Minew S1 sensor.
| [in] | dev | The advertised data received |
true if the device has a service UUID that is recognized, false otherwise | float MinewS1::getHumidity | ( | ) |
Read the humidity from the sensor data packet.
Convert uint16_t from HT_Frame to a float relative humidity value.
|
virtual |
Get the string identifier for the sensor brand and model.
Implements BLESensor.
| float MinewS1::getTemp | ( | ) |
Read the temperature from the sensor data packet.
Convert the uint16_t in HT_Frame to a float temperature value in Celsius.
| int MinewS1::getVoltage | ( | ) |
Read the sensor's battery voltage from the sensor data packet.
Gets the voltage.
| MQTTMail * MinewS1::parseAdvertisedData | ( | NimBLEAdvertisedDevice * | dev | ) |
Retrieve data advertised by the device and save it if of interest.
| [in] | dev | device and data that were broadcast |
| [in] | debug | flag noting whether serial debug summary is desired |
Convert temperature and humidity values to a JSON object string.
Implements BLESensor.
|
private |