CCSDS
tmtc_control_cwrapper.h
Go to the documentation of this file.
1
12#ifndef _TMTC_CONTROL_CWRAPPER_H_
13#define _TMTC_CONTROL_CWRAPPER_H_
14
15
16#include "configCCSDS.h"
17
18#include <stdint.h>
19#include <stdbool.h>
20
21
22typedef enum { TM = 0, TC = 1 } ESpPacketType;
23
24typedef enum { ContinuationSegment = 0x0, FirstSegment = 0x1, LastSegment = 0x2, Unsegmented = 0x3 } ESpSequenceFlags;
25
26
27typedef void (TTfTcCallback)(void *p_Context, const uint8_t *pu8_Data, const uint16_t u16_DataSize);
28
29typedef void (TTfTmOcfCallback)(const uint8_t u8_VirtualChannelID, void *p_Context, const uint32_t u32_Ocf);
30
31typedef void (TSpCallback)(void *p_SpContext, const uint8_t u8_PacketType,
32 const uint8_t u8_SequenceFlags, const uint16_t u16_APID,
33 const uint16_t u16_SequenceCount, const bool b_SecHeader,
34 const uint8_t *pu8_PacketData, const uint16_t u16_PacketDataLength);
35
36
37#ifdef __cplusplus
38extern "C"
39{
40#endif
41
42
43void tmtc_control_init(const uint16_t *pu16_SCIDs, const uint8_t u8_NumberOfSCIDs,
44 void *p_TfTcContext, TTfTcCallback *p_TfTcCallback,
45 void *p_VC0SpContext, TSpCallback *p_VC0SpCallback);
46
47
48void tmtc_control_set_tm_callback(const uint8_t u8_VirtualChannelID,
49 void *p_SpContext, TSpCallback *p_SpCallback);
50
51void tmtc_control_set_tm_ocf_callback(const uint8_t u8_VirtualChannelID, void *p_TfTmOcfContext, TTfTmOcfCallback *p_TfTmOcfCallback);
52
53uint16_t tmtc_control_get_tm_scid_error_count(void);
54
55uint16_t tmtc_control_get_tm_vcfc_error_count(void);
56
57uint16_t tmtc_control_get_tm_mcfc_error_count(void);
58
59uint16_t tmtc_control_get_tm_sync_error_count(void);
60
61uint16_t tmtc_control_get_tm_checksum_error_count(void);
62
63uint16_t tmtc_control_get_tm_overflow_error_count(void);
64
65void tmtc_control_clear_error_counters(void);
66
67
68
69
70void tmtc_control_process_tf_tm(const uint8_t *pu8_Data, const uint16_t u16_DataSize);
71
72
73void tmtc_control_set_tf_tm_callback(void *p_Context, const uint16_t u16_SpacecraftID, const uint8_t u8_VirtualChannelID,
74 const uint8_t u8_MasterChannelFrameCount, const uint8_t u8_VirtualChannelFrameCount,
75 const bool b_TFSecHdrFlag, const uint16_t u16_FirstHdrPtr,
76 const uint8_t *pu8_Data, const uint16_t u16_DataSize,
77 const uint32_t u32_OCF);
78
79
80
81
82
83int32_t tmtc_control_send_tc(const uint8_t u8_VirtualChannelID, const bool b_BypassFlag, const uint16_t u16_APID, const uint16_t u16_ApidSeqNr,
84 const uint8_t *pu8_Data, const uint16_t u16_DataSize);
85
86
87
88
89int32_t tmtc_control_send_init_ad(const uint8_t u8_VirtualChannelID);
90
91
92#ifdef __cplusplus
93} // extern "C"
94#endif
95
96
97#endif /* _TMTC_CONTROL_CWRAPPER_H_ */