rtl433  UNKNOWN
RTL-433 utility
r_device.h
Go to the documentation of this file.
1 
5 #ifndef INCLUDE_R_DEVICE_H_
6 #define INCLUDE_R_DEVICE_H_
7 
22 };
23 
29 
35 };
36 
37 struct bitbuffer;
38 struct data;
39 
41 typedef struct r_device {
42  unsigned protocol_num;
43 
44  /* information provided by each decoder */
45  char *name;
46  unsigned modulation;
47  float short_width;
48  float long_width;
49  float reset_limit;
50  float gap_limit;
51  float sync_width;
52  float tolerance;
53  int (*decode_fn)(struct r_device *decoder, struct bitbuffer *bitbuffer);
54  struct r_device *(*create_fn)(char *args);
55  unsigned disabled;
56  char **fields;
57 
58  /* public for each decoder */
60  int verbose;
62  void (*output_fn)(struct r_device *decoder, struct data *data);
63 
64  /* Decoder results / statistics */
65  unsigned decode_events;
66  unsigned decode_ok;
67  unsigned decode_messages;
68  unsigned decode_fails[5];
69 
70  /* private for flex decoder and output callback */
71  void *decode_ctx;
72  void *output_ctx;
73 
74  /* private pulse limits (converted to count of samples) */
75  float f_short_width;
76  float f_long_width;
83 } r_device;
84 
85 #endif /* INCLUDE_R_DEVICE_H_ */
unsigned decode_messages
Definition: r_device.h:67
Pulse Position Modulation. Short gap = 0, Long = 1.
Definition: r_device.h:12
int(* decode_fn)(struct r_device *decoder, struct bitbuffer *bitbuffer)
Definition: r_device.h:53
legacy, do not use
Definition: r_device.h:28
modulation_types
Supported modulation types.
Definition: r_device.h:9
int s_gap_limit
Definition: r_device.h:80
FSK, Pulse Width Modulation. Short pulses = 1, Long = 0.
Definition: r_device.h:20
decode_return_codes
Decoders should return n>0 for n packets successfully decoded, an ABORT code if the bitbuffer is no a...
Definition: r_device.h:27
int s_sync_width
Definition: r_device.h:81
Level shift within the clock cycle.
Definition: r_device.h:16
float reset_limit
Definition: r_device.h:49
Pulse Code Modulation with Return-to-Zero encoding, Pulse = 0, No pulse = 1.
Definition: r_device.h:11
Manchester encoding. Hardcoded zerobit. Rising Edge = 0, Falling edge = 1.
Definition: r_device.h:10
float short_width
Definition: r_device.h:47
Bitbuffer row count or row length is wrong for this sensor.
Definition: r_device.h:30
Pulse Width Modulation with precise timing parameters.
Definition: r_device.h:13
char ** fields
List of fields this decoder produces; required for CSV output. NULL-terminated.
Definition: r_device.h:56
Level shift for each bit. Short interval = 1, Long = 0.
Definition: r_device.h:14
Definition: r_device.h:31
FSK, Pulse Code Modulation.
Definition: r_device.h:19
int s_reset_limit
Definition: r_device.h:79
float long_width
Definition: r_device.h:48
Dummy. FSK demodulation must start at this value.
Definition: r_device.h:18
unsigned disabled
Definition: r_device.h:55
Definition: r_device.h:34
Device protocol decoder struct.
Definition: r_device.h:41
float tolerance
Definition: r_device.h:52
void * decode_ctx
Definition: r_device.h:71
float gap_limit
Definition: r_device.h:50
unsigned decode_ok
Definition: r_device.h:66
Bit buffer.
Definition: bitbuffer.h:25
float f_short_width
precision reciprocal for PCM.
Definition: r_device.h:75
Level shift for each bit. Short interval = 1, Long = 0.
Definition: r_device.h:15
unsigned protocol_num
fixed sequence number, assigned in main().
Definition: r_device.h:42
int s_short_width
Definition: r_device.h:77
int verbose_bits
Definition: r_device.h:61
int s_long_width
Definition: r_device.h:78
unsigned modulation
Definition: r_device.h:46
FSK, Manchester encoding.
Definition: r_device.h:21
struct r_device r_device
Device protocol decoder struct.
float sync_width
Definition: r_device.h:51
Pulse Width Modulation. Oregon Scientific v1.
Definition: r_device.h:17
Message Integrity Check failed: e.g.
Definition: r_device.h:33
float f_long_width
precision reciprocal for PCM.
Definition: r_device.h:76
int new_model_keys
TODO: temporary allow to change to new style model keys.
Definition: r_device.h:59
unsigned decode_fails[5]
Definition: r_device.h:68
char * name
Definition: r_device.h:45
unsigned decode_events
Definition: r_device.h:65
void(* output_fn)(struct r_device *decoder, struct data *data)
Definition: r_device.h:62
int s_tolerance
Definition: r_device.h:82
Definition: data.h:58
void * output_ctx
Definition: r_device.h:72
int verbose
Definition: r_device.h:60