Open RTS
Full implementation of the Somfy RTS protocol
Loading...
Searching...
No Matches
RTSRemote Class Reference

Simulates a physical RTS remote control. More...

#include <RTSRemote.hpp>

Inherits rts_remote.

Public Member Functions

 RTSRemote (RTSPulseOutput *output, RTSRemoteStore *store=nullptr, rts_timings *timings=RTS_TIMINGS_DEFAULT)
 Construct a RTSRemote instance.
 
void sendCommand (uint32_t address, rts_command command, bool repeated=false)
 Send a "button press" command.
 
void sendFrame (RTSFrame *frame, bool repeated=false)
 Send an RTS frame.
 
void sendPulse (bool state, uint32_t micros)
 Send a single pulse to the internal RTSPulseOutput.
 

Additional Inherited Members

Detailed Description

Simulates a physical RTS remote control.

It takes RTS commands (button presses), converts them into a series of pulses, then outputs those pulses to a RTSPulseOutput (eg. a GPIO or radio).

Remote rolling codes can be persisted by providing a rts_remote_store backend (eg. ESP32's non-volatile storage, or Arduino's EEPROM).

Constructor & Destructor Documentation

◆ RTSRemote()

RTSRemote::RTSRemote ( RTSPulseOutput output,
RTSRemoteStore store = nullptr,
rts_timings timings = RTS_TIMINGS_DEFAULT 
)

Construct a RTSRemote instance.

Parameters
outputwhere to send pulses to
storewhere to get/set remote rolling codes
timingsthe rts_timings struct to use for pulse encoding

Member Function Documentation

◆ sendCommand()

void RTSRemote::sendCommand ( uint32_t  address,
rts_command  command,
bool  repeated = false 
)

Send a "button press" command.

This is the simplest way to use an RTSRemote, which automatically creates an RTSFrame struct under the hood, and handles the incrementing of rolling codes in the internal RTSRemoteStore.

The generated RTSFrame is passed to RTSRemote::sendFrame.

Parameters
addressthe remote address to send from
commandthe rts command to send (see rts_command enum)
repeatedis this a "repeated" command, eg. from a button being held down? If so we won't increment the remote's rolling code

◆ sendFrame()

void RTSRemote::sendFrame ( RTSFrame frame,
bool  repeated = false 
)

Send an RTS frame.

This function converts the provided RTSFrame into a series of pulses, which are passed along to the internal RTSPulseOutput by RTSRemote::sendPulse.

Parameters
framethe rts_frame to send
repeatedis this a "repeated" command, eg. from a button being held down? If so we won't increment the remote's rolling code

◆ sendPulse()

void RTSRemote::sendPulse ( bool  state,
uint32_t  micros 
)

Send a single pulse to the internal RTSPulseOutput.

Parameters
stateboolean pulse logic state, true = HIGH, false = LOW
microshow long to set the pulse to this state, in microseconds

The documentation for this class was generated from the following files: