diff --git a/src/cressi_edy.c b/src/cressi_edy.c index 0de977a..d5c5482 100644 --- a/src/cressi_edy.c +++ b/src/cressi_edy.c @@ -83,6 +83,9 @@ cressi_edy_transfer (cressi_edy_device_t *device, const unsigned char command[], assert (asize >= csize); + if (device_is_cancelled (abstract)) + return DC_STATUS_CANCELLED; + // Flush the serial input buffer. int rc = serial_flush (device->port, SERIAL_QUEUE_INPUT); if (rc == -1) { diff --git a/src/hw_frog.c b/src/hw_frog.c index bda09b7..ec760ac 100644 --- a/src/hw_frog.c +++ b/src/hw_frog.c @@ -111,6 +111,9 @@ hw_frog_transfer (hw_frog_device_t *device, { dc_device_t *abstract = (dc_device_t *) device; + if (device_is_cancelled (abstract)) + return DC_STATUS_CANCELLED; + // Send the command. unsigned char command[1] = {cmd}; int n = serial_write (device->port, command, sizeof (command)); diff --git a/src/hw_ostc3.c b/src/hw_ostc3.c index f0067f4..1bcc73f 100644 --- a/src/hw_ostc3.c +++ b/src/hw_ostc3.c @@ -108,6 +108,9 @@ hw_ostc3_transfer (hw_ostc3_device_t *device, { dc_device_t *abstract = (dc_device_t *) device; + if (device_is_cancelled (abstract)) + return DC_STATUS_CANCELLED; + // Send the command. unsigned char command[1] = {cmd}; int n = serial_write (device->port, command, sizeof (command)); diff --git a/src/mares_iconhd.c b/src/mares_iconhd.c index 6a00e0d..0189d32 100644 --- a/src/mares_iconhd.c +++ b/src/mares_iconhd.c @@ -122,6 +122,9 @@ mares_iconhd_transfer (mares_iconhd_device_t *device, assert (csize >= 2); + if (device_is_cancelled (abstract)) + return DC_STATUS_CANCELLED; + // Send the command header to the dive computer. int n = serial_write (device->port, command, 2); if (n != 2) { diff --git a/src/shearwater_common.c b/src/shearwater_common.c index 8e4f493..e712312 100644 --- a/src/shearwater_common.c +++ b/src/shearwater_common.c @@ -266,6 +266,9 @@ shearwater_common_transfer (shearwater_common_device_t *device, const unsigned c if (isize > SZ_PACKET || osize > SZ_PACKET) return DC_STATUS_INVALIDARGS; + if (device_is_cancelled (abstract)) + return DC_STATUS_CANCELLED; + // Setup the request packet. packet[0] = 0xFF; packet[1] = 0x01; diff --git a/src/zeagle_n2ition3.c b/src/zeagle_n2ition3.c index 4d6db49..1e19d49 100644 --- a/src/zeagle_n2ition3.c +++ b/src/zeagle_n2ition3.c @@ -79,6 +79,9 @@ zeagle_n2ition3_packet (zeagle_n2ition3_device_t *device, const unsigned char co assert (asize >= csize + 5); + if (device_is_cancelled (abstract)) + return DC_STATUS_CANCELLED; + // Send the command to the device. int n = serial_write (device->port, command, csize); if (n != csize) {