Add support for the Oceanic OCS.

This commit is contained in:
Jef Driesen 2012-09-11 20:26:20 +02:00
parent 6242978fc0
commit 1b7eaaa831
2 changed files with 11 additions and 3 deletions

View File

@ -77,6 +77,7 @@ static const unsigned char oceanic_vt41_version[] = "OCEAVT41 \0\0 1024";
static const unsigned char oceanic_geo2_version[] = "OCEGEO20 \0\0 512K";
static const unsigned char oceanic_oc1a_version[] = "OCWATCH R\0\0 1024";
static const unsigned char oceanic_oc1b_version[] = "OC1WATCH \0\0 1024";
static const unsigned char oceanic_ocs_version[] = "OCSWATCH \0\0 1024";
static const unsigned char oceanic_veo1_version[] = "OCEVEO10 \0\0 8K";
static const unsigned char oceanic_veo2_version[] = "OCEVEO20 \0\0 512K";
static const unsigned char oceanic_veo3_version[] = "OCEVEO30 \0\0 512K";
@ -369,6 +370,7 @@ oceanic_atom2_device_open (device_t **out, const char* name)
// Override the base class values.
if (oceanic_common_match (oceanic_oc1a_version, device->version, sizeof (device->version)) ||
oceanic_common_match (oceanic_oc1b_version, device->version, sizeof (device->version)) ||
oceanic_common_match (oceanic_ocs_version, device->version, sizeof (device->version)) ||
oceanic_common_match (oceanic_atom3_version, device->version, sizeof (device->version)) ||
oceanic_common_match (oceanic_atom31_version, device->version, sizeof (device->version)) ||
oceanic_common_match (oceanic_vt4_version, device->version, sizeof (device->version)) ||

View File

@ -46,6 +46,7 @@
#define VT4 0x4447
#define OC1B 0x4449
#define ATOM3 0x444C
#define OCS 0x4450
#define VT41 0x4452
#define ATOM31 0x4456
@ -165,6 +166,7 @@ oceanic_atom2_parser_get_datetime (parser_t *abstract, dc_datetime_t *datetime)
switch (parser->model) {
case OC1A:
case OC1B:
case OCS:
case VT4:
case VT41:
case ATOM3:
@ -266,7 +268,8 @@ oceanic_atom2_parser_get_field (parser_t *abstract, parser_field_type_t type, un
unsigned int footersize = 2 * PAGESIZE / 2;
if (parser->model == DATAMASK || parser->model == COMPUMASK ||
parser->model == GEO || parser->model == GEO20 ||
parser->model == VEO20 || parser->model == VEO30) {
parser->model == VEO20 || parser->model == VEO30 ||
parser->model == OCS) {
headersize -= PAGESIZE;
} else if (parser->model == VT4 || parser->model == VT41) {
headersize += PAGESIZE;
@ -359,7 +362,8 @@ oceanic_atom2_parser_samples_foreach (parser_t *abstract, sample_callback_t call
unsigned int footersize = 2 * PAGESIZE / 2;
if (parser->model == DATAMASK || parser->model == COMPUMASK ||
parser->model == GEO || parser->model == GEO20 ||
parser->model == VEO20 || parser->model == VEO30) {
parser->model == VEO20 || parser->model == VEO30 ||
parser->model == OCS) {
headersize -= PAGESIZE;
} else if (parser->model == VT4 || parser->model == VT41) {
headersize += PAGESIZE;
@ -402,7 +406,7 @@ oceanic_atom2_parser_samples_foreach (parser_t *abstract, sample_callback_t call
samplesize = 2;
unsigned int have_temperature = 1, have_pressure = 1;
if (parser->model == VEO30) {
if (parser->model == VEO30 || parser->model == OCS) {
have_pressure = 0;
} else if (parser->model == F10) {
have_temperature = 0;
@ -506,6 +510,8 @@ oceanic_atom2_parser_samples_foreach (parser_t *abstract, sample_callback_t call
parser->model == VEO30 || parser->model == OC1A ||
parser->model == OC1B) {
temperature = data[offset + 3];
} else if (parser->model == OCS) {
temperature = data[offset + 1];
} else if (parser->model == VT4 || parser->model == VT41 || parser->model == ATOM3 || parser->model == ATOM31) {
temperature = ((data[offset + 7] & 0xF0) >> 4) | ((data[offset + 7] & 0x0C) << 2) | ((data[offset + 5] & 0x0C) << 4);
} else {