*packed log structs

This commit is contained in:
Gatsby Van
2024-02-01 14:54:13 +08:00
parent 0248c185e4
commit 4457eb8bc1
+19 -24
View File
@@ -34,7 +34,7 @@
#define TEMPERATURE_MAX 127.0 // Celsius degree
#define TEMPERATURE_MIN -128.0 // Celsius degree
typedef struct
typedef struct __attribute__((packed))
{
// -- unit: ms, 0~604799999
uint32_t psBDS;
@@ -73,13 +73,7 @@ typedef struct
float roll;
} SYSINFO;
typedef struct
{
uint32_t dataId;
uint8_t data[PAYLOAD_LEN_MAX];
} PAYLOAD;
typedef struct
typedef struct __attribute__((packed))
{
// Network log
uint32_t tuNum;
@@ -105,7 +99,7 @@ typedef struct
uint32_t recvId;
} LINKLOG;
typedef struct
typedef struct __attribute__((packed))
{
uint32_t acqCnt;
uint32_t fsyncCnt;
@@ -124,9 +118,11 @@ typedef struct
uint16_t reserve;
} PHYLOG;
typedef struct
typedef struct __attribute__((packed))
{
// Hardware log
// Hardware status
bool isSpOk;
bool isAntOk;
// -- Signal processor status
uint8_t spPsVolt;
uint8_t spPsAuxVolt;
@@ -135,14 +131,13 @@ typedef struct
uint8_t spPlAuxVolt;
uint8_t spBramVolt;
int8_t spTemp;
bool isSpOk;
// -- Antenna status
uint8_t antVolt;
uint8_t antTemp;
uint8_t antPll;
uint8_t antMgc0;
uint8_t antMgc1;
bool isAntOk;
uint8_t dummy;
} HWSTATE;
typedef struct
@@ -154,21 +149,25 @@ typedef struct
PHYLOG phyLog;
// Hardware status
HWSTATE hwSate;
HWSTATE hwState;
} SYSLOG;
typedef struct
{
uint32_t dataId;
uint8_t data[PAYLOAD_LEN_MAX];
} PAYLOAD;
int32_t SysMonitor_Init(void);
void SysMonitor_Destroy(void);
void SysMonitor_UpdateSysinfo(const SYSINFO *info);
void SysMonitor_UpdateSysinfoRaw(const uint8_t *buff);
void SysMonitor_GetSysinfo(SYSINFO *info);
void SysMonitor_GetSysinfoRaw(uint8_t *buff);
void SysMonitor_UpdateSendPayloadRaw(const uint8_t *buff, size_t len);
void SysMonitor_UpdateRecvPayloadRaw(const uint8_t *buff, size_t len);
void SysMonitor_GetSendPayloadRaw(uint8_t *buff, uint32_t *id, size_t len);
void SysMonitor_GetRecvPayloadRaw(uint8_t *buff, uint32_t *id, size_t len);
void SysMonitor_UpdateSendPayload(const uint8_t *buff, size_t len);
void SysMonitor_UpdateRecvPayload(const uint8_t *buff, size_t len);
void SysMonitor_GetSendPayload(uint8_t *buff, uint32_t *id, size_t len);
void SysMonitor_GetRecvPayload(uint8_t *buff, uint32_t *id, size_t len);
void SysMonitor_UpdateLinklayerLog(const LINKLOG *log);
void SysMonitor_UpdatePhysicalLayerLog(const PHYLOG *log);
@@ -176,11 +175,7 @@ void SysMonitor_UpdateHardwareStatus(const HWSTATE *state);
void SysMonitor_GetLinklayerLog(LINKLOG *log);
void SysMonitor_GetPhysicalLayerLog(PHYLOG *log);
void SysMonitor_GetHardwareStatus(HWSTATE *state);
void SysMonitor_GetLinklayerLogRaw(uint8_t *buff);
void SysMonitor_GetPhysicalLayerLogRaw(uint8_t *buff);
void SysMonitor_GetHardwareStatusRaw(uint8_t *buff);
void SysMonitor_GetSyslog(SYSLOG *log);
void SysMonitor_GetSyslogRaw(uint8_t *buff);
#endif //__SYSTEM_MONITOR_H_