LIRC libraries
LinuxInfraredRemoteControl
 All Classes Files Functions Variables Typedefs Enumerations Macros Modules Pages
receive.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** receive.h ***************************************************************
3 ****************************************************************************
4 *
5 * functions that decode IR codes
6 *
7 * Copyright (C) 1999 Christoph Bartelmus <lirc@bartelmus.de>
8 *
9 */
10 
18 #ifndef _RECEIVE_H
19 #define _RECEIVE_H
20 
21 #include <stdint.h>
22 #include "ir_remote.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
35 #define MIN_RECEIVE_TIMEOUT 100000
36 
41 void rec_set_update_mode(int mode);
42 
47 void rec_buffer_set_logfile(FILE* f);
48 
50 static inline lirc_t receive_timeout(lirc_t usec)
51 {
52  return 2 * usec < MIN_RECEIVE_TIMEOUT ? MIN_RECEIVE_TIMEOUT : 2 * usec;
53 }
54 
66 int waitfordata(uint32_t maxusec);
67 
69 void set_waitfordata_func(int (*func)(uint32_t maxusec));
70 
71 
73 void rec_buffer_init(void);
74 
79 int rec_buffer_clear(void);
80 
87 int receive_decode(struct ir_remote* remote, struct decode_ctx_t* ctx);
88 
93 void rec_buffer_rewind(void);
94 
96 void rec_buffer_reset_wptr(void);
97 
98 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif
void rec_buffer_init(void)
Clear internal buffer to pristine state.
Definition: receive.c:217
void rec_buffer_set_logfile(FILE *f)
Set a file logging input from driver in same format as mode2(1).
Definition: receive.c:204
One remote as represented in the configuration file.
void rec_buffer_rewind(void)
Reset the modules's internal fifo's read state to initial values where the nothing is read...
Definition: receive.c:222
int receive_decode(struct ir_remote *remote, struct decode_ctx_t *ctx)
Decode data from remote.
Definition: receive.c:1054
void rec_buffer_reset_wptr(void)
Reset internal fifo's write pointer.
Definition: receive.c:232
int waitfordata(uint32_t maxusec)
If set_waitfordata(func) is called, invoke and return function set this way.
Definition: receive.c:175
void set_waitfordata_func(int(*func)(uint32_t maxusec))
Set the function used by waitfordata().
Definition: receive.c:169
Describes and decodes the signals from IR remotes.
State describing code, pre, post + gap and repeat state.
void rec_set_update_mode(int mode)
Set update mode, where recorded pre_data is verified to match the template pre_data.
Definition: receive.c:69
#define MIN_RECEIVE_TIMEOUT
Min value returned by receive_timeout.
Definition: receive.h:35
int rec_buffer_clear(void)
Flush the internal fifo and store a single code read from the driver in it.
Definition: receive.c:237