first commit, new repo branches from datalink_repo
This commit is contained in:
@@ -0,0 +1,160 @@
|
||||
#ifndef __SYSTEM_MONITOR_H_
|
||||
#define __SYSTEM_MONITOR_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define PAYLOAD_FLJ 78
|
||||
#define PAYLOAD_LJ 168
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// FIXME: To Complete
|
||||
} SYSCONFIG;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// -- unit: ms, 0~604799999
|
||||
uint32_t psBDS;
|
||||
// -- unit: week, 0~0~8191
|
||||
uint16_t pBDS;
|
||||
// -- unit: ms, 0~604799999
|
||||
uint32_t psGPS;
|
||||
// -- unit: week, 0~0~8191
|
||||
uint16_t pGPS;
|
||||
// Time validation indicator
|
||||
// -- [0] GPS
|
||||
// -- [1] reserve.
|
||||
// -- [2] UTC
|
||||
// -- [3] BDS
|
||||
uint8_t tmInd;
|
||||
// Time of flying
|
||||
// uint: s
|
||||
float tmFly;
|
||||
// Status of flying
|
||||
// [7:6] departure status 11 - departed/00 - not departed
|
||||
// [5:4] ready status 11 - ready/00 - not ready
|
||||
// [3:2] attitude status 11 - attitude ok/00 - attitude not ok
|
||||
// [1:0] attitude adjust status 11 - adjusted/00 - not adjusted
|
||||
uint8_t stFly;
|
||||
// Position in launch coordinate system
|
||||
float posX;
|
||||
float posY;
|
||||
float posZ;
|
||||
// Speed in launch coordinate system
|
||||
float vX;
|
||||
float vY;
|
||||
float vZ;
|
||||
// Attitude in launch inertia coordinate system
|
||||
float pitch;
|
||||
float yaw;
|
||||
float roll;
|
||||
} SYSINFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t data_lj[PAYLOAD_LJ];
|
||||
uint8_t data_flj[PAYLOAD_FLJ];
|
||||
} PAYLOAD;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// Network log
|
||||
uint32_t tuNo;
|
||||
uint8_t slotNo;
|
||||
uint8_t frameType;
|
||||
uint8_t srcId;
|
||||
uint8_t dstId;
|
||||
uint8_t baseInfo[18];
|
||||
// Payload
|
||||
uint8_t payload[46];
|
||||
// Time sync info
|
||||
uint64_t tmStamp;
|
||||
uint32_t tmDevi;
|
||||
uint32_t freqDevi;
|
||||
} SLOTLOG;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// Protocol log
|
||||
// -- System time
|
||||
uint32_t tmSys;
|
||||
// -- Physical layer status
|
||||
uint8_t phySt;
|
||||
// -- Link layer status
|
||||
uint32_t tmLocal;
|
||||
uint16_t beamNo;
|
||||
uint8_t beamWidth;
|
||||
// -- Network layer status
|
||||
uint8_t stage;
|
||||
uint32_t recvCnt;
|
||||
uint32_t recvFineCnt;
|
||||
uint8_t nodeCnt;
|
||||
uint8_t myId;
|
||||
uint8_t dstId;
|
||||
} PRTCLLOG;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// Hardware log
|
||||
// -- Signal processor status
|
||||
uint16_t spVolt;
|
||||
uint16_t spTemp;
|
||||
uint16_t chipSt;
|
||||
// -- Antenna status
|
||||
uint8_t antVolt;
|
||||
uint8_t antTemp;
|
||||
uint8_t antPll;
|
||||
uint16_t antMgc;
|
||||
uint8_t antSt;
|
||||
} HWSTATE;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// Send slot log
|
||||
SLOTLOG sendLog;
|
||||
|
||||
// Receive slot log
|
||||
SLOTLOG recvLog;
|
||||
|
||||
// Protocol log
|
||||
PRTCLLOG protocolLog;
|
||||
|
||||
// Hardware status
|
||||
HWSTATE hwSate;
|
||||
} SYSLOG;
|
||||
|
||||
int32_t SysMonitor_Init(void);
|
||||
|
||||
void SysMonitor_UpdateSysinfo(SYSINFO *info);
|
||||
void SysMonitor_UpdateSysinfoRaw(uint8_t *buff);
|
||||
void SysMonitor_GetSysinfo(SYSINFO *info);
|
||||
void SysMonitor_GetSysinfoRaw(uint8_t *buff);
|
||||
|
||||
void SysMonitor_UpdateSendPayloadFLJRaw(uint8_t *buff);
|
||||
void SysMonitor_UpdateRecvPayloadFLJRaw(uint8_t *buff);
|
||||
void SysMonitor_UpdateSendPayloadLJRaw(uint8_t *buff);
|
||||
void SysMonitor_UpdateRecvPayloadLJRaw(uint8_t *buff);
|
||||
void SysMonitor_GetSendPayloadFLJRaw(uint8_t *buff);
|
||||
void SysMonitor_GetRecvPayloadFLJRaw(uint8_t *buff);
|
||||
void SysMonitor_GetSendPayloadLJRaw(uint8_t *buff);
|
||||
void SysMonitor_GetRecvPayloadLJRaw(uint8_t *buff);
|
||||
|
||||
void SysMonitor_UpdateSendSlotLog(SLOTLOG *log);
|
||||
void SysMonitor_UpdateRecvSlotLog(SLOTLOG *log);
|
||||
void SysMonitor_UpdateProtocolLog(PRTCLLOG *log);
|
||||
void SysMonitor_GetSendSlotLog(SLOTLOG *log);
|
||||
void SysMonitor_GetRecvSlotLog(SLOTLOG *log);
|
||||
void SysMonitor_GetProtocolLog(PRTCLLOG *log);
|
||||
void SysMonitor_GetSendSlotLogRaw(uint8_t *buff);
|
||||
void SysMonitor_GetRecvSlotLogRaw(uint8_t *buff);
|
||||
void SysMonitor_GetProtocolLogRaw(uint8_t *buff);
|
||||
|
||||
void SysMonitor_UpdateHardwareStatus(HWSTATE *state);
|
||||
void SysMonitor_GetHardwareStatus(HWSTATE *state);
|
||||
void SysMonitor_GetHardwareStatusRaw(uint8_t *buff);
|
||||
|
||||
void SysMonitor_GetSyslog(SYSLOG *log);
|
||||
void SysMonitor_GetSyslogRaw(uint8_t *buff);
|
||||
|
||||
#endif //__SYSTEM_MONITOR_H_
|
||||
Reference in New Issue
Block a user