Changeset 22f07f5 in subsurface


Ignore:
Timestamp:
May 7, 2017, 7:48:12 AM (5 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
ceb54e6
Parents:
25cec35d
git-author:
Salvador Cuñat <salvador.cunat@…> (05/07/17 01:27:44)
git-committer:
Dirk Hohndel <dirk@…> (05/07/17 07:48:12)
Message:

Datatrak import rework: initial changes

Remove dtrakheader structure. In the end, we only make use of the number
of dives in the log file.

Define a models_table_t table which strores the known Uwatec's Aladin
models and its equivalence with libdivecomputer known models.

Add a macro to check that movements in memblock buffer don't get out of
the allocated memory.

Signed-off-by: Salvador Cuñat <salvador.cunat@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/datatrak.h

    r6399eaf r22f07f5  
    44
    55#include <string.h>
     6#include "libdivecomputer.h"
    67
    7 typedef struct dtrakheader_ {
    8         int header; //Must be 0xA100;
    9         int divesNum;
    10         int dc_serial_1;
    11         int dc_serial_2;
    12 } dtrakheader;
     8struct models_table_t {
     9        int model_num;
     10        int libdc_num;
     11        const char *name;
     12        dc_family_t type;
     13};
     14
     15/*
     16 * Set of known models and equivalences with libdivecomputer.
     17 * Not included 0x14, 0x24, 0x41, and 0x73 known to exist, but not its model name.
     18 * Unknown model equivalence is set to Air X which should cover most profiles.
     19 * Nitrox and 02 models seems to keep its number more seriously than earlier
     20 * series and OEMs. Info for unknown  models is always welcome.
     21 */
     22static const struct models_table_t g_models[] = {
     23        {0x00,  0x00,   "Manually entered dive",        DC_FAMILY_NULL},
     24        {0x1B,  0x3F,   "Uwatec Aladin Pro",            DC_FAMILY_UWATEC_ALADIN},
     25        {0x1C,  0x1C,   "Uwatec Aladin Air",            DC_FAMILY_UWATEC_ALADIN},
     26        {0x1D,  0x3F,   "Spiro Monitor 2 plus",         DC_FAMILY_UWATEC_ALADIN},
     27        {0x1E,  0x3E,   "Uwatec Aladin Sport",          DC_FAMILY_UWATEC_ALADIN},
     28        {0x1F,  0x3F,   "Uwatec Aladin Pro",            DC_FAMILY_UWATEC_ALADIN},
     29        {0x34,  0x44,   "Uwatec Aladin Air X/Z",        DC_FAMILY_UWATEC_ALADIN},
     30        {0x3D,  0x3F,   "Spiro Monitor 2 plus",         DC_FAMILY_UWATEC_ALADIN},
     31        {0x3E,  0x3E,   "Uwatec Aladin Sport",          DC_FAMILY_UWATEC_ALADIN},
     32        {0x3F,  0x3F,   "Uwatec Aladin Pro",            DC_FAMILY_UWATEC_ALADIN},
     33        {0x44,  0x44,   "Uwatec Aladin Air X/Z",        DC_FAMILY_UWATEC_ALADIN},
     34        {0x48,  0x1C,   "Spiro Monitor 3 Air",          DC_FAMILY_UWATEC_ALADIN},
     35        {0xA4,  0xA4,   "Uwatec Aladin Air X/Z O2",     DC_FAMILY_UWATEC_ALADIN},
     36        {0xB1,  0x3E,   "Citizen Hyper Aqualand",       DC_FAMILY_UWATEC_ALADIN},
     37        {0xB2,  0x3F,   "Citizen ProMaster",            DC_FAMILY_UWATEC_ALADIN},
     38        {0xB3,  0x3F,   "Mares Guardian",               DC_FAMILY_UWATEC_ALADIN},
     39        {0xF4,  0xF4,   "Uwatec Aladin Air X/Z Nitrox", DC_FAMILY_UWATEC_ALADIN},
     40        {0xFF,  0xFF,   "Uwatec Aladin Pro Nitrox",     DC_FAMILY_UWATEC_ALADIN},
     41        {0xEE,  0x44,   "Uwatec Unknown model",         DC_FAMILY_UWATEC_ALADIN},
     42};
     43
     44extern struct sample *add_sample(struct sample *sample, int time, struct divecomputer *dc);
     45
     46#define JUMP(_ptr, _n) if ((long) (_ptr += _n) > maxbuf) goto bail
    1347
    1448#define read_bytes(_n) \
Note: See TracChangeset for help on using the changeset viewer.