|
Sentinel
|
DHT Task Implementation File. More...
#include "tasks/dhtTask.h"#include "SensorData.h"#include "sensors/dht22.h"#include "utils/threadsafe_serial.h"#include <Arduino.h>#include <cmath>#include <cstring>Macros | |
| #define | QUEUE_SEND_TIMEOUT_MS 1000 |
| #define | NETWORK_CONNECTED_BIT BIT0 |
| #define | DHT_MIN_TEMP -40.0f |
| #define | DHT_MAX_TEMP 80.0f |
| #define | DHT_MIN_HUM 0.0f |
| #define | DHT_MAX_HUM 100.0f |
Functions | |
| bool | isValidDHTReading (float temp, float hum) |
| Check if DHT reading is valid. | |
| void | sendDHTData (const sensor_message_t &msg) |
| void | dhtTask (void *parameter) |
| DHT Task function. | |
Variables | |
| QueueHandle_t | dataQueue |
| EventGroupHandle_t | networkEventGroup |
| SemaphoreHandle_t | networkEventMutex |
DHT Task Implementation File.
This file contains the implementation of the dhtTask function, which is used to handle DHT sensor operations in a FreeRTOS task. The task is responsible for reading temperature and humidity data from the DHT sensor and sending it to a queue for processing.
| void dhtTask | ( | void * | parameter | ) |
DHT Task function.
This function handles DHT sensor operations in a FreeRTOS task. It reads temperature and humidity data from the DHT sensor and sends it to a queue for processing. The task runs in an infinite loop, waiting for data to be available in the queue. When data is received, it is sent to the network for processing.
| bool isValidDHTReading | ( | float | temp, |
| float | hum ) |
Check if DHT reading is valid.
| temp | |
| hum |