Add a devinfo event for the Mares backends.
This commit is contained in:
parent
f33b298b3a
commit
067a6c630a
@ -29,6 +29,7 @@
|
||||
#include "serial.h"
|
||||
#include "utils.h"
|
||||
#include "checksum.h"
|
||||
#include "array.h"
|
||||
|
||||
#define EXITCODE(rc) \
|
||||
( \
|
||||
@ -274,6 +275,14 @@ mares_nemo_device_foreach (device_t *abstract, dive_callback_t callback, void *u
|
||||
return rc;
|
||||
}
|
||||
|
||||
// Emit a device info event.
|
||||
unsigned char *data = dc_buffer_get_data (buffer);
|
||||
device_devinfo_t devinfo;
|
||||
devinfo.model = 0;
|
||||
devinfo.firmware = 0;
|
||||
devinfo.serial = array_uint16_be (data + 8);
|
||||
device_event_emit (abstract, DEVICE_EVENT_DEVINFO, &devinfo);
|
||||
|
||||
rc = mares_nemo_extract_dives (abstract,
|
||||
dc_buffer_get_data (buffer), dc_buffer_get_size (buffer), callback, userdata);
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
#include "serial.h"
|
||||
#include "utils.h"
|
||||
#include "checksum.h"
|
||||
#include "array.h"
|
||||
|
||||
#define EXITCODE(rc) \
|
||||
( \
|
||||
@ -372,6 +373,14 @@ mares_puck_device_foreach (device_t *abstract, dive_callback_t callback, void *u
|
||||
return rc;
|
||||
}
|
||||
|
||||
// Emit a device info event.
|
||||
unsigned char *data = dc_buffer_get_data (buffer);
|
||||
device_devinfo_t devinfo;
|
||||
devinfo.model = 0;
|
||||
devinfo.firmware = 0;
|
||||
devinfo.serial = array_uint16_be (data + 8);
|
||||
device_event_emit (abstract, DEVICE_EVENT_DEVINFO, &devinfo);
|
||||
|
||||
rc = mares_puck_extract_dives (abstract,
|
||||
dc_buffer_get_data (buffer), dc_buffer_get_size (buffer), callback, userdata);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user