1
0
forked from drath/libratbag

hidpp: add hidpp_device_init()

Make this into a somewhat more sensible API and default to printf as log
handler.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2015-10-15 12:53:04 +10:00
parent 9e4bafba8f
commit 8a3222204e
4 changed files with 20 additions and 1 deletions

View File

@@ -290,3 +290,17 @@ hidpp_log_buffer(struct hidpp_device *dev,
hidpp_log(dev, priority, "%s\n", output_buf);
}
static void
simple_log(void *userdata, enum hidpp_log_priority priority, const char *format, va_list args)
{
vprintf(format, args);
}
void
hidpp_device_init(struct hidpp_device *dev, int fd)
{
dev->hidraw_fd = fd;
dev->log_handler = simple_log;
dev->userdata = NULL;
}