Loading...
Searching...
No Matches
receive.h
Go to the documentation of this file.
/****************************************************************************
** receive.h ***************************************************************
****************************************************************************
*
* functions that decode IR codes
*
* Copyright (C) 1999 Christoph Bartelmus <lirc@bartelmus.de>
*
*/
#ifndef _RECEIVE_H
#define _RECEIVE_H
#include <stdint.h>
#include "ir_remote.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MIN_RECEIVE_TIMEOUT 100000
void rec_set_update_mode(int mode);
void rec_buffer_set_logfile(FILE* f);
static inline lirc_t receive_timeout(lirc_t usec)
{
return 2 * usec < MIN_RECEIVE_TIMEOUT ? MIN_RECEIVE_TIMEOUT : 2 * usec;
}
int waitfordata(uint32_t maxusec);
void set_waitfordata_func(int (*func)(uint32_t maxusec));
void rec_buffer_init(void);
int rec_buffer_clear(void);
int receive_decode(struct ir_remote* remote, struct decode_ctx_t* ctx);
void rec_buffer_rewind(void);
void rec_buffer_reset_wptr(void);
#ifdef __cplusplus
}
#endif
#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