|
Safe Sprinkler
Master/slave irrigation system (ESP-NOW + LoRaWAN)
|
#include "general/message_protocol.h"#include "master/config_serializer.h"#include "master/fifo.h"#include "master/lora_msg_protocol.h"#include "master/main_master.h"#include <stdint.h>
Go to the source code of this file.
Functions | |
| void | process_esp_msg (void) |
| Process one ESP-NOW message from the message FIFO. | |
| void | queue_lora_registration (uint8_t slave_idx) |
| Queue a LoRa registration message for a slave. | |
| void | queue_lora_periodic (void) |
| Queue a LoRa periodic status message for all registered slaves. | |
| void | queue_lora_alarm (uint8_t slave_id) |
| Queue a LoRa alarm message for a slave. | |
| void | send_lora (void) |
| Send one LoRa message from the lora_fifo. | |
| void process_esp_msg | ( | void | ) |
Process one ESP-NOW message from the message FIFO.
Reads from message_fifo, deserializes, and updates s_data or triggers LoRa queue. Call from main loop or task when messages are available.
| void queue_lora_alarm | ( | uint8_t | slave_id | ) |
Queue a LoRa alarm message for a slave.
| slave_id | Identifier of the slave that triggered the alarm |
| void queue_lora_periodic | ( | void | ) |
Queue a LoRa periodic status message for all registered slaves.
Serializes all slaves from s_data and pushes one message to lora_fifo.
| void queue_lora_registration | ( | uint8_t | slave_idx | ) |
Queue a LoRa registration message for a slave.
Serializes the slave at slave_idx from s_data and pushes to lora_fifo.
| slave_idx | Index into s_data (0 .. MAX_SLAVE_NUM-1) |
| void send_lora | ( | void | ) |
Send one LoRa message from the lora_fifo.
Pops one packet from lora_fifo, serializes it, and sends via LoRaWAN. Call when LoRa is idle and lora_fifo has data.