3-phase PV router
Loading...
Searching...
No Matches
remote_loads.h File Reference

Support for remotely controlled loads via RF using RFM69. More...

#include <Arduino.h>
#include "config_system.h"
#include "types.h"
#include "config_derived.h"
#include "remote_loads_core.h"
#include "utils_rf.h"
Include dependency graph for remote_loads.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void processRemoteLoadTransmissions ()
 Process pending RF transmissions.
 

Detailed Description

Support for remotely controlled loads via RF using RFM69.

Author
Frédéric Metrich (frede.nosp@m.ric..nosp@m.metri.nosp@m.ch@l.nosp@m.ive.f.nosp@m.r)
Version
3.0
Date
2026-11-21

Radio shell around RemoteLoadCore (remote_loads_core.h). The core decides what each remote unit should be told and when; this file does the telling, using the shared RFM69 instance from utils_rf.h.

Up to MAX_REMOTE_UNITS separate units are supported, each with its own node ID (RFConfig::REMOTE_NODE_ID[]) and its own one-byte payload. A unit is addressed when at least one entry of the load map names it.

Transmission policy, per unit:

  • state changes are sent on the next pass through loop()
  • an unchanged payload is refreshed every REMOTE_REFRESH_CYCLES mains cycles
  • compact bitmask format, 1 bit per load of that unit

Active when the load map holds at least one remote load; otherwise the whole RF path, radio instance included, is dropped by the linker.

Definition in file remote_loads.h.

Function Documentation

◆ processRemoteLoadTransmissions()

void processRemoteLoadTransmissions ( )
inline

Process pending RF transmissions.

Call this from the main loop to handle RF transmissions outside ISR context. This prevents blocking the ISR with RF communication delays.

Nothing is sent while the RF module is not initialized (missing, unpowered or badly wired at startup): the library would wait up to 1 s for a free channel on each send, then possibly forever for the "packet sent" flag, which a module that does not answer never raises. The payloads stay pending, and go out once sendResults() has brought the module up (it retries once per datalog period).

Note
Declared here but only usable once remoteLoads is declared (end of config.h); it is a template-free inline function, so that is resolved at the call site.

Definition at line 55 of file remote_loads.h.

Here is the call graph for this function:
Here is the caller graph for this function: