Open RTS
Full implementation of the Somfy RTS protocol
Loading...
Searching...
No Matches
RTSFrame.hpp
Go to the documentation of this file.
1#ifndef RTS_FRAME_HPP
2#define RTS_FRAME_HPP
3
4#include <openrts/rts_frame.h>
5
23class RTSFrame : public rts_frame
24{
25 public:
34 RTSFrame(rts_command command, uint16_t rollingCode, uint32_t remoteAddress);
35
41 RTSFrame(uint8_t *bytes);
42
48 RTSFrame(rts_frame *frame);
49
56 void toBytes(uint8_t *bytes, bool obfuscate = false);
57
64 static void obfuscateBytes(uint8_t *bytes);
65
72 static void deobfuscateBytes(uint8_t *dest, uint8_t *src);
73
81 static uint8_t generateChecksum(uint8_t *bytes);
82};
83
88#endif // RTS_FRAME_HPP
Represents the message "payload" sent by RTS remote controls.
Definition RTSFrame.hpp:24
static void obfuscateBytes(uint8_t *bytes)
Apply in-place XOR obfuscation to a raw byte representation of a frame.
Definition RTSFrame.cpp:27
void toBytes(uint8_t *bytes, bool obfuscate=false)
Convert an RTSFrame to byte representation.
Definition RTSFrame.cpp:22
static uint8_t generateChecksum(uint8_t *bytes)
Generate a checksum for the raw (deobfuscated) bytes of a frame.
Definition RTSFrame.cpp:37
static void deobfuscateBytes(uint8_t *dest, uint8_t *src)
Apply XOR deobfuscation to a raw byte representation of a frame.
Definition RTSFrame.cpp:32
rts_command
Command sent by a remote, or received by a receiver as part of an rts_frame event.
Definition rts_command.h:24
Represents the message "payload" sent by RTS remote controls.
Definition rts_frame.h:32
enum rts_command command
The command we are sending, eg "Up", "Down", "My", or combinations of buttons found on remote control...
Definition rts_frame.h:45