3-phase PV router
Loading...
Searching...
No Matches
remote_loads.h
Go to the documentation of this file.
1
27
28#ifndef REMOTE_LOADS_H
29#define REMOTE_LOADS_H
30
31#include <Arduino.h>
32
33#include "config_system.h"
34#include "types.h"
35#include "config_derived.h"
36
37#include "remote_loads_core.h"
38#include "utils_rf.h" // For shared RF configuration
39
56{
57 if constexpr (REMOTE_LOADS_PRESENT)
58 {
60 {
61 return;
62 }
63
64 remoteLoads.sendPending(RFConfig::REMOTE_NODE_ID, [](uint8_t nodeId, uint8_t payload)
65 {
66 // fire and forget - no ACK, so the main loop is never blocked waiting on a reply
67 SharedRF::radio().send(nodeId, &payload, sizeof(payload), false);
68 });
69 }
70}
71
72#endif // REMOTE_LOADS_H
The configuration as the firmware uses it: the settings, and what is built from them.
RemoteLoadCore< NO_OF_REMOTE_UNITS > remoteLoads
The one and only remote-load controller.
constexpr bool REMOTE_LOADS_PRESENT
Basic configuration values to be set by the end-user.
constexpr uint8_t REMOTE_NODE_ID[]
Node ID of each remote load unit, unit 1 first (only if REMOTE_LOADS_PRESENT=true)
Definition config_rf.h:53
RFM69 & radio()
Accessor for the shared RFM69 instance.
Definition utils_rf.h:44
bool initialized
Definition utils_rf.h:50
void processRemoteLoadTransmissions()
Process pending RF transmissions.
Unit grouping and payload bookkeeping for remotely controlled loads.
Some basics classes/types.
RF module support for RFM69.