Open RTS
Full implementation of the Somfy RTS protocol
Loading...
Searching...
No Matches
RTSFrameBuilder.hpp
Go to the documentation of this file.
1#ifndef RTS_FRAME_BUILDER_HPP
2#define RTS_FRAME_BUILDER_HPP
3
5
6#include "RTSFrame.hpp"
7
32{
33 public:
42 typedef void (*FrameCallback)(RTSFrame *frame, uint8_t repeatCount,
43 uint32_t repeatDuration, void *userData);
44
51
59 void setFrameCallback(FrameCallback callback, void *userData = nullptr);
60
69 void handlePulse(bool state, uint32_t micros);
70
71 private:
72 // Wrapper function to convert rts_frame_builder callbacks
73 static void callbackWrapper(rts_frame *frame, uint8_t repeatCount,
74 uint32_t repeatDuration, void *userData);
75
76 // User provided frame callback
77 FrameCallback frameCallback = nullptr;
78 void *frameCallbackUserData = nullptr;
79
80 friend class RTSPulseSource;
81};
82
87#endif // RTS_FRAME_BUILDER_HPP
Assembles pulses received via RTSFrameBuilder::handlePulse, into a complete RTSFrame,...
Definition RTSFrameBuilder.hpp:32
void handlePulse(bool state, uint32_t micros)
Inform the frame builder about a new pulse.
Definition RTSFrameBuilder.cpp:16
void setFrameCallback(FrameCallback callback, void *userData=nullptr)
Set a callback to call when new complete frames are received.
Definition RTSFrameBuilder.cpp:8
void(* FrameCallback)(RTSFrame *frame, uint8_t repeatCount, uint32_t repeatDuration, void *userData)
Frame callback function type.
Definition RTSFrameBuilder.hpp:42
Represents the message "payload" sent by RTS remote controls.
Definition RTSFrame.hpp:24
Provides an interface for a source of RTS pulses, eg a GPIO or radio.
Definition RTSPulseSource.hpp:28
struct rts_timings * RTS_TIMINGS_DEFAULT
Default timings, suitable for most application.
Definition rts_timings.c:15
Assembles pulses received via rts_frame_builder_handle_pulse, into a complete rts_frame,...
Definition rts_frame_builder.h:36
Represents the message "payload" sent by RTS remote controls.
Definition rts_frame.h:32
Timing definitions for encoding and decoding frames to pulses.
Definition rts_timings.h:31