LIRC libraries
Linux Infrared Remote Control
|
Library part of irrecord, functions to identify unknown remotes. More...
#include <time.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <limits.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
#include <syslog.h>
#include <unistd.h>
#include "lirc_private.h"
Go to the source code of this file.
Classes | |
struct | lengths |
struct | opts |
Parsed run-time options, reflects long_options and the command line, mostly a const object. More... | |
struct | main_state |
Overall state in main. More... | |
struct | gap_state |
Private state in get_gap_length(). More... | |
struct | lengths_state |
State in get_lengths(), private besides commented. More... | |
struct | toggle_state |
Private state in get_togggle_bit_mask(). More... | |
struct | button_state |
State while recording buttons, privates besides commented. More... | |
Macros | |
#define | min(a, b) |
#define | max(a, b) |
#define | BUTTON (80 + 1) |
#define | RETRIES 10 |
#define | MAX_SIGNALS 200 |
#define | TH_SPACE_ENC 80 /* I want less than 20% mismatches */ |
#define | TH_HEADER 90 |
#define | TH_REPEAT 90 |
#define | TH_TRAIL 90 |
#define | TH_LEAD 90 |
#define | TH_IS_BIT 10 |
#define | TH_RC6_SIGNAL 550 |
#define | MIN_GAP 20000 |
#define | MAX_GAP 100000 |
#define | SAMPLES 80 |
Typedefs | |
typedef void(* | remote_func) (struct ir_remote *remotes) |
Enumerations | |
enum | analyse_mode { MODE_GET_GAP , MODE_HAVE_GAP } |
enum | lengths_status { STS_LEN_OK , STS_LEN_FAIL , STS_LEN_RAW_OK , STS_LEN_TIMEOUT , STS_LEN_AGAIN , STS_LEN_AGAIN_INFO , STS_LEN_NO_GAP_FOUND , STS_LEN_TOO_LONG } |
Return from one attempt to determine lengths in get_lengths(). More... | |
enum | get_gap_status { STS_GAP_INIT , STS_GAP_TIMEOUT , STS_GAP_FOUND , STS_GAP_GOT_ONE_PRESS , STS_GAP_AGAIN } |
Return form one attempt to get gap in get_gap(). More... | |
enum | toggle_status { STS_TGL_TIMEOUT , STS_TGL_GOT_ONE_PRESS , STS_TGL_NOT_FOUND , STS_TGL_FOUND , STS_TGL_AGAIN } |
Return from one attempt in get_toggle_bit_mask(). More... | |
enum | button_status { STS_BTN_INIT , STS_BTN_GET_NAME , STS_BTN_INIT_DATA , STS_BTN_GET_RAW_DATA , STS_BTN_GET_DATA , STS_BTN_GET_TOGGLE_BITS , STS_BTN_RECORD_DONE , STS_BTN_BUTTON_DONE , STS_BTN_BUTTONS_DONE , STS_BTN_ALL_DONE , STS_BTN_SOFT_ERROR , STS_BTN_HARD_ERROR , STS_BTN_TIMEOUT } |
Return from one pass in record_buttons(). More... | |
Functions | |
ssize_t | raw_read (void *buffer, size_t size, unsigned int timeout_us) |
Absolute error tolerance (us). | |
void | for_each_remote (struct ir_remote *remotes, remote_func func) |
Unconditionally apply func(remote) for all items in remotes list. | |
void | btn_state_set_message (struct button_state *state, const char *fmt,...) |
sprintf-style message formatting into state->message. | |
void | flushhw (void) |
Clear the driver input buffers. | |
void | gap_state_init (struct gap_state *state) |
Initiate a pristine gap_state. | |
void | lengths_state_init (struct lengths_state *state) |
Initiate a pristine lengths_state. | |
void | toggle_state_init (struct toggle_state *state) |
Initiate a pristine toggle_state. | |
void | button_state_init (struct button_state *state, int started_as_root) |
Initiate a pristine button_state. | |
enum get_gap_status | get_gap_length (struct gap_state *state, struct ir_remote *remote) |
Try to find out gap length, returning gap_status. | |
enum lengths_status | get_lengths (struct lengths_state *state, struct ir_remote *remote, int force, int interactive) |
Try to find out pre/post etc. | |
void | free_all_lengths (void) |
Free heap data allocated by get_lengths(). | |
enum toggle_status | get_toggle_bit_mask (struct toggle_state *state, struct ir_remote *remote) |
Try to find out toggle_bit_mask, returning toggle_status. | |
int | do_analyse (const struct opts *opts, struct main_state *state) |
The –analyse wrapper, returns boolean ok/fail. | |
enum button_status | record_buttons (struct button_state *btn_state, enum button_status last_status, struct main_state *state, const struct opts *opts) |
Try to record one button, returning button_status. | |
void | config_file_setup (struct main_state *state, const struct opts *opts) |
Write the provisionary config file. | |
int | config_file_finish (struct main_state *state, const struct opts *opts) |
Write the final config file. | |
void | get_pre_data (struct ir_remote *remote) |
Test hook: Extract remote->pre_data from remote->bits. | |
void | get_post_data (struct ir_remote *remote) |
Test hook: Extract remote->post_data and post_data_bits from bits. | |
void | remove_pre_data (struct ir_remote *remote) |
Test hook: Move remote->pre_data into remote->bits. | |
void | remove_post_data (struct ir_remote *remote) |
Test hook: Move remote->post_data into remote->bits. | |
void | invert_data (struct ir_remote *remote) |
Test hook: Invert all data items in remote. | |
void | remove_trail (struct ir_remote *remote) |
Test hook: Move remote->trail into remote->bits. | |
Variables | |
struct ir_remote | remote |
unsigned int | eps |
Shared list of remotes. | |
lirc_t | aeps |
Error tolerance in per cent. | |
Library part of irrecord, functions to identify unknown remotes.
Definition in file irrecord.h.
#define BUTTON (80 + 1) |
Definition at line 57 of file irrecord.h.
#define max | ( | a, | |
b ) |
Definition at line 55 of file irrecord.h.
#define MAX_GAP 100000 |
Definition at line 73 of file irrecord.h.
#define MAX_SIGNALS 200 |
Definition at line 61 of file irrecord.h.
#define min | ( | a, | |
b ) |
Definition at line 54 of file irrecord.h.
#define MIN_GAP 20000 |
Definition at line 72 of file irrecord.h.
#define RETRIES 10 |
Definition at line 58 of file irrecord.h.
#define SAMPLES 80 |
Definition at line 75 of file irrecord.h.
#define TH_HEADER 90 |
Definition at line 65 of file irrecord.h.
#define TH_IS_BIT 10 |
Definition at line 69 of file irrecord.h.
#define TH_LEAD 90 |
Definition at line 68 of file irrecord.h.
#define TH_RC6_SIGNAL 550 |
Definition at line 70 of file irrecord.h.
#define TH_REPEAT 90 |
Definition at line 66 of file irrecord.h.
#define TH_SPACE_ENC 80 /* I want less than 20% mismatches */ |
Definition at line 64 of file irrecord.h.
#define TH_TRAIL 90 |
Definition at line 67 of file irrecord.h.
typedef void(* remote_func) (struct ir_remote *remotes) |
Definition at line 85 of file irrecord.h.
enum analyse_mode |
Definition at line 87 of file irrecord.h.
enum button_status |
Return from one pass in record_buttons().
Definition at line 124 of file irrecord.h.
enum get_gap_status |
Return form one attempt to get gap in get_gap().
Definition at line 104 of file irrecord.h.
enum lengths_status |
Return from one attempt to determine lengths in get_lengths().
Definition at line 91 of file irrecord.h.
enum toggle_status |
Return from one attempt in get_toggle_bit_mask().
Definition at line 114 of file irrecord.h.
void btn_state_set_message | ( | struct button_state * | state, |
const char * | fmt, | ||
... ) |
sprintf-style message formatting into state->message.
sprintf-style message formatting into state->message.
Definition at line 97 of file irrecord.c.
void button_state_init | ( | struct button_state * | state, |
int | started_as_root ) |
Initiate a pristine button_state.
Definition at line 219 of file irrecord.c.
int config_file_finish | ( | struct main_state * | state, |
const struct opts * | opts ) |
Write the final config file.
Definition at line 2106 of file irrecord.c.
void config_file_setup | ( | struct main_state * | state, |
const struct opts * | opts ) |
Write the provisionary config file.
Definition at line 2089 of file irrecord.c.
int do_analyse | ( | const struct opts * | opts, |
struct main_state * | state ) |
The –analyse wrapper, returns boolean ok/fail.
The –analyse wrapper, returns boolean ok/fail.
Definition at line 1776 of file irrecord.c.
void flushhw | ( | void | ) |
Clear the driver input buffers.
Definition at line 139 of file irrecord.c.
void for_each_remote | ( | struct ir_remote * | remotes, |
remote_func | func ) |
Unconditionally apply func(remote) for all items in remotes list.
Definition at line 491 of file irrecord.c.
void free_all_lengths | ( | void | ) |
Free heap data allocated by get_lengths().
Definition at line 664 of file irrecord.c.
void gap_state_init | ( | struct gap_state * | state | ) |
Initiate a pristine gap_state.
Definition at line 189 of file irrecord.c.
enum get_gap_status get_gap_length | ( | struct gap_state * | state, |
struct ir_remote * | remote ) |
Try to find out gap length, returning gap_status.
Definition at line 1207 of file irrecord.c.
enum lengths_status get_lengths | ( | struct lengths_state * | state, |
struct ir_remote * | remote, | ||
int | force, | ||
int | interactive ) |
Try to find out pre/post etc.
lengths, returning lengths_status.
Definition at line 1387 of file irrecord.c.
void get_post_data | ( | struct ir_remote * | remote | ) |
Test hook: Extract remote->post_data and post_data_bits from bits.
Definition at line 327 of file irrecord.c.
void get_pre_data | ( | struct ir_remote * | remote | ) |
Test hook: Extract remote->pre_data from remote->bits.
Definition at line 269 of file irrecord.c.
enum toggle_status get_toggle_bit_mask | ( | struct toggle_state * | state, |
struct ir_remote * | remote ) |
Try to find out toggle_bit_mask, returning toggle_status.
Definition at line 1545 of file irrecord.c.
void invert_data | ( | struct ir_remote * | remote | ) |
Test hook: Invert all data items in remote.
Definition at line 424 of file irrecord.c.
void lengths_state_init | ( | struct lengths_state * | state | ) |
Initiate a pristine lengths_state.
Definition at line 195 of file irrecord.c.
ssize_t raw_read | ( | void * | buffer, |
size_t | size, | ||
unsigned int | timeout_us ) |
Absolute error tolerance (us).
Try to read some bytes from the device, no decoding whatsoever.
Definition at line 1804 of file irrecord.c.
enum button_status record_buttons | ( | struct button_state * | btn_state, |
enum button_status | last_status, | ||
struct main_state * | state, | ||
const struct opts * | opts ) |
Try to record one button, returning button_status.
Definition at line 1835 of file irrecord.c.
void remove_post_data | ( | struct ir_remote * | remote | ) |
Test hook: Move remote->post_data into remote->bits.
Definition at line 403 of file irrecord.c.
void remove_pre_data | ( | struct ir_remote * | remote | ) |
Test hook: Move remote->pre_data into remote->bits.
Definition at line 383 of file irrecord.c.
void remove_trail | ( | struct ir_remote * | remote | ) |
Test hook: Move remote->trail into remote->bits.
Definition at line 463 of file irrecord.c.
void toggle_state_init | ( | struct toggle_state * | state | ) |
Initiate a pristine toggle_state.
Definition at line 211 of file irrecord.c.
|
extern |
Error tolerance in per cent.
Definition at line 63 of file irrecord.c.
|
extern |
Shared list of remotes.
Definition at line 62 of file irrecord.c.
|
extern |
Definition at line 61 of file irrecord.c.