From 2be97f0e1234a7d8f674bf0950cfd880d7d17a87 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 20 Feb 2009 12:24:35 +0000 Subject: [PATCH] Added basic support for the new device info event. --- src/device.c | 3 +++ src/device.h | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index 5e15b48..80dbde9 100644 --- a/src/device.c +++ b/src/device.c @@ -166,6 +166,9 @@ device_event_emit (device_t *device, device_event_t event, const void *data) assert (progress->maximum != 0); assert (progress->maximum >= progress->current); break; + case DEVICE_EVENT_DEVINFO: + assert (data != NULL); + break; default: break; } diff --git a/src/device.h b/src/device.h index 3c87a40..72566a3 100644 --- a/src/device.h +++ b/src/device.h @@ -58,7 +58,8 @@ typedef enum device_status_t { typedef enum device_event_t { DEVICE_EVENT_WAITING = (1 << 0), - DEVICE_EVENT_PROGRESS = (1 << 1) + DEVICE_EVENT_PROGRESS = (1 << 1), + DEVICE_EVENT_DEVINFO = (1 << 2) } device_event_t; typedef struct device_t device_t; @@ -68,6 +69,12 @@ typedef struct device_progress_t { unsigned int maximum; } device_progress_t; +typedef struct device_devinfo_t { + unsigned int model; + unsigned int firmware; + unsigned int serial; +} device_devinfo_t; + typedef void (*device_event_callback_t) (device_t *device, device_event_t event, const void *data, void *userdata); typedef int (*dive_callback_t) (const unsigned char *data, unsigned int size, void *userdata);