From 1194585595f7a26f3ec7f96b5ad6e8f689a70258 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 16 May 2019 14:42:22 -0700 Subject: [PATCH] Add support for Suunto D5 dive computer It looks just like a small-form-factor EON Steel/Core, just with new device IDs. I haven't been able to pair over BLE yet, but that may be the usual "Suunto wants to do a private bonded pairing" thing that makes it a pain on the desktop. Signed-off-by: Linus Torvalds --- src/descriptor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/descriptor.c b/src/descriptor.c index e5e7253..48ef9b3 100644 --- a/src/descriptor.c +++ b/src/descriptor.c @@ -103,6 +103,7 @@ static const dc_descriptor_t g_descriptors[] = { /* Suunto EON Steel */ {"Suunto", "EON Steel", DC_FAMILY_SUUNTO_EONSTEEL, 0, DC_TRANSPORT_USBHID | DC_TRANSPORT_BLE, dc_filter_suunto}, {"Suunto", "EON Core", DC_FAMILY_SUUNTO_EONSTEEL, 1, DC_TRANSPORT_USBHID | DC_TRANSPORT_BLE, dc_filter_suunto}, + {"Suunto", "D5", DC_FAMILY_SUUNTO_EONSTEEL, 2, DC_TRANSPORT_USBHID | DC_TRANSPORT_BLE, dc_filter_suunto}, /* Uwatec Aladin */ {"Uwatec", "Aladin Air Twin", DC_FAMILY_UWATEC_ALADIN, 0x1C, DC_TRANSPORT_SERIAL, NULL}, {"Uwatec", "Aladin Sport Plus", DC_FAMILY_UWATEC_ALADIN, 0x3E, DC_TRANSPORT_SERIAL, NULL}, @@ -448,15 +449,19 @@ static int dc_filter_suunto (dc_transport_t transport, const void *userdata) static const dc_usb_desc_t usbhid[] = { {0x1493, 0x0030}, // Eon Steel {0x1493, 0x0033}, // Eon Core + {0x1493, 0x0035}, // Suunto D5 }; static const char *bluetooth[] = { "EON Steel", "EON Core", + "Suunto D5", }; if (transport == DC_TRANSPORT_USBHID) { return dc_filter_internal_usb ((const dc_usb_desc_t *) userdata, usbhid, C_ARRAY_SIZE(usbhid)); } else if (transport == DC_TRANSPORT_BLE) { + // This won't work for the D5 - the serial number is in the name, + // and that's not how dc_filter_internal_name() works return dc_filter_internal_name ((const char *) userdata, bluetooth, C_ARRAY_SIZE(bluetooth)); }