Fix a critical mistake in the OSTC3 code

Instead of reading data packets, the code is actually sending some
random data to the dive computer! A small typo with bad consequences!

This is a critical bug because it not only causes the download to fail,
but also appears to change random settings on the dive computer. I
suspect that the garbage data that gets send to the dive computer
happens to contain some valid write settings commands.
This commit is contained in:
Jef Driesen 2018-04-19 09:45:08 +02:00
parent 8a3fd3b136
commit 26f4cae47c

View File

@ -212,7 +212,7 @@ hw_ostc3_read (hw_ostc3_device_t *device, dc_event_progress_t *progress, unsigne
device->offset += length;
} else {
// Read the packet.
rc = dc_iostream_write (device->iostream, data + nbytes, length, NULL);
rc = dc_iostream_read (device->iostream, data + nbytes, length, NULL);
if (rc != DC_STATUS_SUCCESS)
return rc;
}