From eb1284683a7134b84d8b77213bbfab1e048bbd30 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 14 Jun 2022 11:15:53 -0700 Subject: [PATCH] core: add new Shearwater dive computer names The code works ok falling back to just Perdix and Petrel 2, but it looks confusing to the user to see an incorrect name in the connection drop down. Signed-off-by: Dirk Hohndel --- core/btdiscovery.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp index 587fe59ab..c420ef96c 100644 --- a/core/btdiscovery.cpp +++ b/core/btdiscovery.cpp @@ -43,9 +43,13 @@ struct namePattern { const char *vendor; const char *product; }; +// search is in order of this array, and as a prefix search, so more specific names +// should be added before less specific names (i.e. "Perdix 2" before "Perdix") static struct namePattern name[] = { // Shearwater dive computers { "Predator", "Shearwater", "Predator" }, + { "Perdix 2", "Shearwater", "Perdix 2"}, + { "Petrel 3", "Shearwater", "Petrel 3"}, // both the Petrel and Petrel 2 identify as "Petrel" as BT/BLE device // but only the Petrel 2 is listed as available dive computer on iOS (which requires BLE support) // so always pick the "Petrel 2" as product when seeing a Petrel