Don't ignore handshaking errors

This commit is contained in:
Jef Driesen 2017-04-29 12:21:54 +02:00
parent 6e9278ff24
commit 3daba977e0
2 changed files with 10 additions and 2 deletions

View File

@ -228,7 +228,11 @@ uwatec_meridian_device_open (dc_device_t **out, dc_context_t *context, const cha
dc_serial_purge (device->port, DC_DIRECTION_ALL);
// Perform the handshaking.
uwatec_meridian_handshake (device);
status = uwatec_meridian_handshake (device);
if (status != DC_STATUS_SUCCESS) {
ERROR (context, "Failed to handshake with the device.");
goto error_close;
}
*out = (dc_device_t*) device;

View File

@ -191,7 +191,11 @@ uwatec_smart_device_open (dc_device_t **out, dc_context_t *context)
}
// Perform the handshaking.
uwatec_smart_handshake (device);
status = uwatec_smart_handshake (device);
if (status != DC_STATUS_SUCCESS) {
ERROR (context, "Failed to handshake with the device.");
goto error_close;
}
*out = (dc_device_t*) device;