// bobcat1.h // Structure definitions for BOBCAT-1 custom file format messages // Ryan McKnight and Brian C. Peters // Ohio University Avionics Engineering Center #ifndef OHIO_BOBCAT1_H #define OHIO_BOBCAT1_H #include #include #define BOBCAT1_MAX_MSG_LEN 16384 #define BOBCAT1_MSG_ID_TEMP 15 #define BOBCAT1_MSG_ID_TORANGE 30 #define BOBCAT1_MSG_ID_TOBESTPOS 31 #define BOBCAT1_MSG_ID_TORANGEC 32 #define BOBCAT1_MSG_ID_ANTRANGE 40 #define BOBCAT1_MSG_ID_ANTBESTPOS 41 #define BOBCAT1_MSG_ID_ANTGYRO 42 #define BOBCAT1_MSG_ID_ANTSUN 43 #define BOBCAT1_MSG_ID_ANTMAG 44 #define BOBCAT1_MSG_ID_SPECRANGE 50 #define BOBCAT1_MSG_ID_SPECBESTPOS 51 // header ------------------------------- typedef struct __attribute__ ((packed)) { uint8_t sync[3]; uint8_t msg_id; uint16_t msg_size; } bobcat1_msg_header_t; // -------------------------------------- typedef uint32_t bobcat1_msg_crc_t; // crc typedef struct __attribute__ ((packed)) { bobcat1_msg_header_t header; uint8_t data[]; } bobcat1_msg_generic_t; // TEMP --------------------------------- typedef struct __attribute__ ((packed)) { bobcat1_msg_header_t header; uint8_t time_status; uint16_t week; uint32_t ms; uint8_t sensor_id; float temp; } bobcat1_msg_temp_t; // -------------------------------------- // TORANGE ------------------------------ typedef struct __attribute__ ((packed)) { uint16_t prn; uint32_t ch_tr_status; double psr; double adr; float cn0; float locktime; } bobcat1_msg_torange_obs_t; typedef struct __attribute__ ((packed)) { bobcat1_msg_header_t header; uint8_t time_status; uint16_t week; uint32_t ms; uint8_t idle_time; uint16_t num_obs; bobcat1_msg_torange_obs_t obs[]; } bobcat1_msg_torange_t; // -------------------------------------- // TOBESTPOS ---------------------------- typedef struct __attribute__ ((packed)) { bobcat1_msg_header_t header; uint8_t time_status; uint16_t week; uint32_t ms; uint8_t idle_time; uint8_t sol_stat; uint8_t pos_type; double lat; double lon; double hgt; uint8_t num_SVs; uint8_t num_soln_SVs; } bobcat1_msg_tobestpos_t; // -------------------------------------- // TORANGEC ----------------------------- typedef struct __attribute__ ((packed)) { bobcat1_msg_header_t header; uint8_t time_status; uint16_t week; uint32_t ms; uint16_t num_obs; uint8_t pad; uint64_t obs[]; } bobcat1_msg_torangec_t; // -------------------------------------- // ANTRANGE ----------------------------- typedef struct __attribute__ ((packed)) { uint16_t prn; uint32_t ch_tr_status; float cn0; } bobcat1_msg_antrange_obs_t; typedef struct __attribute__ ((packed)) { bobcat1_msg_header_t header; uint8_t time_status; uint16_t week; uint32_t ms; uint8_t idle_time; uint16_t num_obs; bobcat1_msg_antrange_obs_t obs[]; } bobcat1_msg_antrange_t; // -------------------------------------- // ANTBESTPOS --------------------------- typedef struct __attribute__ ((packed)) { bobcat1_msg_header_t header; uint8_t time_status; uint16_t week; uint32_t ms; uint8_t idle_time; uint8_t sol_stat; uint8_t pos_type; double lat; double lon; double hgt; uint8_t num_SVs; uint8_t num_soln_SVs; } bobcat1_msg_antbestpos_t; // -------------------------------------- // ANTGYRO ------------------------------ typedef struct __attribute__ ((packed)) { bobcat1_msg_header_t header; uint8_t time_status; uint16_t week; uint32_t ms; uint32_t a3200_time; int16_t gyro_x; int16_t gyro_y; int16_t gyro_z; } bobcat1_msg_antgyro_t; // -------------------------------------- // ANTSUN ------------------------------- typedef struct __attribute__ ((packed)) { bobcat1_msg_header_t header; uint8_t time_status; uint16_t week; uint32_t ms; uint32_t a3200_time; uint16_t sun_posx1; uint16_t sun_posx2; uint16_t sun_posy1; uint16_t sun_posy2; uint16_t sun_negx1; uint16_t sun_negx2; uint16_t sun_negy1; uint16_t sun_negy2; uint16_t sun_posz; } bobcat1_msg_antsun_t; // -------------------------------------- // ANTMAG ------------------------------- typedef struct __attribute__ ((packed)) { bobcat1_msg_header_t header; uint8_t time_status; uint16_t week; uint32_t ms; uint32_t a3200_time; float mag_x; float mag_y; float mag_z; } bobcat1_msg_antmag_t; // -------------------------------------- // SPECRANGE ----------------------------- typedef struct __attribute__ ((packed)) { uint16_t prn; uint32_t ch_tr_status; float cn0; float locktime; } bobcat1_msg_specrange_obs_t; typedef struct __attribute__ ((packed)) { bobcat1_msg_header_t header; uint8_t time_status; uint16_t week; uint32_t ms; uint8_t idle_time; uint16_t num_obs; bobcat1_msg_specrange_obs_t obs[]; } bobcat1_msg_specrange_t; // -------------------------------------- // SPECBESTPOS -------------------------- typedef struct __attribute__ ((packed)) { bobcat1_msg_header_t header; uint8_t time_status; uint16_t week; uint32_t ms; uint8_t idle_time; uint8_t sol_stat; uint8_t pos_type; double lat; double lon; double hgt; uint8_t num_SVs; uint8_t num_soln_SVs; } bobcat1_msg_specbestpos_t; // --------------------------------------- typedef union { uint8_t raw[BOBCAT1_MAX_MSG_LEN]; bobcat1_msg_header_t header; bobcat1_msg_generic_t generic; bobcat1_msg_temp_t temp; bobcat1_msg_torange_t torange; bobcat1_msg_tobestpos_t tobestpos; bobcat1_msg_torangec_t torangec; bobcat1_msg_antrange_t antrange; bobcat1_msg_antbestpos_t antbestpos; bobcat1_msg_antgyro_t antgyro; bobcat1_msg_antsun_t antsun; bobcat1_msg_antmag_t antmag; bobcat1_msg_specrange_t specrange; bobcat1_msg_specbestpos_t specbestpos; } bobcat1_msg_t; #endif