From 8a3fd3b13680690c61741ac297854226ec2fdfb4 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Mon, 2 Apr 2018 22:15:49 +0200 Subject: [PATCH 1/2] Add udev rules for some dive computers --- contrib/udev/libdivecomputer.rules | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 contrib/udev/libdivecomputer.rules diff --git a/contrib/udev/libdivecomputer.rules b/contrib/udev/libdivecomputer.rules new file mode 100644 index 0000000..08c234e --- /dev/null +++ b/contrib/udev/libdivecomputer.rules @@ -0,0 +1,17 @@ +# Atomic Aquatics Cobalt +SUBSYSTEM=="usb", ATTR{idVendor}=="0471", ATTR{idProduct}=="0888", GROUP="plugdev" + +# Suunto EON Steel +SUBSYSTEM=="usb", ATTR{idVendor}=="1493", ATTR{idProduct}=="0030", GROUP="plugdev" + +# Suunto EON Core +SUBSYSTEM=="usb", ATTR{idVendor}=="1493", ATTR{idProduct}=="0033", GROUP="plugdev" + +# Scubapro G2 +SUBSYSTEM=="usb", ATTR{idVendor}=="2e6c", ATTR{idProduct}=="3201", GROUP="plugdev" + +# Scubapro G2 Console +SUBSYSTEM=="usb", ATTR{idVendor}=="2e6c", ATTR{idProduct}=="3211", GROUP="plugdev" + +# Scubapro Aladin Square +SUBSYSTEM=="usb", ATTR{idVendor}=="c251", ATTR{idProduct}=="2006", GROUP="plugdev" From 26f4cae47c3cdea1b8c70434d261683bee2fb63c Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Thu, 19 Apr 2018 09:45:08 +0200 Subject: [PATCH 2/2] 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. --- src/hw_ostc3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hw_ostc3.c b/src/hw_ostc3.c index d018e07..1bdac9c 100644 --- a/src/hw_ostc3.c +++ b/src/hw_ostc3.c @@ -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; }