Skip to content

Commit

Permalink
Add support for the Scubapro G3 and Luna 2.0
Browse files Browse the repository at this point in the history
The new models appear to be compatible with the previous G2, but with
new model numbers and bluetooth names. The USB VID/PID for the G3 is
still unknown.

Reported-by: Greg McLaughlin <[email protected]>
  • Loading branch information
jefdriesen committed Jan 10, 2024
1 parent 08d8c3e commit d47e1ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/descriptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ static const dc_descriptor_t g_descriptors[] = {
{"Scubapro", "G2 TEK", DC_FAMILY_UWATEC_SMART, 0x31, DC_TRANSPORT_USBHID | DC_TRANSPORT_BLE, dc_filter_uwatec},
{"Scubapro", "G2", DC_FAMILY_UWATEC_SMART, 0x32, DC_TRANSPORT_USBHID | DC_TRANSPORT_BLE, dc_filter_uwatec},
{"Scubapro", "G2 Console", DC_FAMILY_UWATEC_SMART, 0x32, DC_TRANSPORT_USBHID | DC_TRANSPORT_BLE, dc_filter_uwatec},
{"Scubapro", "G3", DC_FAMILY_UWATEC_SMART, 0x34, DC_TRANSPORT_USBHID | DC_TRANSPORT_BLE, dc_filter_uwatec},
{"Scubapro", "G2 HUD", DC_FAMILY_UWATEC_SMART, 0x42, DC_TRANSPORT_USBHID | DC_TRANSPORT_BLE, dc_filter_uwatec},
{"Scubapro", "Luna 2.0 AI", DC_FAMILY_UWATEC_SMART, 0x50, DC_TRANSPORT_BLE, dc_filter_uwatec},
{"Scubapro", "Luna 2.0", DC_FAMILY_UWATEC_SMART, 0x51, DC_TRANSPORT_BLE, dc_filter_uwatec},
/* Reefnet */
{"Reefnet", "Sensus", DC_FAMILY_REEFNET_SENSUS, 1, DC_TRANSPORT_SERIAL, NULL},
{"Reefnet", "Sensus Pro", DC_FAMILY_REEFNET_SENSUSPRO, 2, DC_TRANSPORT_SERIAL, NULL},
Expand Down Expand Up @@ -594,6 +597,9 @@ dc_filter_uwatec (dc_descriptor_t *descriptor, dc_transport_t transport, const v
"A1",
"A2",
"G2 TEK",
"Galileo 3",
"Luna 2.0 AI",
"Luna 2.0",
};

if (transport == DC_TRANSPORT_IRDA) {
Expand Down
12 changes: 10 additions & 2 deletions src/uwatec_smart_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
#define ALADINA2 0x28
#define G2TEK 0x31
#define G2 0x32
#define G3 0x34
#define G2HUD 0x42
#define LUNA2AI 0x50
#define LUNA2 0x51

#define UNSUPPORTED 0xFFFFFFFF

Expand Down Expand Up @@ -532,7 +535,8 @@ uwatec_smart_parser_cache (uwatec_smart_parser_t *parser)
parser->model == G2 || parser->model == ALADINSPORTMATRIX ||
parser->model == ALADINSQUARE || parser->model == G2HUD ||
parser->model == ALADINA1 || parser->model == ALADINA2 ||
parser->model == G2TEK) {
parser->model == G2TEK || parser->model == G3 ||
parser->model == LUNA2AI || parser->model == LUNA2) {
unsigned int offset = header->tankpressure + 2 * i;
endpressure = array_uint16_le(data + offset);
beginpressure = array_uint16_le(data + offset + 2 * header->ngases);
Expand Down Expand Up @@ -623,9 +627,12 @@ uwatec_smart_parser_create (dc_parser_t **out, dc_context_t *context, const unsi
case G2:
case G2HUD:
case G2TEK:
case G3:
case ALADINSPORTMATRIX:
case ALADINA1:
case ALADINA2:
case LUNA2AI:
case LUNA2:
parser->headersize = 84;
parser->header = &uwatec_smart_trimix_header;
parser->samples = uwatec_smart_galileo_samples;
Expand Down Expand Up @@ -928,7 +935,8 @@ uwatec_smart_parse (uwatec_smart_parser_t *parser, dc_sample_callback_t callback
parser->model == G2 || parser->model == ALADINSPORTMATRIX ||
parser->model == ALADINSQUARE || parser->model == G2HUD ||
parser->model == ALADINA1 || parser->model == ALADINA2 ||
parser->model == G2TEK) {
parser->model == G2TEK || parser->model == G3 ||
parser->model == LUNA2AI || parser->model == LUNA2) {
// Uwatec Galileo
id = uwatec_galileo_identify (data[offset]);
} else {
Expand Down

0 comments on commit d47e1ce

Please sign in to comment.