Merge branch 'proplus4'
This commit is contained in:
commit
fca64faa3c
@ -35,14 +35,6 @@
|
||||
|
||||
#define ISINSTANCE(device) dc_device_isinstance((device), &oceanic_atom2_device_vtable.base)
|
||||
|
||||
#define PROPLUSX 0x4552
|
||||
#define VTX 0x4557
|
||||
#define I750TC 0x455A
|
||||
#define SAGE 0x4647
|
||||
#define I770R 0x4651
|
||||
#define GEO40 0x4653
|
||||
#define BEACON 0x4742
|
||||
|
||||
#define MAXPACKET 256
|
||||
#define MAXRETRIES 2
|
||||
#define MAXDELAY 16
|
||||
@ -62,9 +54,13 @@
|
||||
#define ACK 0x5A
|
||||
#define NAK 0xA5
|
||||
|
||||
#define REPEAT 50
|
||||
|
||||
typedef struct oceanic_atom2_device_t {
|
||||
oceanic_common_device_t base;
|
||||
dc_iostream_t *iostream;
|
||||
unsigned int handshake_repeat;
|
||||
unsigned int handshake_counter;
|
||||
unsigned int sequence;
|
||||
unsigned int delay;
|
||||
unsigned int extra;
|
||||
@ -410,101 +406,103 @@ static const oceanic_common_layout_t aqualung_i450t_layout = {
|
||||
};
|
||||
|
||||
static const oceanic_common_version_t versions[] = {
|
||||
{"OCEVEO10 \0\0 8K", 0, &oceanic_veo1_layout},
|
||||
{"AERIS XR1 NX R\0\0", 0, &oceanic_veo1_layout},
|
||||
{"OCEVEO10 \0\0 8K", 0, VEO10, &oceanic_veo1_layout},
|
||||
{"AERIS XR1 NX R\0\0", 0, XR1NX, &oceanic_veo1_layout},
|
||||
|
||||
{"ATOM rev\0\0 256K", 0, &oceanic_atom1_layout},
|
||||
{"ATOM rev\0\0 256K", 0, ATOM1, &oceanic_atom1_layout},
|
||||
|
||||
{"MANTA R\0\0 512K", 0x3242, &oceanic_atom2a_layout},
|
||||
{"MANTA R\0\0 512K", 0, &oceanic_atom2c_layout},
|
||||
{"2M ATOM r\0\0 512K", 0x3349, &oceanic_atom2a_layout},
|
||||
{"2M ATOM r\0\0 512K", 0, &oceanic_atom2c_layout},
|
||||
{"MANTA R\0\0 512K", 0x3242, MANTA, &oceanic_atom2a_layout},
|
||||
{"MANTA R\0\0 512K", 0, MANTA, &oceanic_atom2c_layout},
|
||||
{"2M ATOM r\0\0 512K", 0x3349, ATOM2, &oceanic_atom2a_layout},
|
||||
{"2M ATOM r\0\0 512K", 0, ATOM2, &oceanic_atom2c_layout},
|
||||
|
||||
{"INSIGHT2 \0\0 512K", 0, &oceanic_atom2a_layout},
|
||||
{"OCEVEO30 \0\0 512K", 0, &oceanic_atom2a_layout},
|
||||
{"ATMOSAI R\0\0 512K", 0, &oceanic_atom2a_layout},
|
||||
{"PROPLUS2 \0\0 512K", 0, &oceanic_atom2a_layout},
|
||||
{"OCEGEO20 \0\0 512K", 0, &oceanic_atom2a_layout},
|
||||
{"OCE GEO R\0\0 512K", 0, &oceanic_atom2a_layout},
|
||||
{"AQUAI200 \0\0 512K", 0, &oceanic_atom2a_layout},
|
||||
{"AQUA200C \0\0 512K", 0, &oceanic_atom2a_layout},
|
||||
{"INSIGHT2 \0\0 512K", 0, INSIGHT2, &oceanic_atom2a_layout},
|
||||
{"OCEVEO30 \0\0 512K", 0, VEO30, &oceanic_atom2a_layout},
|
||||
{"ATMOSAI R\0\0 512K", 0, ATMOSAI2, &oceanic_atom2a_layout},
|
||||
{"PROPLUS2 \0\0 512K", 0, PROPLUS21, &oceanic_atom2a_layout},
|
||||
{"OCEGEO20 \0\0 512K", 0, GEO20, &oceanic_atom2a_layout},
|
||||
{"OCE GEO R\0\0 512K", 0, GEO, &oceanic_atom2a_layout},
|
||||
{"AQUAI200 \0\0 512K", 0, I200, &oceanic_atom2a_layout},
|
||||
{"AQUA200C \0\0 512K", 0, I200C, &oceanic_atom2a_layout},
|
||||
|
||||
{"ELEMENT2 \0\0 512K", 0, &oceanic_atom2b_layout},
|
||||
{"OCEVEO20 \0\0 512K", 0, &oceanic_atom2b_layout},
|
||||
{"TUSAZEN \0\0 512K", 0, &oceanic_atom2b_layout},
|
||||
{"AQUAI300 \0\0 512K", 0, &oceanic_atom2b_layout},
|
||||
{"HOLLDG03 \0\0 512K", 0, &oceanic_atom2b_layout},
|
||||
{"AQUAI100 \0\0 512K", 0, &oceanic_atom2b_layout},
|
||||
{"AQUA300C \0\0 512K", 0, &oceanic_atom2b_layout},
|
||||
{"OCEGEO40 \0\0 512K", 0, &oceanic_atom2b_layout},
|
||||
{"VEOSMART \0\0 512K", 0, &oceanic_atom2b_layout},
|
||||
{"ELEMENT2 \0\0 512K", 0, ELEMENT2, &oceanic_atom2b_layout},
|
||||
{"OCEVEO20 \0\0 512K", 0, VEO20, &oceanic_atom2b_layout},
|
||||
{"TUSAZEN \0\0 512K", 0, ZEN, &oceanic_atom2b_layout},
|
||||
{"AQUAI300 \0\0 512K", 0, I300, &oceanic_atom2b_layout},
|
||||
{"HOLLDG03 \0\0 512K", 0, DG03, &oceanic_atom2b_layout},
|
||||
{"AQUAI100 \0\0 512K", 0, I100, &oceanic_atom2b_layout},
|
||||
{"AQUA300C \0\0 512K", 0, I300C, &oceanic_atom2b_layout},
|
||||
{"OCEGEO40 \0\0 512K", 0, GEO40, &oceanic_atom2b_layout},
|
||||
{"VEOSMART \0\0 512K", 0, VEO40, &oceanic_atom2b_layout},
|
||||
|
||||
{"2M EPIC r\0\0 512K", 0, &oceanic_atom2c_layout},
|
||||
{"EPIC1 R\0\0 512K", 0, &oceanic_atom2c_layout},
|
||||
{"AERIA300 \0\0 512K", 0, &oceanic_atom2c_layout},
|
||||
{"2M EPIC r\0\0 512K", 0, EPICA, &oceanic_atom2c_layout},
|
||||
{"EPIC1 R\0\0 512K", 0, EPICB, &oceanic_atom2c_layout},
|
||||
{"AERIA300 \0\0 512K", 0, A300, &oceanic_atom2c_layout},
|
||||
|
||||
{"OCE VT3 R\0\0 512K", 0, &oceanic_default_layout},
|
||||
{"ELITET3 R\0\0 512K", 0, &oceanic_default_layout},
|
||||
{"ELITET31 \0\0 512K", 0, &oceanic_default_layout},
|
||||
{"DATAMASK \0\0 512K", 0, &oceanic_default_layout},
|
||||
{"COMPMASK \0\0 512K", 0, &oceanic_default_layout},
|
||||
{"OCE VT3 R\0\0 512K", 0, VT3, &oceanic_default_layout},
|
||||
{"ELITET3 R\0\0 512K", 0, T3A, &oceanic_default_layout},
|
||||
{"ELITET31 \0\0 512K", 0, T3B, &oceanic_default_layout},
|
||||
{"DATAMASK \0\0 512K", 0, DATAMASK, &oceanic_default_layout},
|
||||
{"COMPMASK \0\0 512K", 0, COMPUMASK, &oceanic_default_layout},
|
||||
|
||||
{"WISDOM R\0\0 512K", 0, &sherwood_wisdom_layout},
|
||||
{"WISDOM R\0\0 512K", 0x3342, WISDOM3, &sherwood_wisdom_layout},
|
||||
{"WISDOM R\0\0 512K", 0, WISDOM2, &sherwood_wisdom_layout},
|
||||
|
||||
{"PROPLUS3 \0\0 512K", 0, &oceanic_proplus3_layout},
|
||||
{"PROPLUS4 \0\0 512K", 0, &oceanic_proplus3_layout},
|
||||
{"PROPLUS3 \0\0 512K", 0, PROPLUS3, &oceanic_proplus3_layout},
|
||||
{"PROPLUS4 \0\0 512K", 0, PROPLUS4, &oceanic_proplus3_layout},
|
||||
|
||||
{"TUZENAIR \0\0 512K", 0, &tusa_zenair_layout},
|
||||
{"AMPHOSSW \0\0 512K", 0, &tusa_zenair_layout},
|
||||
{"AMPHOAIR \0\0 512K", 0, &tusa_zenair_layout},
|
||||
{"VOYAGE2G \0\0 512K", 0, &tusa_zenair_layout},
|
||||
{"TUSTALIS \0\0 512K", 0, &tusa_zenair_layout},
|
||||
{"AMPHOS20 \0\0 512K", 0, &tusa_zenair_layout},
|
||||
{"AMPAIR20 \0\0 512K", 0, &tusa_zenair_layout},
|
||||
{"TUZENAIR \0\0 512K", 0, ZENAIR, &tusa_zenair_layout},
|
||||
{"AMPHOSSW \0\0 512K", 0, AMPHOS, &tusa_zenair_layout},
|
||||
{"AMPHOAIR \0\0 512K", 0, AMPHOSAIR, &tusa_zenair_layout},
|
||||
{"VOYAGE2G \0\0 512K", 0, VOYAGER2G, &tusa_zenair_layout},
|
||||
{"TUSTALIS \0\0 512K", 0, TALIS, &tusa_zenair_layout},
|
||||
{"AMPHOS20 \0\0 512K", 0, AMPHOS2, &tusa_zenair_layout},
|
||||
{"AMPAIR20 \0\0 512K", 0, AMPHOSAIR2, &tusa_zenair_layout},
|
||||
|
||||
{"REACPRO2 \0\0 512K", 0, &oceanic_reactpro_layout},
|
||||
{"REACPRO2 \0\0 512K", 0, REACTPROWHITE, &oceanic_reactpro_layout},
|
||||
|
||||
{"FREEWAER \0\0 512K", 0, &aeris_f10_layout},
|
||||
{"OCEANF10 \0\0 512K", 0, &aeris_f10_layout},
|
||||
{"MUNDIAL R\0\0 512K", 0, &aeris_f10_layout},
|
||||
{"FREEWAER \0\0 512K", 0, F10A, &aeris_f10_layout},
|
||||
{"OCEANF10 \0\0 512K", 0, F10B, &aeris_f10_layout},
|
||||
{"MUNDIAL R\0\0 512K", 0x3300, MUNDIAL3, &aeris_f10_layout},
|
||||
{"MUNDIAL R\0\0 512K", 0, MUNDIAL2, &aeris_f10_layout},
|
||||
|
||||
{"AERISF11 \0\0 1024", 0, &aeris_f11_layout},
|
||||
{"OCEANF11 \0\0 1024", 0, &aeris_f11_layout},
|
||||
{"AERISF11 \0\0 1024", 0, F11A, &aeris_f11_layout},
|
||||
{"OCEANF11 \0\0 1024", 0, F11B, &aeris_f11_layout},
|
||||
|
||||
{"OCWATCH R\0\0 1024", 0, &oceanic_oc1_layout},
|
||||
{"OC1WATCH \0\0 1024", 0, &oceanic_oc1_layout},
|
||||
{"OCSWATCH \0\0 1024", 0, &oceanic_oc1_layout},
|
||||
{"AQUAI550 \0\0 1024", 0, &oceanic_oc1_layout},
|
||||
{"AQUA550C \0\0 1024", 0, &oceanic_oc1_layout},
|
||||
{"WISDOM04 \0\0 1024", 0, &oceanic_oc1_layout},
|
||||
{"AQUA470C \0\0 1024", 0, &oceanic_oc1_layout},
|
||||
{"AQUA200C \0\0 1024", 0, &oceanic_oc1_layout},
|
||||
{"GEOAIR \0\0 1024", 0, &oceanic_oc1_layout},
|
||||
{"OCWATCH R\0\0 1024", 0, OC1A, &oceanic_oc1_layout},
|
||||
{"OC1WATCH \0\0 1024", 0, OC1B, &oceanic_oc1_layout},
|
||||
{"OCSWATCH \0\0 1024", 0, OCS, &oceanic_oc1_layout},
|
||||
{"AQUAI550 \0\0 1024", 0, I550, &oceanic_oc1_layout},
|
||||
{"AQUA550C \0\0 1024", 0, I550C, &oceanic_oc1_layout},
|
||||
{"WISDOM04 \0\0 1024", 0, WISDOM4, &oceanic_oc1_layout},
|
||||
{"AQUA470C \0\0 1024", 0, I470TC, &oceanic_oc1_layout},
|
||||
{"AQUA200C \0\0 1024", 0, I200CV2, &oceanic_oc1_layout},
|
||||
{"GEOAIR \0\0 1024", 0, GEOAIR, &oceanic_oc1_layout},
|
||||
|
||||
{"OCEANOCI \0\0 1024", 0, &oceanic_oci_layout},
|
||||
{"OCEANOCI \0\0 1024", 0, OCI, &oceanic_oci_layout},
|
||||
|
||||
{"OCEATOM3 \0\0 1024", 0, &oceanic_atom3_layout},
|
||||
{"ATOM31 \0\0 1024", 0, &oceanic_atom3_layout},
|
||||
{"OCEATOM3 \0\0 1024", 0, ATOM3, &oceanic_atom3_layout},
|
||||
{"ATOM31 \0\0 1024", 0, ATOM31, &oceanic_atom3_layout},
|
||||
|
||||
{"OCEANVT4 \0\0 1024", 0, &oceanic_vt4_layout},
|
||||
{"OCEAVT41 \0\0 1024", 0, &oceanic_vt4_layout},
|
||||
{"AERISAIR \0\0 1024", 0, &oceanic_vt4_layout},
|
||||
{"SWVISION \0\0 1024", 0, &oceanic_vt4_layout},
|
||||
{"XPSUBAIR \0\0 1024", 0, &oceanic_vt4_layout},
|
||||
{"OCEANVT4 \0\0 1024", 0, VT4, &oceanic_vt4_layout},
|
||||
{"OCEAVT41 \0\0 1024", 0, VT41, &oceanic_vt4_layout},
|
||||
{"AERISAIR \0\0 1024", 0, A300AI, &oceanic_vt4_layout},
|
||||
{"SWVISION \0\0 1024", 0, VISION, &oceanic_vt4_layout},
|
||||
{"XPSUBAIR \0\0 1024", 0, XPAIR, &oceanic_vt4_layout},
|
||||
|
||||
{"HOLLDG04 \0\0 2048", 0, &hollis_tx1_layout},
|
||||
{"HOLLDG04 \0\0 2048", 0, TX1, &hollis_tx1_layout},
|
||||
|
||||
{"AER300CS \0\0 2048", 0, &aeris_a300cs_layout},
|
||||
{"OCEANVTX \0\0 2048", 0, &aeris_a300cs_layout},
|
||||
{"AQUAI750 \0\0 2048", 0, &aeris_a300cs_layout},
|
||||
{"SWDRAGON \0\0 2048", 0, &aeris_a300cs_layout},
|
||||
{"SWBEACON \0\0 2048", 0, &aeris_a300cs_layout},
|
||||
{"AER300CS \0\0 2048", 0, A300CS, &aeris_a300cs_layout},
|
||||
{"OCEANVTX \0\0 2048", 0, VTX, &aeris_a300cs_layout},
|
||||
{"AQUAI750 \0\0 2048", 0, I750TC, &aeris_a300cs_layout},
|
||||
{"SWDRAGON \0\0 2048", 0, SAGE, &aeris_a300cs_layout},
|
||||
{"SWBEACON \0\0 2048", 0, BEACON, &aeris_a300cs_layout},
|
||||
|
||||
{"AQUAI450 \0\0 2048", 0, &aqualung_i450t_layout},
|
||||
{"AQUAI450 \0\0 2048", 0, I450T, &aqualung_i450t_layout},
|
||||
|
||||
{"OCEANOCX \0\0 \0\0\0\0", 0, &oceanic_proplusx_layout},
|
||||
{"OCEANOCX \0\0 \0\0\0\0", 0, PROPLUSX, &oceanic_proplusx_layout},
|
||||
|
||||
{"AQUA770R \0\0 \0\0\0\0", 0, &aqualung_i770r_layout},
|
||||
{"AQUA770R \0\0 \0\0\0\0", 0, I770R, &aqualung_i770r_layout},
|
||||
};
|
||||
|
||||
/*
|
||||
@ -933,8 +931,8 @@ oceanic_atom2_device_open (dc_device_t **out, dc_context_t *context, dc_iostream
|
||||
}
|
||||
|
||||
// Detect the memory layout.
|
||||
device->base.layout = OCEANIC_COMMON_MATCH(device->base.version, versions, &device->base.firmware);
|
||||
if (device->base.layout == NULL) {
|
||||
const oceanic_common_version_t *version = OCEANIC_COMMON_MATCH(device->base.version, versions, &device->base.firmware);
|
||||
if (version == NULL) {
|
||||
WARNING (context, "Unsupported device detected!");
|
||||
if (memcmp(device->base.version + 12, "256K", 4) == 0) {
|
||||
device->base.layout = &oceanic_atom1_layout;
|
||||
@ -947,10 +945,15 @@ oceanic_atom2_device_open (dc_device_t **out, dc_context_t *context, dc_iostream
|
||||
} else {
|
||||
device->base.layout = &oceanic_default_layout;
|
||||
}
|
||||
device->base.model = 0;
|
||||
} else {
|
||||
device->base.layout = version->layout;
|
||||
device->base.model = version->model;
|
||||
}
|
||||
|
||||
// Set the big page support.
|
||||
if (device->base.layout == &aeris_f11_layout) {
|
||||
if (device->base.layout == &aeris_f11_layout ||
|
||||
device->base.layout == &oceanic_proplus3_layout) {
|
||||
device->bigpage = 8;
|
||||
} else if (device->base.layout == &oceanic_proplusx_layout ||
|
||||
device->base.layout == &aqualung_i770r_layout ||
|
||||
@ -958,6 +961,11 @@ oceanic_atom2_device_open (dc_device_t **out, dc_context_t *context, dc_iostream
|
||||
device->bigpage = 16;
|
||||
}
|
||||
|
||||
// Repeat the handshaking every few packets.
|
||||
device->handshake_repeat = dc_iostream_get_transport (device->iostream) == DC_TRANSPORT_BLE &&
|
||||
device->base.model == PROPLUS4;
|
||||
device->handshake_counter = 0;
|
||||
|
||||
*out = (dc_device_t*) device;
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
@ -1044,7 +1052,7 @@ oceanic_atom2_device_read (dc_device_t *abstract, unsigned int address, unsigned
|
||||
break;
|
||||
case 8:
|
||||
read_cmd = CMD_READ8;
|
||||
crc_size = 1;
|
||||
crc_size = device->base.model == PROPLUS4 ? 2 : 1;
|
||||
break;
|
||||
case 16:
|
||||
read_cmd = CMD_READ16;
|
||||
@ -1075,6 +1083,12 @@ oceanic_atom2_device_read (dc_device_t *abstract, unsigned int address, unsigned
|
||||
unsigned int page = (address - highmem) / pagesize;
|
||||
|
||||
if (page != device->cached_page || highmem != device->cached_highmem) {
|
||||
if (device->handshake_repeat && ++device->handshake_counter % REPEAT == 0) {
|
||||
unsigned char version[PAGESIZE] = {0};
|
||||
oceanic_atom2_device_version (abstract, version, sizeof (version));
|
||||
oceanic_atom2_ble_handshake (device);
|
||||
}
|
||||
|
||||
// Read the package.
|
||||
unsigned int number = highmem ? page : page * device->bigpage; // This is always PAGESIZE, even in big page mode.
|
||||
unsigned char command[] = {read_cmd,
|
||||
|
||||
@ -31,79 +31,6 @@
|
||||
|
||||
#define ISINSTANCE(parser) dc_parser_isinstance((parser), &oceanic_atom2_parser_vtable)
|
||||
|
||||
#define ATOM1 0x4250
|
||||
#define EPICA 0x4257
|
||||
#define VT3 0x4258
|
||||
#define T3A 0x4259
|
||||
#define ATOM2 0x4342
|
||||
#define GEO 0x4344
|
||||
#define MANTA 0x4345
|
||||
#define DATAMASK 0x4347
|
||||
#define COMPUMASK 0x4348
|
||||
#define OC1A 0x434E
|
||||
#define F10A 0x434D
|
||||
#define WISDOM2 0x4350
|
||||
#define INSIGHT2 0x4353
|
||||
#define ELEMENT2 0x4357
|
||||
#define VEO20 0x4359
|
||||
#define VEO30 0x435A
|
||||
#define ZEN 0x4441
|
||||
#define ZENAIR 0x4442
|
||||
#define ATMOSAI2 0x4443
|
||||
#define PROPLUS21 0x4444
|
||||
#define GEO20 0x4446
|
||||
#define VT4 0x4447
|
||||
#define OC1B 0x4449
|
||||
#define VOYAGER2G 0x444B
|
||||
#define ATOM3 0x444C
|
||||
#define DG03 0x444D
|
||||
#define OCS 0x4450
|
||||
#define OC1C 0x4451
|
||||
#define VT41 0x4452
|
||||
#define EPICB 0x4453
|
||||
#define T3B 0x4455
|
||||
#define ATOM31 0x4456
|
||||
#define A300AI 0x4457
|
||||
#define WISDOM3 0x4458
|
||||
#define A300 0x445A
|
||||
#define TX1 0x4542
|
||||
#define MUNDIAL2 0x4543
|
||||
#define AMPHOS 0x4545
|
||||
#define AMPHOSAIR 0x4546
|
||||
#define PROPLUS3 0x4548
|
||||
#define F11A 0x4549
|
||||
#define OCI 0x454B
|
||||
#define A300CS 0x454C
|
||||
#define TALIS 0x454E
|
||||
#define MUNDIAL3 0x4550
|
||||
#define PROPLUSX 0x4552
|
||||
#define F10B 0x4553
|
||||
#define F11B 0x4554
|
||||
#define XPAIR 0x4555
|
||||
#define VISION 0x4556
|
||||
#define VTX 0x4557
|
||||
#define I300 0x4559
|
||||
#define I750TC 0x455A
|
||||
#define I450T 0x4641
|
||||
#define I550 0x4642
|
||||
#define I200 0x4646
|
||||
#define SAGE 0x4647
|
||||
#define I300C 0x4648
|
||||
#define I200C 0x4649
|
||||
#define I100 0x464E
|
||||
#define I770R 0x4651
|
||||
#define I550C 0x4652
|
||||
#define GEO40 0x4653
|
||||
#define VEO40 0x4654
|
||||
#define WISDOM4 0x4655
|
||||
#define PROPLUS4 0x4656
|
||||
#define AMPHOS2 0x4657
|
||||
#define AMPHOSAIR2 0x4658
|
||||
#define BEACON 0x4742
|
||||
#define I470TC 0x4743
|
||||
#define I200CV2 0x4749
|
||||
#define GEOAIR 0x474B
|
||||
|
||||
#define NORMAL 0
|
||||
#define GAUGE 1
|
||||
#define FREEDIVE 2
|
||||
|
||||
@ -132,7 +132,7 @@ oceanic_common_match_pattern (const unsigned char *string, const unsigned char *
|
||||
return 1;
|
||||
}
|
||||
|
||||
const oceanic_common_layout_t *
|
||||
const oceanic_common_version_t *
|
||||
oceanic_common_match (const unsigned char *version, const oceanic_common_version_t patterns[], size_t n, unsigned int *firmware)
|
||||
{
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
@ -143,7 +143,7 @@ oceanic_common_match (const unsigned char *version, const oceanic_common_version
|
||||
if (firmware) {
|
||||
*firmware = fw;
|
||||
}
|
||||
return patterns[i].layout;
|
||||
return patterns + i;
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,6 +160,7 @@ oceanic_common_device_init (oceanic_common_device_t *device)
|
||||
device->firmware = 0;
|
||||
memset (device->version, 0, sizeof (device->version));
|
||||
memset (device->fingerprint, 0, sizeof (device->fingerprint));
|
||||
device->model = 0;
|
||||
device->layout = NULL;
|
||||
device->multipage = 1;
|
||||
}
|
||||
|
||||
@ -28,6 +28,103 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
// vtpro
|
||||
#define AERIS500AI 0x4151
|
||||
#define VERSAPRO 0x4155
|
||||
#define ATMOS2 0x4158
|
||||
#define PROPLUS2 0x4159
|
||||
#define ATMOSAI 0x4244
|
||||
#define VTPRO 0x4245
|
||||
#define WISDOM 0x4246
|
||||
#define ELITE 0x424F
|
||||
|
||||
// veo250
|
||||
#define REACTPRO 0x4247
|
||||
#define VEO200 0x424B
|
||||
#define VEO250 0x424C
|
||||
#define XP5 0x4251
|
||||
#define VEO180 0x4252
|
||||
#define XR2 0x4255
|
||||
#define INSIGHT 0x425A
|
||||
#define DG02 0x4352
|
||||
|
||||
// atom2
|
||||
#define ATOM1 0x4250
|
||||
#define EPICA 0x4257
|
||||
#define VT3 0x4258
|
||||
#define T3A 0x4259
|
||||
#define ATOM2 0x4342
|
||||
#define GEO 0x4344
|
||||
#define MANTA 0x4345
|
||||
#define XR1NX 0x4346
|
||||
#define DATAMASK 0x4347
|
||||
#define COMPUMASK 0x4348
|
||||
#define F10A 0x434D
|
||||
#define OC1A 0x434E
|
||||
#define WISDOM2 0x4350
|
||||
#define INSIGHT2 0x4353
|
||||
#define REACTPROWHITE 0x4354
|
||||
#define ELEMENT2 0x4357
|
||||
#define VEO10 0x4358
|
||||
#define VEO20 0x4359
|
||||
#define VEO30 0x435A
|
||||
#define ZEN 0x4441
|
||||
#define ZENAIR 0x4442
|
||||
#define ATMOSAI2 0x4443
|
||||
#define PROPLUS21 0x4444
|
||||
#define GEO20 0x4446
|
||||
#define VT4 0x4447
|
||||
#define OC1B 0x4449
|
||||
#define VOYAGER2G 0x444B
|
||||
#define ATOM3 0x444C
|
||||
#define DG03 0x444D
|
||||
#define OCS 0x4450
|
||||
#define OC1C 0x4451
|
||||
#define VT41 0x4452
|
||||
#define EPICB 0x4453
|
||||
#define T3B 0x4455
|
||||
#define ATOM31 0x4456
|
||||
#define A300AI 0x4457
|
||||
#define WISDOM3 0x4458
|
||||
#define A300 0x445A
|
||||
#define TX1 0x4542
|
||||
#define MUNDIAL2 0x4543
|
||||
#define AMPHOS 0x4545
|
||||
#define AMPHOSAIR 0x4546
|
||||
#define PROPLUS3 0x4548
|
||||
#define F11A 0x4549
|
||||
#define OCI 0x454B
|
||||
#define A300CS 0x454C
|
||||
#define TALIS 0x454E
|
||||
#define MUNDIAL3 0x4550
|
||||
#define PROPLUSX 0x4552
|
||||
#define F10B 0x4553
|
||||
#define F11B 0x4554
|
||||
#define XPAIR 0x4555
|
||||
#define VISION 0x4556
|
||||
#define VTX 0x4557
|
||||
#define I300 0x4559
|
||||
#define I750TC 0x455A
|
||||
#define I450T 0x4641
|
||||
#define I550 0x4642
|
||||
#define I200 0x4646
|
||||
#define SAGE 0x4647
|
||||
#define I300C 0x4648
|
||||
#define I200C 0x4649
|
||||
#define I100 0x464E
|
||||
#define I770R 0x4651
|
||||
#define I550C 0x4652
|
||||
#define GEO40 0x4653
|
||||
#define VEO40 0x4654
|
||||
#define WISDOM4 0x4655
|
||||
#define PROPLUS4 0x4656
|
||||
#define AMPHOS2 0x4657
|
||||
#define AMPHOSAIR2 0x4658
|
||||
#define BEACON 0x4742
|
||||
#define I470TC 0x4743
|
||||
#define I200CV2 0x4749
|
||||
#define GEOAIR 0x474B
|
||||
|
||||
#define PAGESIZE 0x10
|
||||
#define FPMAXSIZE 0x20
|
||||
|
||||
@ -64,6 +161,7 @@ typedef struct oceanic_common_device_t {
|
||||
unsigned int firmware;
|
||||
unsigned char version[PAGESIZE];
|
||||
unsigned char fingerprint[FPMAXSIZE];
|
||||
unsigned int model;
|
||||
const oceanic_common_layout_t *layout;
|
||||
unsigned int multipage;
|
||||
} oceanic_common_device_t;
|
||||
@ -77,10 +175,11 @@ typedef struct oceanic_common_device_vtable_t {
|
||||
typedef struct oceanic_common_version_t {
|
||||
unsigned char pattern[PAGESIZE + 1];
|
||||
unsigned int firmware;
|
||||
unsigned int model;
|
||||
const oceanic_common_layout_t *layout;
|
||||
} oceanic_common_version_t;
|
||||
|
||||
const oceanic_common_layout_t *
|
||||
const oceanic_common_version_t *
|
||||
oceanic_common_match (const unsigned char *version, const oceanic_common_version_t patterns[], size_t n, unsigned int *firmware);
|
||||
|
||||
void
|
||||
|
||||
@ -78,14 +78,14 @@ static const oceanic_common_layout_t oceanic_veo250_layout = {
|
||||
};
|
||||
|
||||
static const oceanic_common_version_t versions[] = {
|
||||
{"GENREACT \0\0 256K", 0, &oceanic_veo250_layout},
|
||||
{"VEO 200 R\0\0 256K", 0, &oceanic_veo250_layout},
|
||||
{"VEO 250 R\0\0 256K", 0, &oceanic_veo250_layout},
|
||||
{"SEEMANN R\0\0 256K", 0, &oceanic_veo250_layout},
|
||||
{"VEO 180 R\0\0 256K", 0, &oceanic_veo250_layout},
|
||||
{"AERISXR2 \0\0 256K", 0, &oceanic_veo250_layout},
|
||||
{"INSIGHT R\0\0 256K", 0, &oceanic_veo250_layout},
|
||||
{"HO DGO2 R\0\0 256K", 0, &oceanic_veo250_layout},
|
||||
{"GENREACT \0\0 256K", 0, REACTPRO, &oceanic_veo250_layout},
|
||||
{"VEO 200 R\0\0 256K", 0, VEO200, &oceanic_veo250_layout},
|
||||
{"VEO 250 R\0\0 256K", 0, VEO250, &oceanic_veo250_layout},
|
||||
{"SEEMANN R\0\0 256K", 0, XP5, &oceanic_veo250_layout},
|
||||
{"VEO 180 R\0\0 256K", 0, VEO180, &oceanic_veo250_layout},
|
||||
{"AERISXR2 \0\0 256K", 0, XR2, &oceanic_veo250_layout},
|
||||
{"INSIGHT R\0\0 256K", 0, INSIGHT, &oceanic_veo250_layout},
|
||||
{"HO DGO2 R\0\0 256K", 0, DG02, &oceanic_veo250_layout},
|
||||
};
|
||||
|
||||
static dc_status_t
|
||||
@ -316,10 +316,14 @@ oceanic_veo250_device_open (dc_device_t **out, dc_context_t *context, dc_iostrea
|
||||
}
|
||||
|
||||
// Detect the memory layout.
|
||||
device->base.layout = OCEANIC_COMMON_MATCH(device->base.version, versions, &device->base.firmware);
|
||||
if (device->base.layout == NULL) {
|
||||
const oceanic_common_version_t *version = OCEANIC_COMMON_MATCH(device->base.version, versions, &device->base.firmware);
|
||||
if (version == NULL) {
|
||||
WARNING (context, "Unsupported device detected!");
|
||||
device->base.layout = &oceanic_veo250_layout;
|
||||
device->base.model = 0;
|
||||
} else {
|
||||
device->base.layout = version->layout;
|
||||
device->base.model = version->model;
|
||||
}
|
||||
|
||||
*out = (dc_device_t*) device;
|
||||
|
||||
@ -31,12 +31,6 @@
|
||||
|
||||
#define ISINSTANCE(parser) dc_parser_isinstance((parser), &oceanic_veo250_parser_vtable)
|
||||
|
||||
#define REACTPRO 0x4247
|
||||
#define VEO200 0x424B
|
||||
#define VEO250 0x424C
|
||||
#define INSIGHT 0x425A
|
||||
#define REACTPROWHITE 0x4354
|
||||
|
||||
typedef struct oceanic_veo250_parser_t oceanic_veo250_parser_t;
|
||||
|
||||
struct oceanic_veo250_parser_t {
|
||||
|
||||
@ -40,8 +40,6 @@
|
||||
#define NAK 0xA5
|
||||
#define END 0x51
|
||||
|
||||
#define AERIS500AI 0x4151
|
||||
|
||||
typedef enum oceanic_vtpro_protocol_t {
|
||||
MOD,
|
||||
INTR,
|
||||
@ -50,7 +48,6 @@ typedef enum oceanic_vtpro_protocol_t {
|
||||
typedef struct oceanic_vtpro_device_t {
|
||||
oceanic_common_device_t base;
|
||||
dc_iostream_t *iostream;
|
||||
unsigned int model;
|
||||
oceanic_vtpro_protocol_t protocol;
|
||||
} oceanic_vtpro_device_t;
|
||||
|
||||
@ -120,14 +117,14 @@ static const oceanic_common_layout_t aeris_500ai_layout = {
|
||||
};
|
||||
|
||||
static const oceanic_common_version_t versions[] = {
|
||||
{"VERSAPRO \0\0 256K", 0, &oceanic_vtpro_layout},
|
||||
{"ATMOSTWO \0\0 256K", 0, &oceanic_vtpro_layout},
|
||||
{"PROPLUS2 \0\0 256K", 0, &oceanic_vtpro_layout},
|
||||
{"ATMOSAIR \0\0 256K", 0, &oceanic_vtpro_layout},
|
||||
{"VTPRO r\0\0 256K", 0, &oceanic_vtpro_layout},
|
||||
{"ELITE r\0\0 256K", 0, &oceanic_vtpro_layout},
|
||||
{"VERSAPRO \0\0 256K", 0, VERSAPRO, &oceanic_vtpro_layout},
|
||||
{"ATMOSTWO \0\0 256K", 0, ATMOS2, &oceanic_vtpro_layout},
|
||||
{"PROPLUS2 \0\0 256K", 0, PROPLUS2, &oceanic_vtpro_layout},
|
||||
{"ATMOSAIR \0\0 256K", 0, ATMOSAI, &oceanic_vtpro_layout},
|
||||
{"VTPRO r\0\0 256K", 0, VTPRO, &oceanic_vtpro_layout},
|
||||
{"ELITE r\0\0 256K", 0, ELITE, &oceanic_vtpro_layout},
|
||||
|
||||
{"WISDOM r\0\0 256K", 0, &oceanic_wisdom_layout},
|
||||
{"WISDOM r\0\0 256K", 0, WISDOM, &oceanic_wisdom_layout},
|
||||
};
|
||||
|
||||
static dc_status_t
|
||||
@ -381,7 +378,7 @@ oceanic_vtpro_device_logbook (dc_device_t *abstract, dc_event_progress_t *progre
|
||||
{
|
||||
oceanic_vtpro_device_t *device = (oceanic_vtpro_device_t *) abstract;
|
||||
|
||||
if (device->model == AERIS500AI) {
|
||||
if (device->base.model == AERIS500AI) {
|
||||
return oceanic_aeris500ai_device_logbook (abstract, progress, logbook);
|
||||
} else {
|
||||
return oceanic_common_device_logbook (abstract, progress, logbook);
|
||||
@ -412,7 +409,6 @@ oceanic_vtpro_device_open (dc_device_t **out, dc_context_t *context, dc_iostream
|
||||
|
||||
// Set the default values.
|
||||
device->iostream = iostream;
|
||||
device->model = model;
|
||||
if (model == AERIS500AI) {
|
||||
device->protocol = INTR;
|
||||
} else {
|
||||
@ -492,11 +488,16 @@ oceanic_vtpro_device_open (dc_device_t **out, dc_context_t *context, dc_iostream
|
||||
// Detect the memory layout.
|
||||
if (model == AERIS500AI) {
|
||||
device->base.layout = &aeris_500ai_layout;
|
||||
device->base.model = AERIS500AI;
|
||||
} else {
|
||||
device->base.layout = OCEANIC_COMMON_MATCH(device->base.version, versions, &device->base.firmware);
|
||||
if (device->base.layout == NULL) {
|
||||
const oceanic_common_version_t * version = OCEANIC_COMMON_MATCH(device->base.version, versions, &device->base.firmware);
|
||||
if (version == NULL) {
|
||||
WARNING (context, "Unsupported device detected!");
|
||||
device->base.layout = &oceanic_vtpro_layout;
|
||||
device->base.model = 0;
|
||||
} else {
|
||||
device->base.layout = version->layout;
|
||||
device->base.model = version->model;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -31,8 +31,6 @@
|
||||
|
||||
#define ISINSTANCE(parser) dc_parser_isinstance((parser), &oceanic_vtpro_parser_vtable)
|
||||
|
||||
#define AERIS500AI 0x4151
|
||||
|
||||
typedef struct oceanic_vtpro_parser_t oceanic_vtpro_parser_t;
|
||||
|
||||
struct oceanic_vtpro_parser_t {
|
||||
|
||||
@ -35,7 +35,6 @@
|
||||
#include "uwatec_memomouse.h"
|
||||
#include "uwatec_smart.h"
|
||||
#include "oceanic_atom2.h"
|
||||
#include "oceanic_atom2.h"
|
||||
#include "oceanic_veo250.h"
|
||||
#include "oceanic_vtpro.h"
|
||||
#include "mares_darwin.h"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user