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
25extern "C" {
26#endif
27
35#define MIN_RECEIVE_TIMEOUT 100000
36
41void rec_set_update_mode(int mode);
42
47void rec_buffer_set_logfile(FILE* f);
48
50static inline lirc_t receive_timeout(lirc_t usec)
51{
52 return 2 * usec < MIN_RECEIVE_TIMEOUT ? MIN_RECEIVE_TIMEOUT : 2 * usec;
53}
54
66int waitfordata(uint32_t maxusec);
67
69void set_waitfordata_func(int (*func)(uint32_t maxusec));
70
71
73void rec_buffer_init(void);
74
79int rec_buffer_clear(void);
80
87int receive_decode(struct ir_remote* remote, struct decode_ctx_t* ctx);
88
93void rec_buffer_rewind(void);
94
96void rec_buffer_reset_wptr(void);
97
98
100#ifdef __cplusplus
101}
102#endif
103
104#endif
void rec_buffer_set_logfile(FILE *f)
Set a file logging input from driver in same format as mode2(1).
Definition receive.c:204
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
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
#define MIN_RECEIVE_TIMEOUT
Min value returned by receive_timeout.
Definition receive.h:35
void rec_buffer_reset_wptr(void)
Reset internal fifo's write pointer.
Definition receive.c:232
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
void rec_buffer_init(void)
Clear internal buffer to pristine state.
Definition receive.c:217
int receive_decode(struct ir_remote *remote, struct decode_ctx_t *ctx)
Decode data from remote.
Definition receive.c:1054
int rec_buffer_clear(void)
Flush the internal fifo and store a single code read from the driver in it.
Definition receive.c:237
Describes and decodes the signals from IR remotes.
State describing code, pre, post + gap and repeat state.
One remote as represented in the configuration file.