Add support for the Oceanic Atom 1.0.
This commit is contained in:
parent
4fd295b4ac
commit
910521fe80
@ -65,6 +65,7 @@ static const device_backend_t oceanic_atom2_device_backend = {
|
||||
|
||||
static const unsigned char oceanic_proplus2_version[] = "PROPLUS2 \0\0 512K";
|
||||
static const unsigned char oceanic_wisdom2_version[] = "WISDOM R\0\0 512K";
|
||||
static const unsigned char oceanic_atom1_version[] = "ATOM rev\0\0 256K";
|
||||
static const unsigned char oceanic_atom2_version[] = "2M ATOM r\0\0 512K";
|
||||
static const unsigned char oceanic_epic_version[] = "2M EPIC r\0\0 512K";
|
||||
static const unsigned char oceanic_geo2_version[] = "OCEGEO20 \0\0 512K";
|
||||
@ -83,6 +84,18 @@ static const oceanic_common_layout_t oceanic_default_layout = {
|
||||
0 /* pt_mode_logbook */
|
||||
};
|
||||
|
||||
static const oceanic_common_layout_t oceanic_atom1_layout = {
|
||||
0x8000, /* memsize */
|
||||
0x0000, /* cf_devinfo */
|
||||
0x0040, /* cf_pointers */
|
||||
0x0240, /* rb_logbook_begin */
|
||||
0x0A40, /* rb_logbook_end */
|
||||
0x0A40, /* rb_profile_begin */
|
||||
0x8000, /* rb_profile_end */
|
||||
0, /* pt_mode_global */
|
||||
0 /* pt_mode_logbook */
|
||||
};
|
||||
|
||||
static const oceanic_common_layout_t oceanic_atom2_layout = {
|
||||
0xFFF0, /* memsize */
|
||||
0x0000, /* cf_devinfo */
|
||||
@ -317,6 +330,8 @@ oceanic_atom2_device_open (device_t **out, const char* name)
|
||||
oceanic_common_match (oceanic_proplus2_version, device->version, sizeof (device->version)) ||
|
||||
oceanic_common_match (oceanic_wisdom2_version, device->version, sizeof (device->version)))
|
||||
device->base.layout = &oceanic_atom2_layout;
|
||||
else if (oceanic_common_match (oceanic_atom1_version, device->version, sizeof (device->version)))
|
||||
device->base.layout = &oceanic_atom1_layout;
|
||||
else
|
||||
device->base.layout = &oceanic_default_layout;
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
#include "units.h"
|
||||
#include "utils.h"
|
||||
|
||||
#define ATOM1 0x4250
|
||||
#define EPIC 0x4257
|
||||
#define VT3 0x4258
|
||||
#define ATOM2 0x4342
|
||||
@ -223,6 +224,8 @@ oceanic_atom2_parser_samples_foreach (parser_t *abstract, sample_callback_t call
|
||||
parser->model == GEO20 || parser->model == VEO20 ||
|
||||
parser->model == VEO30)
|
||||
header -= PAGESIZE;
|
||||
else if (parser->model == ATOM1)
|
||||
header -= 2 * PAGESIZE;
|
||||
|
||||
if (size < header + 3 * PAGESIZE / 2)
|
||||
return PARSER_STATUS_ERROR;
|
||||
@ -322,7 +325,7 @@ oceanic_atom2_parser_samples_foreach (parser_t *abstract, sample_callback_t call
|
||||
}
|
||||
} else {
|
||||
// Temperature (°F)
|
||||
if (parser->model == GEO) {
|
||||
if (parser->model == GEO || parser->model == ATOM1) {
|
||||
temperature = data[offset + 6];
|
||||
} else if (parser->model == GEO20 || parser->model == VEO20 ||
|
||||
parser->model == VEO30 || parser->model == OC1A ||
|
||||
@ -357,6 +360,8 @@ oceanic_atom2_parser_samples_foreach (parser_t *abstract, sample_callback_t call
|
||||
parser->model == VEO30 || parser->model == OC1A ||
|
||||
parser->model == OC1B)
|
||||
depth = (data[offset + 4] + (data[offset + 5] << 8)) & 0x0FFF;
|
||||
else if (parser->model == ATOM1)
|
||||
depth = data[offset + 3] * 16;
|
||||
else
|
||||
depth = (data[offset + 2] + (data[offset + 3] << 8)) & 0x0FFF;
|
||||
sample.depth = depth / 16.0 * FEET;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user