diff --git a/src/suunto_common2.c b/src/suunto_common2.c index e0f0a07..6f9f270 100644 --- a/src/suunto_common2.c +++ b/src/suunto_common2.c @@ -136,8 +136,8 @@ suunto_common2_device_reset_maxdepth (device_t *abstract) } -static device_status_t -suunto_common2_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size, device_progress_t *progress) +device_status_t +suunto_common2_device_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size) { // The data transmission is split in packages // of maximum $SZ_PACKET bytes. @@ -163,12 +163,6 @@ suunto_common2_read (device_t *abstract, unsigned int address, unsigned char dat memcpy (data, answer + 6, len); - // Update and emit a progress event. - if (progress) { - progress->current += len; - device_event_emit (abstract, DEVICE_EVENT_PROGRESS, progress); - } - nbytes += len; address += len; data += len; @@ -178,13 +172,6 @@ suunto_common2_read (device_t *abstract, unsigned int address, unsigned char dat } -device_status_t -suunto_common2_device_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size) -{ - return suunto_common2_read (abstract, address, data, size, NULL); -} - - device_status_t suunto_common2_device_write (device_t *abstract, unsigned int address, const unsigned char data[], unsigned int size) { @@ -259,7 +246,7 @@ suunto_common2_device_foreach (device_t *abstract, dive_callback_t callback, voi // Read the serial number. unsigned char serial[SZ_MINIMUM > 4 ? SZ_MINIMUM : 4] = {0}; - rc = suunto_common2_read (abstract, 0x0023, serial, sizeof (serial), NULL); + rc = suunto_common2_device_read (abstract, 0x0023, serial, sizeof (serial)); if (rc != DEVICE_STATUS_SUCCESS) { WARNING ("Cannot read memory header."); return rc; @@ -278,7 +265,7 @@ suunto_common2_device_foreach (device_t *abstract, dive_callback_t callback, voi // Read the header bytes. unsigned char header[8] = {0}; - rc = suunto_common2_read (abstract, 0x0190, header, sizeof (header), NULL); + rc = suunto_common2_device_read (abstract, 0x0190, header, sizeof (header)); if (rc != DEVICE_STATUS_SUCCESS) { WARNING ("Cannot read memory header."); return rc; @@ -351,7 +338,7 @@ suunto_common2_device_foreach (device_t *abstract, dive_callback_t callback, voi // Read the package. unsigned char *p = data + SZ_MINIMUM + remaining - nbytes; - rc = suunto_common2_read (abstract, address - (len + extra), p - (len + extra), len + extra, NULL); + rc = suunto_common2_device_read (abstract, address - (len + extra), p - (len + extra), len + extra); if (rc != DEVICE_STATUS_SUCCESS) { WARNING ("Cannot read memory."); return rc; diff --git a/src/suunto_vyper.c b/src/suunto_vyper.c index 4bc9503..db0ccfb 100644 --- a/src/suunto_vyper.c +++ b/src/suunto_vyper.c @@ -276,7 +276,7 @@ suunto_vyper_transfer (suunto_vyper_device_t *device, const unsigned char comman static device_status_t -suunto_vyper_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size, device_progress_t *progress) +suunto_vyper_device_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size) { suunto_vyper_device_t *device = (suunto_vyper_device_t*) abstract; @@ -313,12 +313,6 @@ suunto_vyper_read (device_t *abstract, unsigned int address, unsigned char data[ message("\"\n"); #endif - // Update and emit a progress event. - if (progress) { - progress->current += len; - device_event_emit (abstract, DEVICE_EVENT_PROGRESS, progress); - } - nbytes += len; address += len; data += len; @@ -328,13 +322,6 @@ suunto_vyper_read (device_t *abstract, unsigned int address, unsigned char data[ } -static device_status_t -suunto_vyper_device_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size) -{ - return suunto_vyper_read (abstract, address, data, size, NULL); -} - - static device_status_t suunto_vyper_device_write (device_t *abstract, unsigned int address, const unsigned char data[], unsigned int size) { @@ -566,7 +553,7 @@ suunto_vyper_device_foreach (device_t *abstract, dive_callback_t callback, void // we read a larger block of memory that always contains the data // for both devices. unsigned char header[HDR_DEVINFO_END - HDR_DEVINFO_BEGIN] = {0}; - device_status_t rc = suunto_vyper_read (abstract, HDR_DEVINFO_BEGIN, header, sizeof (header), NULL); + device_status_t rc = suunto_vyper_device_read (abstract, HDR_DEVINFO_BEGIN, header, sizeof (header)); if (rc != DEVICE_STATUS_SUCCESS) return rc;