LIRC libraries Linux Infrared Remote Control

Loading...
Searching...
No Matches
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
rec_buffer_set_logfile
void rec_buffer_set_logfile(FILE *f)
Set a file logging input from driver in same format as mode2(1).
Definition receive.c:200
waitfordata
int waitfordata(uint32_t maxusec)
If set_waitfordata(func) is called, invoke and return function set this way.
Definition receive.c:171
set_waitfordata_func
void set_waitfordata_func(int(*func)(uint32_t maxusec))
Set the function used by waitfordata().
Definition receive.c:165
rec_buffer_rewind
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:218
MIN_RECEIVE_TIMEOUT
#define MIN_RECEIVE_TIMEOUT
Min value returned by receive_timeout.
Definition receive.h:35
rec_buffer_reset_wptr
void rec_buffer_reset_wptr(void)
Reset internal fifo's write pointer.
Definition receive.c:228
rec_set_update_mode
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:65
rec_buffer_init
void rec_buffer_init(void)
Clear internal buffer to pristine state.
Definition receive.c:213
receive_decode
int receive_decode(struct ir_remote *remote, struct decode_ctx_t *ctx)
Decode data from remote.
Definition receive.c:1038
rec_buffer_clear
int rec_buffer_clear(void)
Flush the internal fifo and store a single code read from the driver in it.
Definition receive.c:233
ir_remote.h
Describes and decodes the signals from IR remotes.
decode_ctx_t
State describing code, pre, post + gap and repeat state.
Definition ir_remote_types.h:137
ir_remote
One remote as represented in the configuration file.
Definition ir_remote_types.h:150