23#include <NimBLEAdvertisedDevice.h>
47 MinewS1 s1_interpreter = MinewS1::getInstance();
50 KKMK6P k6p = KKMK6P::getInstance();
56 if(
USB_DEBUG) Serial.println(
"\t-> sent BLE mail to publisher");
58 MQTTMailer instance = MQTTMailer::getInstance();
60 if(WiFi.status() == WL_CONNECTED && !
mqtt_client.connected()){
61 if(
USB_DEBUG) Serial.println(
"\t-> not connected");
65 std::string msg =
"{" + mail_ptr->
getMessage() +
", \"GATOR_MAC\": \"" + WiFi.macAddress().c_str() +
"\"}";
78 if(
USB_DEBUG) Serial.println(
"\t-> sent BLE mail to publisher");
79 MQTTMailer instance = MQTTMailer::getInstance();
81 if(WiFi.status() == WL_CONNECTED && !
mqtt_client.connected()){
82 if(
USB_DEBUG) Serial.println(
"\t-> not connected");
86 std::string msg =
"{" + mail_ptr->
getMessage() +
", \"GATOR_MAC\": \"" + WiFi.macAddress().c_str() +
"\"}";
This file implements BLE Sensor generic interface.
Contains the definition of the KKM K6P BLE sensor, which is based on the BLESensor....
Implementation of the Minew S1 bluetooth sensor family. Extends BLESensor.hpp.
Singleton used to identify and parse BLE transmissions from KKMK6P BLE Temperature and Humidity senso...
Definition KKM_K6P.hpp:65
bool advertisedDeviceIsK6P(NimBLEAdvertisedDevice *)
Check if the advertised device is a KKMK6P sensor.
Definition KKM_K6P.cpp:11
MQTTMail * parseAdvertisedData(NimBLEAdvertisedDevice *dev)
Retrieve data advertised by the device and save it if of interest.
Definition KKM_K6P.cpp:35
An object that stores data from which a topic and message can be extracted for publishing to an MQTT ...
Definition MQTTMailer.hpp:37
std::string getTopic()
The topic/destination this MQTT object should be published to.
Definition MQTTMailer.cpp:20
std::string getMessage()
Convert the data fields to an MQTT message string which can be published.
Definition MQTTMailer.cpp:11
Converts MQTTMail objects into viable MQTT messages so that they can be published.
Definition MQTTMailer.hpp:60
void reconnect(PubSubClient mqtt_client)
Attempt to reconnect to MQTT broker every 5 seconds until successful.
Definition MQTTMailer.cpp:48
Singleton used to identify and parse BLE transmissions from MinewS1 BLE Temperature and Humidity sens...
Definition MinewS1.hpp:27
MQTTMail * parseAdvertisedData(NimBLEAdvertisedDevice *dev)
Retrieve data advertised by the device and save it if of interest.
Definition MinewS1.cpp:33
bool advertisedDeviceIsS1(NimBLEAdvertisedDevice *dev)
Check if the advertised device is a Minew S1 sensor.
Definition MinewS1.cpp:11
Callbacks for BLE packets.
Definition ble_util.hpp:35
void onResult(NimBLEAdvertisedDevice *dev)
What to do when a device has been picked up by the scan.
Definition ble_util.hpp:45
Logging Utilities for detecting and selecting logging interfaces.
void log_data(std::string topic, std::string message)
Definition logger.hpp:32
const bool USB_DEBUG
USB serial debugging enabled.
Definition main.cpp:62
PubSubClient mqtt_client
MQTT client object for logging.