rtl433  UNKNOWN
RTL-433 utility
decoder_util.h
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DECODER_UTIL_H_
13 #define INCLUDE_DECODER_UTIL_H_
14 
15 #include <stdarg.h>
16 #include "bitbuffer.h"
17 #include "r_device.h"
18 
20 r_device *create_device(r_device *dev_template);
21 
23 void decoder_output_data(r_device *decoder, data_t *data);
24 
25 // be terse, a maximum msg length of 60 characters is supported on the decoder_output_ functions
26 // e.g. "FoobarCorp-XY3000: unexpected type code %02x"
27 
29 void decoder_output_message(r_device *decoder, char const *msg);
30 
32 void decoder_output_bitbuffer(r_device *decoder, bitbuffer_t const *bitbuffer, char const *msg);
33 
36 void decoder_output_bitbuffer_array(r_device *decoder, bitbuffer_t const *bitbuffer, char const *msg);
37 
39 void decoder_output_bitrow(r_device *decoder, bitrow_t const bitrow, unsigned bit_len, char const *msg);
40 
41 // print helpers
42 
44 void decoder_output_messagef(r_device *decoder, char const *restrict format, ...);
45 
47 void decoder_output_bitbufferf(r_device *decoder, bitbuffer_t const *bitbuffer, char const *restrict format, ...);
48 
50 void decoder_output_bitbuffer_arrayf(r_device *decoder, bitbuffer_t const *bitbuffer, char const *restrict format, ...);
51 
53 void decoder_output_bitrowf(r_device *decoder, bitrow_t const bitrow, unsigned bit_len, char const *restrict format, ...);
54 
56 void bitbuffer_printf(const bitbuffer_t *bitbuffer, char const *restrict format, ...);
57 
60 void bitbuffer_debugf(const bitbuffer_t *bitbuffer, char const *restrict format, ...);
61 
63 void bitrow_printf(bitrow_t const bitrow, unsigned bit_len, char const *restrict format, ...);
64 
67 void bitrow_debugf(bitrow_t const bitrow, unsigned bit_len, char const *restrict format, ...);
68 
69 #endif /* INCLUDE_DECODER_UTIL_H_ */
void decoder_output_bitrowf(r_device *decoder, bitrow_t const bitrow, unsigned bit_len, char const *restrict format,...)
Output a message with args and the content of a bit row (byte buffer).
Definition: decoder_util.c:99
void bitbuffer_debugf(const bitbuffer_t *bitbuffer, char const *restrict format,...)
Debug print the content of the bitbuffer.
Definition: decoder_util.c:40
void decoder_output_message(r_device *decoder, char const *msg)
Output a message.
Definition: decoder_util.c:116
void decoder_output_bitbuffer_array(r_device *decoder, bitbuffer_t const *bitbuffer, char const *msg)
Output a message and the content of a bitbuffer.
Definition: decoder_util.c:193
void decoder_output_data(r_device *decoder, data_t *data)
Output data.
Definition: decoder_util.c:111
void decoder_output_bitrow(r_device *decoder, bitrow_t const bitrow, unsigned bit_len, char const *msg)
Output a message and the content of a bit row (byte buffer).
Definition: decoder_util.c:233
void decoder_output_messagef(r_device *decoder, char const *restrict format,...)
Output a message with args.
Definition: decoder_util.c:69
A two-dimensional bit buffer consisting of bytes.
uint8_t bitrow_t[BITBUF_COLS]
Definition: bitbuffer.h:21
void bitrow_debugf(bitrow_t const bitrow, unsigned bit_len, char const *restrict format,...)
Debug print the content of a bit row (byte buffer).
Definition: decoder_util.c:58
Device protocol decoder struct.
Definition: r_device.h:41
Bit buffer.
Definition: bitbuffer.h:25
void decoder_output_bitbuffer_arrayf(r_device *decoder, bitbuffer_t const *bitbuffer, char const *restrict format,...)
Output a message with args and the content of a bitbuffer.
Definition: decoder_util.c:89
Definition of r_device struct.
void decoder_output_bitbufferf(r_device *decoder, bitbuffer_t const *bitbuffer, char const *restrict format,...)
Output a message with args and the content of a bitbuffer.
Definition: decoder_util.c:79
void bitrow_printf(bitrow_t const bitrow, unsigned bit_len, char const *restrict format,...)
Print the content of a bit row (byte buffer).
Definition: decoder_util.c:49
void decoder_output_bitbuffer(r_device *decoder, bitbuffer_t const *bitbuffer, char const *msg)
Output a message and the content of a bitbuffer.
Definition: decoder_util.c:147
void bitbuffer_printf(const bitbuffer_t *bitbuffer, char const *restrict format,...)
Print the content of the bitbuffer.
Definition: decoder_util.c:31
Definition: data.h:58
r_device * create_device(r_device *dev_template)
Create a new r_device, copy from dev_template if not NULL.
Definition: decoder_util.c:20