From 0b5dad33f26b96ffaed212d75674c30dfa07f422 Mon Sep 17 00:00:00 2001 From: ebethon Date: Mon, 26 Jun 2017 16:41:24 +0100 Subject: [PATCH] DataFlash: Rename SBR1/SBR2 to SBRH/SBRM and change format Add (sender_id, msg_len) in SBRM message Add index/pages in SBRH/SBRM messages Change format to integers to avoid GCS string parsing Decrease data size in SBRH --- libraries/DataFlash/LogStructure.h | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/libraries/DataFlash/LogStructure.h b/libraries/DataFlash/LogStructure.h index 838f14671e..6dfb0e0864 100644 --- a/libraries/DataFlash/LogStructure.h +++ b/libraries/DataFlash/LogStructure.h @@ -790,20 +790,28 @@ struct PACKED log_SbpHealth { uint32_t last_iar_num_hypotheses; }; -struct PACKED log_SbpRAW1 { +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 data1[64]; + uint8_t res; + uint8_t data[48]; }; -struct PACKED log_SbpRAW2 { +struct PACKED log_SbpRAWM { LOG_PACKET_HEADER; uint64_t time_us; uint16_t msg_type; - uint8_t data2[192]; + uint16_t sender_id; + uint8_t index; + uint8_t pages; + uint8_t msg_len; + uint8_t res; + uint8_t data[104]; }; struct PACKED log_Rally { @@ -1122,11 +1130,11 @@ Format characters in the format string for binary log messages // #if SBP_HW_LOGGING #define LOG_SBP_STRUCTURES \ { LOG_MSG_SBPHEALTH, sizeof(log_SbpHealth), \ - "SBPH", "QIII", "TimeUS,CrcError,LastInject,IARhyp" }, \ - { LOG_MSG_SBPRAW1, sizeof(log_SbpRAW1), \ - "SBR1", "QHHBZ", "TimeUS,msg_type,sender_id,msg_len,d1" }, \ - { LOG_MSG_SBPRAW2, sizeof(log_SbpRAW2), \ - "SBR2", "QHZZZ", "TimeUS,msg_type,d2,d3,d4" } + "SBPH", "QIII", "TimeUS,CrcError,LastInject,IARhyp" }, \ + { LOG_MSG_SBPRAWH, sizeof(log_SbpRAWH), \ + "SBRH", "QQQQQQQQ", "TimeUS,msg_flag,1,2,3,4,5,6" }, \ + { LOG_MSG_SBPRAWM, sizeof(log_SbpRAWM), \ + "SBRM", "QQQQQQQQQQQQQQQ", "TimeUS,msg_flag,1,2,3,4,5,6,7,8,9,10,11,12,13" } // #endif #define LOG_COMMON_STRUCTURES LOG_BASE_STRUCTURES, LOG_EXTRA_STRUCTURES, LOG_SBP_STRUCTURES @@ -1241,8 +1249,8 @@ enum LogMessages { LOG_MSG_SBPBASELINE, LOG_MSG_SBPTRACKING1, LOG_MSG_SBPTRACKING2, - LOG_MSG_SBPRAW1, - LOG_MSG_SBPRAW2, + LOG_MSG_SBPRAWH, + LOG_MSG_SBPRAWM, LOG_MSG_SBPRAWx, LOG_TRIGGER_MSG,