Add a device info event for the Reefnet Sensus Original, Pro and Ultra.

This commit is contained in:
Jef Driesen 2009-02-20 12:25:25 +00:00
parent 75d3792016
commit 64e3f4b4bf
3 changed files with 21 additions and 0 deletions

View File

@ -244,6 +244,13 @@ reefnet_sensus_device_handshake (device_t *abstract, unsigned char *data, unsign
memcpy (data, handshake + 2, REEFNET_SENSUS_HANDSHAKE_SIZE);
// Emit a device info event.
device_devinfo_t devinfo;
devinfo.model = handshake[2] - '0';
devinfo.firmware = handshake[3] - '0';
devinfo.serial = handshake[6] + (handshake[7] << 8);
device_event_emit (abstract, DEVICE_EVENT_DEVINFO, &devinfo);
// Wait at least 10 ms to ensures the data line is
// clear before transmission from the host begins.

View File

@ -215,6 +215,13 @@ reefnet_sensuspro_device_handshake (device_t *abstract, unsigned char *data, uns
memcpy (data, handshake, REEFNET_SENSUSPRO_HANDSHAKE_SIZE);
// Emit a device info event.
device_devinfo_t devinfo;
devinfo.model = handshake[0];
devinfo.firmware = handshake[1];
devinfo.serial = handshake[4] + (handshake[5] << 8);
device_event_emit (abstract, DEVICE_EVENT_DEVINFO, &devinfo);
serial_sleep (10);
return DEVICE_STATUS_SUCCESS;

View File

@ -329,6 +329,13 @@ reefnet_sensusultra_device_handshake (device_t *abstract, unsigned char *data, u
memcpy (data, handshake, REEFNET_SENSUSULTRA_HANDSHAKE_SIZE);
// Emit a device info event.
device_devinfo_t devinfo;
devinfo.model = handshake[1];
devinfo.firmware = handshake[0];
devinfo.serial = handshake[2] + (handshake[3] << 8);
device_event_emit (abstract, DEVICE_EVENT_DEVINFO, &devinfo);
return DEVICE_STATUS_SUCCESS;
}