Add initial support for the Oceanic Pro Plus 4

This is _partial_ support for the Oceanic Pro Plus 4 from Jef, based on
a partial dump by John Clark. Quoting Jef in the email thread:

 "I'm not sure why downloading the memory dump fails. All 4 attempts
  fail around the same memory address (0x3140), but not exactly the
  same. Strange, but the good news that there is already enough
  information to figure some things out.

  Linus and Dirk: Attached is a patch with the things I figured out so
  far. Can you make a build for John to try?

  Most of the info looks reasonable, but there are probably still a few
  things missing or wrong. I don't have any ground truth data to compare
  against for things like the temperature sign"

This is that patch for testing.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Jef Driesen 2019-12-20 21:59:18 +01:00 committed by Linus Torvalds
parent 5290984316
commit 8711371728
3 changed files with 9 additions and 3 deletions

View File

@ -244,6 +244,7 @@ static const dc_descriptor_t g_descriptors[] = {
{"Aqualung", "i770R", DC_FAMILY_OCEANIC_ATOM2, 0x4651, DC_TRANSPORT_SERIAL | DC_TRANSPORT_BLE, NULL},
{"Aqualung", "i550C", DC_FAMILY_OCEANIC_ATOM2, 0x4652, DC_TRANSPORT_SERIAL | DC_TRANSPORT_BLE, NULL},
{"Oceanic", "Geo 4.0", DC_FAMILY_OCEANIC_ATOM2, 0x4653, DC_TRANSPORT_SERIAL | DC_TRANSPORT_BLE, NULL},
{"Oceanic", "Pro Plus 4", DC_FAMILY_OCEANIC_ATOM2, 0x4656, DC_TRANSPORT_SERIAL | DC_TRANSPORT_BLE, NULL},
/* Mares Nemo */
{"Mares", "Nemo", DC_FAMILY_MARES_NEMO, 0, DC_TRANSPORT_SERIAL, NULL},
{"Mares", "Nemo Steel", DC_FAMILY_MARES_NEMO, 0, DC_TRANSPORT_SERIAL, NULL},

View File

@ -148,6 +148,7 @@ static const oceanic_common_version_t sherwood_wisdom_version[] = {
static const oceanic_common_version_t oceanic_proplus3_version[] = {
{"PROPLUS3 \0\0 512K"},
{"PROPLUS4 \0\0 512K"},
};
static const oceanic_common_version_t tusa_zenair_version[] = {

View File

@ -95,6 +95,7 @@
#define I770R 0x4651
#define I550C 0x4652
#define GEO40 0x4653
#define PROPLUS4 0x4656
#define NORMAL 0
#define GAUGE 1
@ -174,7 +175,8 @@ oceanic_atom2_parser_create (dc_parser_t **out, dc_context_t *context, unsigned
parser->headersize += PAGESIZE;
} else if (model == TX1) {
parser->headersize += 2 * PAGESIZE;
} else if (model == ATOM1 || model == I100) {
} else if (model == ATOM1 || model == I100 ||
model == PROPLUS4) {
parser->headersize -= 2 * PAGESIZE;
} else if (model == F10A || model == F10B ||
model == MUNDIAL2 || model == MUNDIAL3) {
@ -292,6 +294,7 @@ oceanic_atom2_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetim
case I100:
case I300C:
case GEO40:
case PROPLUS4:
datetime->year = ((p[3] & 0xE0) >> 1) + (p[4] & 0x0F) + 2000;
datetime->month = (p[4] & 0xF0) >> 4;
datetime->day = p[3] & 0x1F;
@ -918,7 +921,8 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_
} else {
unsigned int sign;
if (parser->model == DG03 || parser->model == PROPLUS3 ||
parser->model == I550 || parser->model == I550C)
parser->model == I550 || parser->model == I550C ||
parser->model == PROPLUS4)
sign = (~data[offset + 5] & 0x04) >> 2;
else if (parser->model == VOYAGER2G || parser->model == AMPHOS ||
parser->model == AMPHOSAIR || parser->model == ZENAIR)
@ -951,7 +955,7 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_
parser->model == DG03 || parser->model == PROPLUS3 ||
parser->model == AMPHOSAIR || parser->model == I550 ||
parser->model == VISION || parser->model == XPAIR ||
parser->model == I550C)
parser->model == I550C || parser->model == PROPLUS4)
pressure = (((data[offset + 0] & 0x03) << 8) + data[offset + 1]) * 5;
else if (parser->model == TX1 || parser->model == A300CS ||
parser->model == VTX || parser->model == I750TC ||