From 143f23db890bb55c85813404b289b2338d56e2b8 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 25 Sep 2021 15:21:43 +1000 Subject: [PATCH] AP_Logger: move SBP logging structures into AP_GPS --- libraries/AP_Logger/AP_Logger.cpp | 2 +- libraries/AP_Logger/LogStructure.h | 98 +----------------------------- 2 files changed, 4 insertions(+), 96 deletions(-) diff --git a/libraries/AP_Logger/AP_Logger.cpp b/libraries/AP_Logger/AP_Logger.cpp index 1763ba70dc..7d4fa26013 100644 --- a/libraries/AP_Logger/AP_Logger.cpp +++ b/libraries/AP_Logger/AP_Logger.cpp @@ -1221,7 +1221,7 @@ const struct AP_Logger::log_write_fmt *AP_Logger::log_write_fmt_for_msg_type(con // returns true if the msg_type is already taken bool AP_Logger::msg_type_in_use(const uint8_t msg_type) const { - // check static list of messages (e.g. from LOG_BASE_STRUCTURES) + // check static list of messages (e.g. from LOG_COMMON_STRUCTURES) // check the write format types to see if we've used this one for (uint16_t i=0; i<_num_types;i++) { if (structure(i)->msg_type == msg_type) { diff --git a/libraries/AP_Logger/LogStructure.h b/libraries/AP_Logger/LogStructure.h index a0d6833838..8572ef6cc6 100644 --- a/libraries/AP_Logger/LogStructure.h +++ b/libraries/AP_Logger/LogStructure.h @@ -506,59 +506,6 @@ struct PACKED log_RPM { float rpm2; }; -struct PACKED log_SbpLLH { - LOG_PACKET_HEADER; - uint64_t time_us; - uint32_t tow; - int32_t lat; - int32_t lon; - int32_t alt; - uint8_t n_sats; - uint8_t flags; -}; - -struct PACKED log_SbpHealth { - LOG_PACKET_HEADER; - uint64_t time_us; - uint32_t crc_error_counter; - uint32_t last_injected_data_ms; - uint32_t last_iar_num_hypotheses; -}; - -struct PACKED log_SbpRAWH { - LOG_PACKET_HEADER; - uint64_t time_us; - uint16_t msg_type; - uint16_t sender_id; - uint8_t index; - uint8_t pages; - uint8_t msg_len; - uint8_t res; - uint8_t data[48]; -}; - -struct PACKED log_SbpRAWM { - LOG_PACKET_HEADER; - uint64_t time_us; - uint16_t msg_type; - uint16_t sender_id; - uint8_t index; - uint8_t pages; - uint8_t msg_len; - uint8_t res; - uint8_t data[104]; -}; - -struct PACKED log_SbpEvent { - LOG_PACKET_HEADER; - uint64_t time_us; - uint16_t wn; - uint32_t tow; - int32_t ns_residual; - uint8_t level; - uint8_t quality; -}; - struct PACKED log_Rally { LOG_PACKET_HEADER; uint64_t time_us; @@ -1237,7 +1184,7 @@ struct PACKED log_PSCD { // @Field: AD: Acceleration Down // messages for all boards -#define LOG_BASE_STRUCTURES \ +#define LOG_COMMON_STRUCTURES \ { LOG_FORMAT_MSG, sizeof(log_Format), \ "FMT", "BBnNZ", "Type,Length,Name,Format,Columns", "-b---", "-----" }, \ { LOG_UNIT_MSG, sizeof(log_Unit), \ @@ -1351,36 +1298,6 @@ LOG_STRUCTURE_FROM_VISUALODOM \ "PSCD", "Qffffffff", "TimeUS,TPD,PD,DVD,TVD,VD,DAD,TAD,AD", "smmnnnooo", "F00000000" }, \ LOG_STRUCTURE_FROM_AIS \ -// @LoggerMessage: SBPH -// @Description: Swift Health Data -// @Field: TimeUS: Time since system startup -// @Field: CrcError: Number of packet CRC errors on serial connection -// @Field: LastInject: Timestamp of last raw data injection to GPS -// @Field: IARhyp: Current number of integer ambiguity hypotheses - -// @LoggerMessage: SBRH -// @Description: Swift Raw Message Data -// @Field: TimeUS: Time since system startup -// @Field: msg_flag: Swift message type -// @Field: 1: Sender ID -// @Field: 2: index; always 1 -// @Field: 3: pages; number of pages received -// @Field: 4: msg length; number of bytes received -// @Field: 5: unused; always zero -// @Field: 6: data received from device - -#define LOG_SBP_STRUCTURES \ - { LOG_MSG_SBPHEALTH, sizeof(log_SbpHealth), \ - "SBPH", "QIII", "TimeUS,CrcError,LastInject,IARhyp", "s---", "F---" , true }, \ - { LOG_MSG_SBPRAWH, sizeof(log_SbpRAWH), \ - "SBRH", "QQQQQQQQ", "TimeUS,msg_flag,1,2,3,4,5,6", "s--b----", "F--0----" , true }, \ - { LOG_MSG_SBPRAWM, sizeof(log_SbpRAWM), \ - "SBRM", "QQQQQQQQQQQQQQQ", "TimeUS,msg_flag,1,2,3,4,5,6,7,8,9,10,11,12,13", "s??????????????", "F??????????????" , true }, \ - { LOG_MSG_SBPEVENT, sizeof(log_SbpEvent), \ - "SBRE", "QHIiBB", "TimeUS,GWk,GMS,ns_residual,level,quality", "s?????", "F?????" } - -#define LOG_COMMON_STRUCTURES LOG_BASE_STRUCTURES, LOG_SBP_STRUCTURES - // message types 0 to 63 reserved for vehicle specific use // message types for common messages @@ -1404,10 +1321,8 @@ enum LogMessages : uint8_t { LOG_IDS_FROM_CAMERA, LOG_TERRAIN_MSG, LOG_CSRV_MSG, - LOG_ARSP_MSG, LOG_IDS_FROM_ESC_TELEM, LOG_IDS_FROM_BATTMONITOR, - LOG_MAG_MSG, LOG_IDS_FROM_GPS, @@ -1427,6 +1342,8 @@ enum LogMessages : uint8_t { LOG_PIDN_MSG, LOG_PIDE_MSG, LOG_DSTL_MSG, + LOG_MAG_MSG, + LOG_ARSP_MSG, LOG_RPM_MSG, LOG_RFND_MSG, LOG_MAV_STATS, @@ -1434,15 +1351,6 @@ enum LogMessages : uint8_t { LOG_UNIT_MSG, LOG_MULT_MSG, - LOG_MSG_SBPHEALTH, - LOG_MSG_SBPLLH, - LOG_MSG_SBPBASELINE, - LOG_MSG_SBPTRACKING1, - LOG_MSG_SBPTRACKING2, - LOG_MSG_SBPRAWH, - LOG_MSG_SBPRAWM, - LOG_MSG_SBPEVENT, - LOG_RALLY_MSG, LOG_IDS_FROM_VISUALODOM, LOG_BEACON_MSG,