Open RTS
Full implementation of the Somfy RTS protocol
Loading...
Searching...
No Matches
rts_receiver.h
Go to the documentation of this file.
1#ifndef RTS_RECEIVER_H
2#define RTS_RECEIVER_H
3
4#include "rts_frame.h"
5#include "rts_frame_builder.h"
6#include "rts_pulse_source.h"
7#include "rts_remote_store.h"
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
32
41
73 struct rts_frame_builder frame_builder;
74 struct rts_pulse_source *pulse_source;
75 struct rts_remote_store *remote_store;
76
77 void (*frame_callback)(enum rts_receiver_event event,
78 struct rts_frame *frame, void *user_data);
79 void *frame_user_data;
80
81 void (*mode_callback)(enum rts_receiver_mode mode, void *user_data);
82 void *mode_user_data;
83
84 uint8_t mode;
85 uint32_t mode_last_changed;
86 uint8_t event_fired;
87 uint8_t rolling_code_window;
88};
89
99void rts_receiver_init(struct rts_receiver *receiver,
100 struct rts_pulse_source *pulse_source,
101 struct rts_remote_store *remote_store);
102
115void rts_receiver_set_frame_callback(struct rts_receiver *receiver,
116 void (*callback)(enum rts_receiver_event,
117 struct rts_frame *frame,
118 void *user_data),
119 void *user_data);
120
131void rts_receiver_set_mode_callback(struct rts_receiver *receiver,
132 void (*callback)(enum rts_receiver_mode,
133 void *user_data),
134 void *user_data);
135
145void rts_receiver_set_mode(struct rts_receiver *receiver, uint8_t mode);
146
155void rts_receiver_forget_all_remotes(struct rts_receiver *receiver);
156
166void rts_receiver_update(struct rts_receiver *receiver);
167
172#ifdef __cplusplus
173} // extern "C"
174#endif
175
176#endif // RTS_RECEIVER_H
rts_receiver_mode
Receiver modes.
Definition rts_receiver.h:36
rts_receiver_event
De-duplicated "frame" events.
Definition rts_receiver.h:25
@ RTS_RECEIVER_MODE_COMMAND
The receiver is in command mode.
Definition rts_receiver.h:39
@ RTS_RECEIVER_MODE_PROGRAMMING
The receiver is in programming mode.
Definition rts_receiver.h:38
@ RTS_RECEIVER_MODE_OFF
The receiver is off, will not process events.
Definition rts_receiver.h:37
@ RTS_RECEIVER_EVENT_NONE
No event detected.
Definition rts_receiver.h:26
@ RTS_RECEIVER_EVENT_HOLD_3
"3x Hold" event detected, fired after 6s of repeats
Definition rts_receiver.h:30
@ RTS_RECEIVER_EVENT_PRESS
"Press" event detected, fired on first frame
Definition rts_receiver.h:27
@ RTS_RECEIVER_EVENT_HOLD
"Hold" event detected, fired after 2s of repeats
Definition rts_receiver.h:28
@ RTS_RECEIVER_EVENT_HOLD_2
"2x Hold" event detected, fired after 4s of repeats
Definition rts_receiver.h:29
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
Provides an interface for a source of RTS pulses, eg a GPIO or radio.
Definition rts_pulse_source.h:35
Simulates a physical RTS receiver device, such as a shade or drapery motor.
Definition rts_receiver.h:72
Provides an interface for a datastore which contains details about remote controls and rolling codes.
Definition rts_remote_store.h:29