Report errors from the close function
This commit is contained in:
parent
0609a4c80a
commit
e2c020d4c7
@ -320,7 +320,10 @@ cressi_edy_device_close (dc_device_t *abstract)
|
||||
dc_status_t rc = DC_STATUS_SUCCESS;
|
||||
|
||||
// Send the quit command.
|
||||
cressi_edy_quit (device);
|
||||
rc = cressi_edy_quit (device);
|
||||
if (rc != DC_STATUS_SUCCESS) {
|
||||
dc_status_set_error(&status, rc);
|
||||
}
|
||||
|
||||
// Close the device.
|
||||
rc = dc_serial_close (device->port);
|
||||
|
||||
@ -217,7 +217,10 @@ diverite_nitekq_device_close (dc_device_t *abstract)
|
||||
dc_status_t rc = DC_STATUS_SUCCESS;
|
||||
|
||||
// Disconnect.
|
||||
diverite_nitekq_send (device, DISCONNECT);
|
||||
rc = diverite_nitekq_send (device, DISCONNECT);
|
||||
if (rc != DC_STATUS_SUCCESS) {
|
||||
dc_status_set_error(&status, rc);
|
||||
}
|
||||
|
||||
// Close the device.
|
||||
rc = dc_serial_close (device->port);
|
||||
|
||||
@ -714,7 +714,10 @@ oceanic_atom2_device_close (dc_device_t *abstract)
|
||||
dc_status_t rc = DC_STATUS_SUCCESS;
|
||||
|
||||
// Send the quit command.
|
||||
oceanic_atom2_quit (device);
|
||||
rc = oceanic_atom2_quit (device);
|
||||
if (rc != DC_STATUS_SUCCESS) {
|
||||
dc_status_set_error(&status, rc);
|
||||
}
|
||||
|
||||
// Close the device.
|
||||
rc = dc_serial_close (device->port);
|
||||
|
||||
@ -337,7 +337,10 @@ oceanic_veo250_device_close (dc_device_t *abstract)
|
||||
dc_status_t rc = DC_STATUS_SUCCESS;
|
||||
|
||||
// Switch the device back to surface mode.
|
||||
oceanic_veo250_quit (device);
|
||||
rc = oceanic_veo250_quit (device);
|
||||
if (rc != DC_STATUS_SUCCESS) {
|
||||
dc_status_set_error(&status, rc);
|
||||
}
|
||||
|
||||
// Close the device.
|
||||
rc = dc_serial_close (device->port);
|
||||
|
||||
@ -517,7 +517,10 @@ oceanic_vtpro_device_close (dc_device_t *abstract)
|
||||
dc_status_t rc = DC_STATUS_SUCCESS;
|
||||
|
||||
// Switch the device back to surface mode.
|
||||
oceanic_vtpro_quit (device);
|
||||
rc = oceanic_vtpro_quit (device);
|
||||
if (rc != DC_STATUS_SUCCESS) {
|
||||
dc_status_set_error(&status, rc);
|
||||
}
|
||||
|
||||
// Close the device.
|
||||
rc = dc_serial_close (device->port);
|
||||
|
||||
@ -152,9 +152,12 @@ reefnet_sensus_device_close (dc_device_t *abstract)
|
||||
|
||||
// Safely close the connection if the last handshake was
|
||||
// successful, but no data transfer was ever initiated.
|
||||
if (device->waiting)
|
||||
reefnet_sensus_cancel (device);
|
||||
|
||||
if (device->waiting) {
|
||||
rc = reefnet_sensus_cancel (device);
|
||||
if (rc != DC_STATUS_SUCCESS) {
|
||||
dc_status_set_error(&status, rc);
|
||||
}
|
||||
}
|
||||
|
||||
// Close the device.
|
||||
rc = dc_serial_close (device->port);
|
||||
|
||||
@ -115,14 +115,24 @@ error_free:
|
||||
static dc_status_t
|
||||
shearwater_petrel_device_close (dc_device_t *abstract)
|
||||
{
|
||||
dc_status_t status = DC_STATUS_SUCCESS;
|
||||
shearwater_common_device_t *device = (shearwater_common_device_t *) abstract;
|
||||
dc_status_t rc = DC_STATUS_SUCCESS;
|
||||
|
||||
// Shutdown the device.
|
||||
unsigned char request[] = {0x2E, 0x90, 0x20, 0x00};
|
||||
shearwater_common_transfer (device, request, sizeof (request), NULL, 0, NULL);
|
||||
rc = shearwater_common_transfer (device, request, sizeof (request), NULL, 0, NULL);
|
||||
if (rc != DC_STATUS_SUCCESS) {
|
||||
dc_status_set_error(&status, rc);
|
||||
}
|
||||
|
||||
// Close the device.
|
||||
return shearwater_common_close (device);
|
||||
rc = shearwater_common_close (device);
|
||||
if (rc != DC_STATUS_SUCCESS) {
|
||||
dc_status_set_error(&status, rc);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user