overwrite_content=false
com_core_thread=true
use_xmonitor=false
+input=/dev/input/event1
overwrite_content=false
com_core_thread=true
use_xmonitor=false
+input=/dev/input/event1
char *reader;
char *always;
char *db;
+ char *input;
} path;
int max_size_type;
#define SLAVE_LOG_PATH g_conf.path.slave_log
#define READER_PATH g_conf.path.reader
#define ALWAYS_PATH g_conf.path.always
+#define INPUT_PATH g_conf.path.input
#define REPLACE_TAG_APPID g_conf.replace_tag
#define SLAVE_TTL g_conf.slave_ttl
.root = "/opt/usr/live/",
.script_port = "/usr/share/data-provider-master/plugin-script/",
.db = "/opt/dbspace/.livebox.db",
+ .input = "/dev/input/event1",
},
.ping_time = 240.0f,
DbgPrint("Shared folder: %s\n", g_conf.path.image);
}
+static void input_path_handler(char *buffer)
+{
+ g_conf.path.input = strdup(buffer);
+ if (!g_conf.path.input)
+ ErrPrint("Heap: %s\n", strerror(errno));
+ DbgPrint("Input device: %s\n", g_conf.path.input);
+}
+
static void ping_time_handler(char *buffer)
{
if (sscanf(buffer, "%lf", &g_conf.ping_time) != 1)
.handler = com_core_thread_handler,
},
{
+ .name = "input",
+ .handler = input_path_handler,
+ },
+ {
.name = NULL,
.handler = NULL,
},
return ECORE_CALLBACK_RENEW;
}
-static inline char *detect_input_device(void)
-{
- /*!
- * \NOTE
- * Implements this first.
- * We should detect the input device.
- */
- return strdup("/dev/input/event1");
-}
-
HAPI int event_activate(int x, int y, int (*event_cb)(enum event_state state, struct event_data *event, void *data), void *data)
{
int status;
- char *device_node;
if (s_info.handle >= 0) {
DbgPrint("Already activated\n");
return 0;
}
- device_node = detect_input_device();
- if (!device_node) {
- ErrPrint("Input device is not recognized\n");
- return -ENOTSUP;
- }
-
- s_info.handle = open(device_node, O_RDONLY);
- free(device_node);
+ s_info.handle = open(INPUT_PATH, O_RDONLY);
if (s_info.handle < 0) {
ErrPrint("Unable to access the device: %s\n", strerror(errno));
return -EIO;