AP_GPS: move SBP logging structures into AP_GPS

This commit is contained in:
Peter Barker 2021-09-25 15:21:43 +10:00 committed by Andrew Tridgell
parent 52c39bc382
commit da66ecf1f2
2 changed files with 84 additions and 2 deletions

View File

@ -1,6 +1,7 @@
#pragma once
#include <AP_Logger/LogStructure.h>
#include "LogStructure_SBP.h"
#define LOG_IDS_FROM_GPS \
LOG_GPS_MSG, \
@ -9,7 +10,8 @@
LOG_GPS_RAWH_MSG, \
LOG_GPS_RAWS_MSG, \
LOG_GPS_UBX1_MSG, \
LOG_GPS_UBX2_MSG
LOG_GPS_UBX2_MSG, \
LOG_IDS_FROM_GPS_SBP
// @LoggerMessage: GPS
@ -208,4 +210,5 @@ struct PACKED log_GPS_RAWS {
{ LOG_GPS_RAWH_MSG, sizeof(log_GPS_RAWH), \
"GRXH", "QdHbBB", "TimeUS,rcvTime,week,leapS,numMeas,recStat", "s-----", "F-----" , true }, \
{ LOG_GPS_RAWS_MSG, sizeof(log_GPS_RAWS), \
"GRXS", "QddfBBBHBBBBB", "TimeUS,prMes,cpMes,doMes,gnss,sv,freq,lock,cno,prD,cpD,doD,trk", "s------------", "F------------" , true },
"GRXS", "QddfBBBHBBBBB", "TimeUS,prMes,cpMes,doMes,gnss,sv,freq,lock,cno,prD,cpD,doD,trk", "s------------", "F------------" , true }, \
LOG_STRUCTURE_FROM_GPS_SBP,

View File

@ -0,0 +1,79 @@
#pragma once
#include <AP_Logger/LogStructure.h>
#define LOG_IDS_FROM_GPS_SBP \
LOG_MSG_SBPHEALTH, \
LOG_MSG_SBPRAWH, \
LOG_MSG_SBPRAWM, \
LOG_MSG_SBPEVENT
// @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
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;
};
// @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
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;
};
#define LOG_STRUCTURE_FROM_GPS_SBP \
{ 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?????" }