Implemented progress notifications for the Reefnet Sensus Pro.
This commit is contained in:
parent
dd847c5cf6
commit
b3c1de2336
@ -194,6 +194,10 @@ reefnet_sensuspro_device_dump (device_t *abstract, unsigned char *data, unsigned
|
||||
if (! device_is_reefnet_sensuspro (abstract))
|
||||
return DEVICE_STATUS_TYPE_MISMATCH;
|
||||
|
||||
// Enable progress notifications.
|
||||
device_progress_state_t progress;
|
||||
progress_init (&progress, abstract, REEFNET_SENSUSPRO_MEMORY_SIZE + 2);
|
||||
|
||||
unsigned char command = 0xB4;
|
||||
int rc = serial_write (device->port, &command, 1);
|
||||
if (rc != 1) {
|
||||
@ -214,6 +218,8 @@ reefnet_sensuspro_device_dump (device_t *abstract, unsigned char *data, unsigned
|
||||
return EXITCODE (rc);
|
||||
}
|
||||
|
||||
progress_event (&progress, DEVICE_EVENT_PROGRESS, len);
|
||||
|
||||
nbytes += len;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user