Add support for the Aqualung i450T.

This commit is contained in:
Jef Driesen 2016-03-26 22:41:57 +01:00
parent f3fb2391f9
commit 018c27d7b3
3 changed files with 33 additions and 6 deletions

View File

@ -184,6 +184,7 @@ static const dc_descriptor_t g_descriptors[] = {
{"Aeris", "A300CS", DC_FAMILY_OCEANIC_ATOM2, 0x454C},
{"Oceanic", "F11", DC_FAMILY_OCEANIC_ATOM2, 0x4554},
{"Oceanic", "VTX", DC_FAMILY_OCEANIC_ATOM2, 0x4557},
{"Aqualung", "i450T", DC_FAMILY_OCEANIC_ATOM2, 0x4641},
/* Mares Nemo */
{"Mares", "Nemo", DC_FAMILY_MARES_NEMO, 0},
{"Mares", "Nemo Steel", DC_FAMILY_MARES_NEMO, 0},

View File

@ -180,6 +180,10 @@ static const oceanic_common_version_t aeris_a300cs_version[] = {
{"OCEANVTX \0\0 2048"},
};
static const oceanic_common_version_t aqualung_i450t_version[] = {
{"AQUAI450 \0\0 2048"},
};
static const oceanic_common_layout_t aeris_f10_layout = {
0x10000, /* memsize */
0x0000, /* cf_devinfo */
@ -401,6 +405,18 @@ static const oceanic_common_layout_t aeris_a300cs_layout = {
1 /* pt_mode_logbook */
};
static const oceanic_common_layout_t aqualung_i450t_layout = {
0x40000, /* memsize */
0x0000, /* cf_devinfo */
0x0040, /* cf_pointers */
0x10C0, /* rb_logbook_begin */
0x1400, /* rb_logbook_end */
16, /* rb_logbook_entry_size */
0x1400, /* rb_profile_begin */
0x3FE00, /* rb_profile_end */
0, /* pt_mode_global */
1 /* pt_mode_logbook */
};
static dc_status_t
oceanic_atom2_packet (oceanic_atom2_device_t *device, const unsigned char command[], unsigned int csize, unsigned char answer[], unsigned int asize, unsigned int crc_size)
@ -634,6 +650,8 @@ oceanic_atom2_device_open2 (dc_device_t **out, dc_context_t *context, const char
} else if (OCEANIC_COMMON_MATCH (device->base.version, aeris_a300cs_version)) {
device->base.layout = &aeris_a300cs_layout;
device->bigpage = 16;
} else if (OCEANIC_COMMON_MATCH (device->base.version, aqualung_i450t_version)) {
device->base.layout = &aqualung_i450t_layout;
} else {
device->base.layout = &oceanic_default_layout;
}

View File

@ -75,6 +75,7 @@
#define A300CS 0x454C
#define F11B 0x4554
#define VTX 0x4557
#define I450T 0x4641
#define NORMAL 0
#define GAUGE 1
@ -158,7 +159,7 @@ oceanic_atom2_parser_create (dc_parser_t **out, dc_context_t *context, unsigned
} else if (model == F11A || model == F11B) {
parser->headersize = 5 * PAGESIZE;
parser->footersize = 0;
} else if (model == A300CS || model == VTX) {
} else if (model == A300CS || model == VTX || model == I450T) {
parser->headersize = 5 * PAGESIZE;
}
@ -283,6 +284,7 @@ oceanic_atom2_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetim
break;
case A300CS:
case VTX:
case I450T:
datetime->year = (p[10]) + 2000;
datetime->month = (p[8]);
datetime->day = (p[9]);
@ -407,6 +409,9 @@ oceanic_atom2_parser_cache (oceanic_atom2_parser_t *parser)
} else {
ngasmixes = 4;
}
} else if (parser->model == I450T) {
o2_offset = 0x30;
ngasmixes = 3;
} else {
o2_offset = header + 4;
ngasmixes = 3;
@ -597,7 +602,7 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_
} else if (parser->model == OC1A || parser->model == OC1B ||
parser->model == OC1C || parser->model == OCI ||
parser->model == TX1 || parser->model == A300CS ||
parser->model == VTX) {
parser->model == VTX || parser->model == I450T) {
samplesize = PAGESIZE;
}
@ -722,7 +727,8 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_
} else if (parser->model == GEO20 || parser->model == VEO20 ||
parser->model == VEO30 || parser->model == OC1A ||
parser->model == OC1B || parser->model == OC1C ||
parser->model == OCI || parser->model == A300) {
parser->model == OCI || parser->model == A300 ||
parser->model == I450T) {
temperature = data[offset + 3];
} else if (parser->model == OCS || parser->model == TX1) {
temperature = data[offset + 1];
@ -756,7 +762,8 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_
// Tank Pressure (psi)
if (have_pressure) {
if (parser->model == OC1A || parser->model == OC1B ||
parser->model == OC1C || parser->model == OCI)
parser->model == OC1C || parser->model == OCI ||
parser->model == I450T)
pressure = (data[offset + 10] + (data[offset + 11] << 8)) & 0x0FFF;
else if (parser->model == VT4 || parser->model == VT41||
parser->model == ATOM3 || parser->model == ATOM31 ||
@ -780,7 +787,8 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_
else if (parser->model == GEO20 || parser->model == VEO20 ||
parser->model == VEO30 || parser->model == OC1A ||
parser->model == OC1B || parser->model == OC1C ||
parser->model == OCI || parser->model == A300)
parser->model == OCI || parser->model == A300 ||
parser->model == I450T)
depth = (data[offset + 4] + (data[offset + 5] << 8)) & 0x0FFF;
else if (parser->model == ATOM1)
depth = data[offset + 3] * 16;
@ -818,7 +826,7 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_
// NDL / Deco
unsigned int have_deco = 0;
unsigned int decostop = 0, decotime = 0;
if (parser->model == A300CS || parser->model == VTX) {
if (parser->model == A300CS || parser->model == VTX || parser->model == I450T) {
decostop = (data[offset + 15] & 0x70) >> 4;
decotime = array_uint16_le(data + offset + 6) & 0x03FF;
have_deco = 1;