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 <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2019-05-16 14:42:22 -07:00
parent 92cf2f8fa1
commit 1194585595

View File

@ -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));
}