Skip to content

Commit

Permalink
Add support for the Shearwater Tern
Browse files Browse the repository at this point in the history
  • Loading branch information
jefdriesen committed Jan 17, 2024
1 parent cfe345a commit de6696b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/descriptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ static const dc_descriptor_t g_descriptors[] = {
{"Shearwater", "Peregrine", DC_FAMILY_SHEARWATER_PETREL, 9, DC_TRANSPORT_BLE, dc_filter_shearwater},
{"Shearwater", "Petrel 3", DC_FAMILY_SHEARWATER_PETREL, 10, DC_TRANSPORT_BLE, dc_filter_shearwater},
{"Shearwater", "Perdix 2", DC_FAMILY_SHEARWATER_PETREL, 11, DC_TRANSPORT_BLE, dc_filter_shearwater},
{"Shearwater", "Tern", DC_FAMILY_SHEARWATER_PETREL, 12, DC_TRANSPORT_BLE, dc_filter_shearwater},
/* Dive Rite NiTek Q */
{"Dive Rite", "NiTek Q", DC_FAMILY_DIVERITE_NITEKQ, 0, DC_TRANSPORT_SERIAL, NULL},
/* Citizen Hyper Aqualand */
Expand Down Expand Up @@ -668,6 +669,7 @@ dc_filter_shearwater (dc_descriptor_t *descriptor, dc_transport_t transport, con
"Perdix 2",
"Teric",
"Peregrine",
"Tern"
};

if (transport == DC_TRANSPORT_BLUETOOTH || transport == DC_TRANSPORT_BLE) {
Expand Down
3 changes: 3 additions & 0 deletions src/shearwater_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,9 @@ shearwater_common_get_model (shearwater_common_device_t *device, unsigned int ha
case 0x1512:
model = PEREGRINE;
break;
case 0xC0E0:
model = TERN;
break;
default:
WARNING (device->base.context, "Unknown hardware type 0x%04x.", hardware);
}
Expand Down
1 change: 1 addition & 0 deletions src/shearwater_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ extern "C" {
#define PEREGRINE 9
#define PETREL3 10
#define PERDIX2 11
#define TERN 12

#define NSTEPS 10000
#define STEP(i,n) ((NSTEPS * (i) + (n) / 2) / (n))
Expand Down

0 comments on commit de6696b

Please sign in to comment.