LIRC libraries LinuxInfraredRemoteControl

- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Examples

- File List
- Globals

driver.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** driver.h **************************************************************
3 ****************************************************************************
4 *
5 * Copyright (C) 1999 Christoph Bartelmus <lirc@bartelmus.de>
6 *
7 */
8
20 #ifndef _HARDWARE_H
21 #define _HARDWARE_H
22
23 #include "include/media/lirc.h"
24 #include "lirc/ir_remote_types.h"
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
31 #define DRV_ERR_NOT_IMPLEMENTED 1
32
34 int default_open(const char* path);
35
37 int default_close(void);
38
40 int default_drvctl(unsigned int cmd, void* arg);
41
43 struct option_t {
44 char key[32];
45 char value[64];
46 };
47
52 int drv_handle_options(const char* options);
53
54
56 #define DRVCTL_GET_STATE 1
57
59 #define DRVCTL_SEND_SPACE 2
60
62 #define DRVCTL_SET_OPTION 3
63
65 #define DRVCTL_MAX 128
66
68 #define DRV_ERR_NOT_IMPLEMENTED 1
69
71 #define DRV_ERR_BAD_STATE 2
72
74 #define DRV_ERR_BAD_OPTION 3
75
77 #define DRV_ERR_BAD_VALUE 4
78
83 struct driver {
84 // Old-style implicit API version 1:
85
90 const char* device;
91
93 int fd;
94
96 __u32 features;
97
102 __u32 send_mode;
103
108 __u32 rec_mode;
109
111 const __u32 code_length;
112
119 int (*const open_func) (const char* device);
120
125 int (*const init_func)(void);
126
131 int (*const deinit_func) (void);
132
139 int (*const send_func)(struct ir_remote* remote,
140 struct ir_ncode* code);
141
148 char* (*const rec_func)(struct ir_remote* remotes);
149
153 int (*const decode_func)(struct ir_remote* remote,
154 struct decode_ctx_t* ctx);
155
160 int (*const drvctl_func)(unsigned int cmd, void* arg);
161
169 lirc_t (*const readdata)(lirc_t timeout);
170
175 const char* name;
176
181 unsigned int resolution;
182
183 /* API version 2 addons: */
184
185 const int api_version;
186 const char* driver_version;
187 const char* info;
189 int (*const close_func)(void);
190 };
191
194 #ifdef IN_DRIVER
195
196 extern struct driver drv;
197 #endif
198
200 extern const struct driver* curr_driver;
201
202 #ifdef __cplusplus
203 }
204 #endif
205
206 #endif
driver::features
__u32 features
Definition: driver.h:96
ir_remote
Definition: ir_remote_types.h:163
option_t
Definition: driver.h:43
default_close
int default_close(void)
Definition: driver.c:43
driver::fd
int fd
Definition: driver.h:93
driver::info
const char * info
Definition: driver.h:187
driver::decode_func
int(*const decode_func)(struct ir_remote *remote, struct decode_ctx_t *ctx)
Definition: driver.h:153
driver::resolution
unsigned int resolution
Definition: driver.h:181
driver::send_func
int(*const send_func)(struct ir_remote *remote, struct ir_ncode *code)
Definition: driver.h:139
driver::code_length
const __u32 code_length
Definition: driver.h:111
drv
struct driver drv
Definition: driver.c:20
driver::driver_version
const char * driver_version
Definition: driver.h:186
driver::api_version
const int api_version
Definition: driver.h:185
driver::rec_func
char *(*const rec_func)(struct ir_remote *remotes)
Definition: driver.h:148
driver::readdata
lirc_t(*const readdata)(lirc_t timeout)
Definition: driver.h:169
driver::deinit_func
int(*const deinit_func)(void)
Definition: driver.h:131
driver::close_func
int(*const close_func)(void)
Definition: driver.h:189
driver::open_func
int(*const open_func)(const char *device)
Definition: driver.h:119
default_drvctl
int default_drvctl(unsigned int cmd, void *arg)
Definition: driver.c:48
driver
Definition: driver.h:83
ir_ncode
Definition: ir_remote_types.h:72
decode_ctx_t
Definition: ir_remote_types.h:150
drv_handle_options
int drv_handle_options(const char *options)
Definition: driver.c:54
driver::drvctl_func
int(*const drvctl_func)(unsigned int cmd, void *arg)
Definition: driver.h:160
driver::name
const char * name
Definition: driver.h:175
driver::send_mode
__u32 send_mode
Definition: driver.h:102
default_open
int default_open(const char *path)
Definition: driver.c:28
driver::init_func
int(*const init_func)(void)
Definition: driver.h:125
ir_ncode::code
ir_code code
Definition: ir_remote_types.h:77
driver::rec_mode
__u32 rec_mode
Definition: driver.h:108
curr_driver
const struct driver * curr_driver
Definition: driver.c:26
driver::device
const char * device
Definition: driver.h:90