Added basic support for the new device info event.

This commit is contained in:
Jef Driesen 2009-02-20 12:24:35 +00:00
parent f38ecdcb3f
commit 2be97f0e12
2 changed files with 11 additions and 1 deletions

View File

@ -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;
}

View File

@ -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);