//definitions and typedef for operational message type (ID 4)
//bit definitions for dataValid mask
#define VERTDAMP_GPS   (1<<0)
#define VERTDAMP_PRESS (0<<0)
#define VSALIN         (1<<4)
#define VHDG           (1<<5)
#define VDPTH          (1<<6)
#define VPOS           (1<<7)

//bit definitions for mode control mask
#define DOPPING        (1<<0)  //doppler ping
#define SHTDNCOM       (1<<1)  //shutdown command
#define DOPENAB        (1<<2)  //DVL aiding enable; remember to make it ping
#define GPSENAB        (1<<3)  //GPS aiding enable
#define ZUPCOM         (1<<4)  //force a ZUPT alignment
#define ZUPENAB        (1<<5)  //enable automatic ZUPT alignment
#define RESTART        (1<<6)  //tell INS to abort current op and enter idle
#define STALIGNC       (1<<7)  //perform stationary alignment

//special command bit defitions
#define FORCEPOS       (1<<0) //force position fix
#define BOTTOM_TRK_ONLY ((0x00)<<1)
#define WATER_AND_BOTTOM_TRK ((0x01)<<1)
#define AUTONOMOUS_MODE ((0x02)<<1)
#define WATER_TRK_ONLY ((0x03)<<1)

//definitions for configuration data message (ID 2 & 3)
#define DOPCAL    (1<<3)
#define TSTMSGFEN (1<<4)
#define TSTMSGSEN (1<<5)
#define SURFACE   (1<<7)

#define VALID_DVL_HEIGHT   (1<<0)
#define ZUPT_PROCESSED     (1<<2)
#define DOP_DATA_REJECTED  (1<<3)
#define DOP_DATA_PROCESSED (1<<4)
#define GPS_DATA_REJECTED  (1<<5)
#define GPS_DATA_PROCESSED (1<<6)
#define DEPTH_LOOP_OPEN    (1<<7)

#define BOTTOM_BEAM1_CORRELATION    1	/* bottom-referenced correlation and  */
#define BOTTOM_BEAM1_ECHO_AMPLITUDE 2	/* echo amplitude status              */
#define BOTTOM_BEAM2_CORRELATION    4
#define BOTTOM_BEAM2_ECHO_AMPLITUDE 8
#define BOTTOM_BEAM3_CORRELATION    16
#define BOTTOM_BEAM3_ECHO_AMPLITUDE 32
#define BOTTOM_BEAM4_CORRELATION    64
#define BOTTOM_BEAM4_ECHO_AMPLITUDE 128
#define WATER_BEAM1_CORRELATION     1	/* water-referenced depth and         */
#define WATER_BEAM2_CORRELATION     4	/* correlation status                 */
#define WATER_BEAM3_CORRELATION     8
#define WATER_BEAM4_CORRELATION     16 
#define ALTITUDE_TOO_SHALLOW        32
					/* bad velocity value returned        */
#define BAD_VELOCITY                -32768

                                        /* dvlDataStatus & SerialStatus flags */
#define DVL_DATA_GOOD               0   /* Good data received from DVL        */
#define BAD_BOTTOM_TRACK_VELOCITY   1	/* bad bottom track velocity          */
#define BAD_WATER_MASS_VELOCITY     2	/* bad water track velocity           */
#define NO_DVL_RESPONSE             4	/* No response from DVL serial line   */
#define BAD_SERIAL_READ             8	/* Problem reading serial line        */
#define CHECKSUM_WRONG              16	/* Incorrect checksum from serial     */





