Open RTS
Full implementation of the Somfy RTS protocol
|
Represents the message "payload" sent by RTS remote controls. More...
#include <rts_frame.h>
Inherited by RTSFrame.
Data Fields | |
uint8_t | encryption_key: 8 |
8-bit encryption key, typically generated automatically. | |
enum rts_command | command: 4 |
The command we are sending, eg "Up", "Down", "My", or combinations of buttons found on remote controls. | |
uint16_t | rolling_code: 16 |
The rolling code of this frame. | |
uint32_t | remote_address: 24 |
The three-byte remote address sending this frame. | |
Related Symbols | |
(Note that these are not member symbols.) | |
void | rts_frame_init (struct rts_frame *frame, enum rts_command command, uint16_t rolling_code, uint32_t remote_address) |
Initialize an rts_frame with typical payload. | |
void | rts_frame_from_bytes (struct rts_frame *frame, const uint8_t *bytes) |
Initialize an rts_frame from the raw (deobfuscated) bytes received. | |
void | rts_frame_to_bytes (struct rts_frame *frame, uint8_t *bytes, bool obfuscate) |
Convert an rts_frame to byte representation, and optionally apply XOR obfuscation to make it ready to send. | |
void | rts_frame_obfuscate_bytes (uint8_t *bytes) |
Apply in-place XOR obfuscation to a raw byte array representation of a frame. | |
void | rts_frame_deobfuscate_bytes (uint8_t *dest, const uint8_t *src) |
Apply XOR deobfuscation to a raw byte array representation of a frame. | |
uint8_t | rts_frame_generate_checksum (const uint8_t *bytes) |
Generate a checksum for the raw (deobfuscated) bytes of a frame. | |
Represents the message "payload" sent by RTS remote controls.
It contains the command (eg. UP, DOWN, etc), the identity of the sender remote_address), and information to verify the authenticity of the payload (checksum, rolling_code, encryption_key).
uint8_t rts_frame::encryption_key |
8-bit encryption key, typically generated automatically.
First 4 bits are typically always 0xA, the last 4 bits increment every button press. Receivers don't typically care about this key, but we'll set it to something sensible automatically when you call a constructor.
enum rts_command rts_frame::command |
The command we are sending, eg "Up", "Down", "My", or combinations of buttons found on remote controls.
See rts_command enum.
uint16_t rts_frame::rolling_code |
The rolling code of this frame.
Rolling codes are sequential, unsigned 16-bit integers sent by remotes that provide some level of protection against cloning attacks. Receivers expect that the rolling code for each paired remote is higher than the previously received code (but not too much higher).
uint32_t rts_frame::remote_address |
The three-byte remote address sending this frame.
This is used by receivers to confirm this is a known, paired remote, and to validate rolling codes.