Improve the handling of unreadable dives

Dives that are reported by the dive computer as unreadable (for example
due to a power loss during the dive) are now skipped instead of being
reported as a fatal error. Those dives can't be retrieved, so there is
no good reason to abort the download.
This commit is contained in:
Jef Driesen 2017-06-03 10:07:14 +02:00
parent 3b967f9eb1
commit 24621ed519

View File

@ -471,8 +471,14 @@ divesystem_idive_device_foreach (dc_device_t *abstract, dc_dive_callback_t callb
(number ) & 0xFF,
(number >> 8) & 0xFF};
rc = divesystem_idive_transfer (device, cmd_header, sizeof(cmd_header), packet, commands->header.size, &errcode);
if (rc != DC_STATUS_SUCCESS)
return rc;
if (rc != DC_STATUS_SUCCESS) {
if (errcode == ERR_UNREADABLE) {
WARNING(abstract->context, "Skipped unreadable dive!");
continue;
} else {
return rc;
}
}
if (memcmp(packet + 7, device->fingerprint, sizeof(device->fingerprint)) == 0)
break;