##// END OF EJS Templates
Initial commit
paul -
r0:bf6f7dffdada default
parent child
Show More
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
@@ -0,0 +1,199
1 #ifndef TC_TYPES_H
2 #define TC_TYPES_H
3
4 #include <ccsds_types.h>
5
6 #define PROTOCOLE_IDENTIFIER 0x02
7
8 // PACKET ID
9 #define TC_LFR_PACKET_ID 0x1ccc // PID 76 CAT 12
10
11 #define PACKET_LENGTH_TC_LFR_RESET (12 - CCSDS_TC_TM_PACKET_OFFSET)
12 #define PACKET_LENGTH_TC_LFR_LOAD_COMMON_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET)
13 #define PACKET_LENGTH_TC_LFR_LOAD_NORMAL_PAR (22 - CCSDS_TC_TM_PACKET_OFFSET)
14 #define PACKET_LENGTH_TC_LFR_LOAD_BURST_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET)
15 #define PACKET_LENGTH_TC_LFR_LOAD_SBM1_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET)
16 #define PACKET_LENGTH_TC_LFR_LOAD_SBM2_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET)
17 #define PACKET_LENGTH_TC_LFR_DUMP_PAR (12 - CCSDS_TC_TM_PACKET_OFFSET)
18 #define PACKET_LENGTH_TC_LFR_ENTER_MODE (20 - CCSDS_TC_TM_PACKET_OFFSET)
19 #define PACKET_LENGTH_TC_LFR_UPDATE_INFO (46 - CCSDS_TC_TM_PACKET_OFFSET)
20 #define PACKET_LENGTH_TC_LFR_ENABLE_CALIBRATION (12 - CCSDS_TC_TM_PACKET_OFFSET)
21 #define PACKET_LENGTH_TC_LFR_DISABLE_CALIBRATION (12 - CCSDS_TC_TM_PACKET_OFFSET)
22 #define PACKET_LENGTH_TC_LFR_UPDATE_TIME (18 - CCSDS_TC_TM_PACKET_OFFSET)
23
24 // TC TYPES
25 #define TC_TYPE_DEFAULT 181
26 #define TC_TYPE_LFR_UPDATE_TIME 9
27
28 // TC SUBTYPES
29 #define TC_SUBTYPE_RESET 1
30 #define TC_SUBTYPE_LOAD_COMMON_PAR 11
31 #define TC_SUBTYPE_LOAD_NORMAL_PAR 13
32 #define TC_SUBTYPE_LOAD_BURST_PAR 19
33 #define TC_SUBTYPE_LOAD_SBM1_PAR 25
34 #define TC_SUBTYPE_LOAD_SBM2_PAR 27
35 #define TC_SUBTYPE_DUMP_PAR 31
36 #define TC_SUBTYPE_ENTER_MODE 41
37 #define TC_SUBTYPE_UPDATE_INFO 51
38 #define TC_SUBTYPE_ENABLE_CALIBRATION 61
39 #define TC_SUBTYPE_DISABLE_CALIBRATION 63
40 #define TC_SUBTYPE_UPDATE_TIME 129
41
42 // OTHER CONSTANTS
43 #define TC_LFR_PACKET_SEQUENCE_CONTROL 0xc000 // PID 76 CAT 12
44 #define TC_LFR_DATA_FIELD_HEADER0 0x19
45 #define TC_LFR_LOAD_COMMON_PAR_SPARE 0x00
46
47 struct Packet_TC_LFR_RESET_str
48 { // the CCSDS header is added by LPPMON
49 unsigned char packetID[2];
50 unsigned char packetSequenceControl[2];
51 unsigned char packetLength[2];
52 // DATA FIELD HEADER
53 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
54 unsigned char serviceType;
55 unsigned char serviceSubType;
56 unsigned char sourceID;
57 unsigned char crc[2];
58 };
59 typedef struct Packet_TC_LFR_RESET_str Packet_TC_LFR_RESET_t;
60
61 struct Packet_TC_LFR_ENTER_MODE_str
62 { // the CCSDS header is added by LPPMON
63 unsigned char packetID[2];
64 unsigned char packetSequenceControl[2];
65 unsigned char packetLength[2];
66 // DATA FIELD HEADER
67 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
68 unsigned char serviceType;
69 unsigned char serviceSubType;
70 unsigned char sourceID;
71 unsigned char spare;
72 unsigned char mode;
73 unsigned char enterModeTime[6];
74 unsigned char crc[2];
75 };
76 typedef struct Packet_TC_LFR_ENTER_MODE_str Packet_TC_LFR_ENTER_MODE_t;
77
78 struct Packet_TC_LFR_UPDATE_INFO_str
79 { // the CCSDS header is added by LPPMON
80 unsigned char packetID[2];
81 unsigned char packetSequenceControl[2];
82 unsigned char packetLength[2];
83 // DATA FIELD HEADER
84 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
85 unsigned char serviceType;
86 unsigned char serviceSubType;
87 unsigned char sourceID;
88 unsigned char set1;
89 unsigned char set2;
90 unsigned char set3_bias_setting_set1[6];
91 unsigned char set3_bias_setting_set2[6];
92 unsigned char set3_bias_voltage[4];
93 unsigned char set4[8];
94 unsigned char set5;
95 unsigned char set6;
96 unsigned char set7[8];
97 unsigned char crc[2];
98 };
99 typedef struct Packet_TC_LFR_UPDATE_INFO_str Packet_TC_LFR_UPDATE_INFO_t;
100
101 struct Packet_TC_LFR_DUMP_PAR_str
102 { // the CCSDS header is added by LPPMON
103 unsigned char packetID[2];
104 unsigned char packetSequenceControl[2];
105 unsigned char packetLength[2];
106 // DATA FIELD HEADER
107 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
108 unsigned char serviceType;
109 unsigned char serviceSubType;
110 unsigned char sourceID;
111 unsigned char crc[2];
112
113 };
114 typedef struct Packet_TC_LFR_DUMP_PAR_str Packet_TC_LFR_DUMP_PAR_t;
115
116 struct Packet_TC_LFR_LOAD_COMMON_PAR_str
117 { // the CCSDS header is added by LPPMON
118 unsigned char packetID[2];
119 unsigned char packetSequenceControl[2];
120 unsigned char packetLength[2];
121 // DATA FIELD HEADER
122 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
123 unsigned char serviceType;
124 unsigned char serviceSubType;
125 unsigned char sourceID;
126 unsigned char spare;
127 unsigned char bw_sp0_sp1_r0_r1;
128 unsigned char crc[2];
129
130 };
131 typedef struct Packet_TC_LFR_LOAD_COMMON_PAR_str Packet_TC_LFR_LOAD_COMMON_PAR_t;
132
133 struct Packet_TC_LFR_LOAD_NORMAL_PAR_str
134 { // the CCSDS header is added by LPPMON
135 unsigned char packetID[2];
136 unsigned char packetSequenceControl[2];
137 unsigned char packetLength[2];
138 // DATA FIELD HEADER
139 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
140 unsigned char serviceType;
141 unsigned char serviceSubType;
142 unsigned char sourceID;
143 unsigned char sy_lfr_n_swf_l[2];
144 unsigned char sy_lfr_n_swf_p[2];
145 unsigned char sy_lfr_n_asm_p[2];
146 unsigned char sy_lfr_n_bp_p0;
147 unsigned char sy_lfr_n_bp_p1;
148 unsigned char sy_lfr_n_cwf_long_f3;
149 unsigned char lfr_normal_parameters_spare;
150 unsigned char crc[2];
151 };
152 typedef struct Packet_TC_LFR_LOAD_NORMAL_PAR_str Packet_TC_LFR_LOAD_NORMAL_PAR_t;
153
154 struct Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_str
155 { // the CCSDS header is added by LPPMON
156 unsigned char packetID[2];
157 unsigned char packetSequenceControl[2];
158 unsigned char packetLength[2];
159 // DATA FIELD HEADER
160 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
161 unsigned char serviceType;
162 unsigned char serviceSubType;
163 unsigned char sourceID;
164 unsigned char sy_lfr_bp_p0;
165 unsigned char sy_lfr_bp_p1;
166 unsigned char crc[2];
167 };
168 typedef struct Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_str Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_t;
169
170 struct Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_str
171 { // the CCSDS header is added by LPPMON
172 unsigned char packetID[2];
173 unsigned char packetSequenceControl[2];
174 unsigned char packetLength[2];
175 // DATA FIELD HEADER
176 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
177 unsigned char serviceType;
178 unsigned char serviceSubType;
179 unsigned char sourceID;
180 unsigned char crc[2];
181 };
182 typedef struct Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_str Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_t;
183
184 struct Packet_TC_LFR_UPDATE_TIME_str
185 { // the CCSDS header is added by LPPMON
186 unsigned char packetID[2];
187 unsigned char packetSequenceControl[2];
188 unsigned char packetLength[2];
189 // DATA FIELD HEADER
190 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
191 unsigned char serviceType;
192 unsigned char serviceSubType;
193 unsigned char sourceID;
194 unsigned char cp_rpw_time[6];
195 unsigned char crc[2];
196 };
197 typedef struct Packet_TC_LFR_UPDATE_TIME_str Packet_TC_LFR_UPDATE_TIME_t;
198
199 #endif // TC_TYPES_H
This diff has been collapsed as it changes many lines, (670 lines changed) Show them Hide them
@@ -0,0 +1,670
1 #ifndef CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
3
4 #include "fsw_params_processing.h"
5
6 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
7 #define CCSDS_TC_TM_PACKET_OFFSET 7
8 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
9 #define CCSDS_TM_PKT_MAX_SIZE 4412
10 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
11 #define CCSDS_TC_PKT_MAX_SIZE 256
12 #define CCSDS_TC_PKT_MIN_SIZE 16
13 #define CCSDS_PROCESS_ID 76
14 #define CCSDS_PACKET_CATEGORY 12
15 #define CCSDS_NODE_ADDRESS 0xfe
16 #define CCSDS_USER_APP 0x00
17
18 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
19 #define DEFAULT_RESERVED 0x00
20 #define DEFAULT_HKBIA 0x1e // 0001 1110
21
22 // PACKET ID
23 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
24 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
25 #define APID_TM_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9
26 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
27 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
28 #define TM_PACKET_PID_DEFAULT 76
29 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
30 #define TM_PACKET_CAT_TC_EXE 1
31 #define TM_PACKET_CAT_HK 4
32 #define TM_PACKET_CAT_PARAMETER_DUMP 9
33 #define TM_PACKET_CAT_SCIENCE 12
34 #define TC_PACKET_CAT 12
35
36 // PACKET SEQUENCE CONTROL
37 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
38 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
39 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
40 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
41 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
42
43 // DESTINATION ID
44 #define TM_DESTINATION_ID_GROUND 0
45 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
46 #define TM_DESTINATION_ID_TC_SEQUENCES 111
47 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
48 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
49 #define TM_DESTINATION_ID_DIRECT_CMD 120
50 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
51 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
52 #define TM_DESTINATION_ID_OBCP 15
53 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
54 #define TM_DESTINATION_ID_AOCS 11
55
56
57 #ifdef LPP_DPU_DESTID
58 #define CCSDS_DESTINATION_ID 32
59 #else
60 #define CCSDS_DESTINATION_ID 0x01
61 #endif
62 #define CCSDS_PROTOCOLE_ID 0x02
63 #define CCSDS_RESERVED 0x00
64 #define CCSDS_USER_APP 0x00
65
66 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
67 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
68 #define SIZE_HK_PARAMETERS 112
69
70 // TC TYPES
71 #define TC_TYPE_GEN 181
72 #define TC_TYPE_TIME 9
73
74 // TC SUBTYPES
75 #define TC_SUBTYPE_RESET 1
76 #define TC_SUBTYPE_LOAD_COMM 11
77 #define TC_SUBTYPE_LOAD_NORM 13
78 #define TC_SUBTYPE_LOAD_BURST 19
79 #define TC_SUBTYPE_LOAD_SBM1 25
80 #define TC_SUBTYPE_LOAD_SBM2 27
81 #define TC_SUBTYPE_DUMP 31
82 #define TC_SUBTYPE_ENTER 41
83 #define TC_SUBTYPE_UPDT_INFO 51
84 #define TC_SUBTYPE_EN_CAL 61
85 #define TC_SUBTYPE_DIS_CAL 63
86 #define TC_SUBTYPE_UPDT_TIME 129
87
88 // TC LEN
89 #define TC_LEN_RESET 12
90 #define TC_LEN_LOAD_COMM 14
91 #define TC_LEN_LOAD_NORM 22
92 #define TC_LEN_LOAD_BURST 14
93 #define TC_LEN_LOAD_SBM1 14
94 #define TC_LEN_LOAD_SBM2 14
95 #define TC_LEN_DUMP 12
96 #define TC_LEN_ENTER 20
97 #define TC_LEN_UPDT_INFO 46
98 #define TC_LEN_EN_CAL 12
99 #define TC_LEN_DIS_CAL 12
100 #define TC_LEN_UPDT_TIME 18
101
102 // TM TYPES
103 #define TM_TYPE_TC_EXE 1
104 #define TM_TYPE_HK 3
105 #define TM_TYPE_PARAMETER_DUMP 3
106 #define TM_TYPE_LFR_SCIENCE 21
107
108 // TM SUBTYPES
109 #define TM_SUBTYPE_EXE_OK 7
110 #define TM_SUBTYPE_EXE_NOK 8
111 #define TM_SUBTYPE_HK 25
112 #define TM_SUBTYPE_PARAMETER_DUMP 25
113 #define TM_SUBTYPE_SCIENCE 3
114 #define TM_SUBTYPE_LFR_SCIENCE 3
115
116 // FAILURE CODES
117 #define ILLEGAL_APID 0
118 #define WRONG_LEN_PKT 1
119 #define INCOR_CHECKSUM 2
120 #define ILL_TYPE 3
121 #define ILL_SUBTYPE 4
122 #define WRONG_APP_DATA 5 // 0x00 0x05
123 #define TC_NOT_EXE 42000 // 0xa4 0x10
124 #define WRONG_SRC_ID 42001 // 0xa4 0x11
125 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
126 #define FAIL_DETECTED 42003 // 0xa4 0x13
127 #define NOT_ALLOWED 42004 // 0xa4 0x14
128 #define CORRUPTED 42005 // 0xa4 0x15
129 #define CCSDS_TM_VALID 7
130
131 // TC SID
132 #define SID_TC_GROUND 0
133 #define SID_TC_MISSION_TIMELINE 110
134 #define SID_TC_TC_SEQUENCES 111
135 #define SID_TC_RECOVERY_ACTION_CMD 112
136 #define SID_TC_BACKUP_MISSION_TIMELINE 113
137 #define SID_TC_DIRECT_CMD 120
138 #define SID_TC_SPARE_GRD_SRC1 121
139 #define SID_TC_SPARE_GRD_SRC2 122
140 #define SID_TC_OBCP 15
141 #define SID_TC_SYSTEM_CONTROL 14
142 #define SID_TC_AOCS 11
143 #define SID_TC_RPW_INTERNAL 254
144
145 enum apid_destid{
146 GROUND,
147 MISSION_TIMELINE,
148 TC_SEQUENCES,
149 RECOVERY_ACTION_CMD,
150 BACKUP_MISSION_TIMELINE,
151 DIRECT_CMD,
152 SPARE_GRD_SRC1,
153 SPARE_GRD_SRC2,
154 OBCP,
155 SYSTEM_CONTROL,
156 AOCS,
157 RPW_INTERNAL
158 };
159 // SEQUENCE COUNTERS
160 #define SEQ_CNT_MAX 16383
161 #define SEQ_CNT_NB_DEST_ID 12
162
163 // TM SID
164 #define SID_HK 1
165 #define SID_PARAMETER_DUMP 10
166
167 #define SID_NORM_SWF_F0 3
168 #define SID_NORM_SWF_F1 4
169 #define SID_NORM_SWF_F2 5
170 #define SID_NORM_CWF_F3 1
171 #define SID_BURST_CWF_F2 2
172 #define SID_SBM1_CWF_F1 24
173 #define SID_SBM2_CWF_F2 25
174 #define SID_NORM_ASM_F0 11
175 #define SID_NORM_ASM_F1 12
176 #define SID_NORM_ASM_F2 13
177 #define SID_NORM_BP1_F0 14
178 #define SID_NORM_BP1_F1 15
179 #define SID_NORM_BP1_F2 16
180 #define SID_NORM_BP2_F0 19
181 #define SID_NORM_BP2_F1 20
182 #define SID_NORM_BP2_F2 21
183 #define SID_BURST_BP1_F0 17
184 #define SID_BURST_BP2_F0 22
185 #define SID_BURST_BP1_F1 18
186 #define SID_BURST_BP2_F1 23
187 #define SID_SBM1_BP1_F0 28
188 #define SID_SBM1_BP2_F0 31
189 #define SID_SBM2_BP1_F0 29
190 #define SID_SBM2_BP2_F0 32
191 #define SID_SBM2_BP1_F1 30
192 #define SID_SBM2_BP2_F1 33
193 #define SID_NORM_CWF_LONG_F3 34
194
195 // LENGTH (BYTES)
196 #define LENGTH_TM_LFR_TC_EXE_MAX 32
197 #define LENGTH_TM_LFR_HK 126
198
199 // HEADER_LENGTH
200 #define TM_HEADER_LEN 16
201 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
202 // PACKET_LENGTH
203 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
204 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
205 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
206 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
207 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
208 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
209 #define PACKET_LENGTH_HK (124 - CCSDS_TC_TM_PACKET_OFFSET)
210 #define PACKET_LENGTH_PARAMETER_DUMP (36 - CCSDS_TC_TM_PACKET_OFFSET)
211 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0 (2228 - CCSDS_TC_TM_PACKET_OFFSET) // 44 * 25 * 2 + 28
212 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1 (2628 - CCSDS_TC_TM_PACKET_OFFSET) // 52 * 25 * 2 + 28
213 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 (2428 - CCSDS_TC_TM_PACKET_OFFSET) // 48 * 25 * 2 + 28
214 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (126 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 9 + 27 (1 spare bit in the header)
215 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (356 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 26
216 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (144 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 9 + 27 (1 spare bit in the header)
217 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (416 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 26
218 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (134 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 9 + 26
219 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (386 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 26
220 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (224 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 9 + 26
221 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (686 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 26
222 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (260 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 9 + 26
223 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (806 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 26
224
225 #define PACKET_LENGTH_DELTA 11 // 7 + 4
226
227 #define SPARE1_PUSVERSION_SPARE2 0x10
228
229 // R1
230 #define TM_LEN_SCI_SWF_340 4101 // 340 * 12 + 10 + 12 - 1
231 #define TM_LEN_SCI_SWF_8 117 // 8 * 12 + 10 + 12 - 1
232 #define TM_LEN_SCI_CWF_340 4099 // 340 * 12 + 10 + 10 - 1
233 #define TM_LEN_SCI_CWF_8 115 // 8 * 12 + 10 + 10 - 1
234 #define TM_LEN_SCI_CWF3_LIGHT_340 2059 // 340 * 6 + 10 + 10 - 1
235 #define TM_LEN_SCI_CWF3_LIGHT_8 67 // 8 * 6 + 10 + 10 - 1
236 // R2
237 #define TM_LEN_SCI_SWF_304 3669 // 304 * 12 + 10 + 12 - 1
238 #define TM_LEN_SCI_SWF_224 2709 // 224 * 12 + 10 + 12 - 1
239 #define TM_LEN_SCI_CWF_336 4051 // 336 * 12 + 10 + 10 - 1
240 #define TM_LEN_SCI_CWF_672 4051 // 672 * 6 + 10 + 10 - 1
241 //
242 #define DEFAULT_PKTCNT 0x07
243 #define BLK_NR_304 0x0130
244 #define BLK_NR_224 0x00e0
245 #define BLK_NR_CWF 0x0150 // 336
246 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
247
248 enum TM_TYPE{
249 TM_LFR_TC_EXE_OK,
250 TM_LFR_TC_EXE_ERR,
251 TM_LFR_HK,
252 TM_LFR_SCI,
253 TM_LFR_SCI_SBM,
254 TM_LFR_PAR_DUMP
255 };
256
257 typedef struct {
258 unsigned char targetLogicalAddress;
259 unsigned char protocolIdentifier;
260 unsigned char reserved;
261 unsigned char userApplication;
262 // PACKET HEADER
263 unsigned char packetID[2];
264 unsigned char packetSequenceControl[2];
265 unsigned char packetLength[2];
266 // DATA FIELD HEADER
267 unsigned char spare1_pusVersion_spare2;
268 unsigned char serviceType;
269 unsigned char serviceSubType;
270 unsigned char destinationID;
271 unsigned char time[6];
272 //
273 unsigned char telecommand_pkt_id[2];
274 unsigned char pkt_seq_control[2];
275 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
276
277 typedef struct {
278 unsigned char targetLogicalAddress;
279 unsigned char protocolIdentifier;
280 unsigned char reserved;
281 unsigned char userApplication;
282 // PACKET HEADER
283 unsigned char packetID[2];
284 unsigned char packetSequenceControl[2];
285 unsigned char packetLength[2];
286 // DATA FIELD HEADER
287 unsigned char spare1_pusVersion_spare2;
288 unsigned char serviceType;
289 unsigned char serviceSubType;
290 unsigned char destinationID;
291 unsigned char time[6];
292 //
293 unsigned char tc_failure_code[2];
294 unsigned char telecommand_pkt_id[2];
295 unsigned char pkt_seq_control[2];
296 unsigned char tc_service;
297 unsigned char tc_subtype;
298 unsigned char byte_position;
299 unsigned char rcv_value;
300 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
301
302 typedef struct {
303 unsigned char targetLogicalAddress;
304 unsigned char protocolIdentifier;
305 unsigned char reserved;
306 unsigned char userApplication;
307 // PACKET HEADER
308 unsigned char packetID[2];
309 unsigned char packetSequenceControl[2];
310 unsigned char packetLength[2];
311 // DATA FIELD HEADER
312 unsigned char spare1_pusVersion_spare2;
313 unsigned char serviceType;
314 unsigned char serviceSubType;
315 unsigned char destinationID;
316 unsigned char time[6];
317 //
318 unsigned char tc_failure_code[2];
319 unsigned char telecommand_pkt_id[2];
320 unsigned char pkt_seq_control[2];
321 unsigned char tc_service;
322 unsigned char tc_subtype;
323 unsigned char lfr_status_word[2];
324 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
325
326 typedef struct {
327 unsigned char targetLogicalAddress;
328 unsigned char protocolIdentifier;
329 unsigned char reserved;
330 unsigned char userApplication;
331 // PACKET HEADER
332 unsigned char packetID[2];
333 unsigned char packetSequenceControl[2];
334 unsigned char packetLength[2];
335 // DATA FIELD HEADER
336 unsigned char spare1_pusVersion_spare2;
337 unsigned char serviceType;
338 unsigned char serviceSubType;
339 unsigned char destinationID;
340 unsigned char time[6];
341 //
342 unsigned char tc_failure_code[2];
343 unsigned char telecommand_pkt_id[2];
344 unsigned char pkt_seq_control[2];
345 unsigned char tc_service;
346 unsigned char tc_subtype;
347 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
348
349 typedef struct {
350 unsigned char targetLogicalAddress;
351 unsigned char protocolIdentifier;
352 unsigned char reserved;
353 unsigned char userApplication;
354 // PACKET HEADER
355 unsigned char packetID[2];
356 unsigned char packetSequenceControl[2];
357 unsigned char packetLength[2];
358 // DATA FIELD HEADER
359 unsigned char spare1_pusVersion_spare2;
360 unsigned char serviceType;
361 unsigned char serviceSubType;
362 unsigned char destinationID;
363 unsigned char time[6];
364 //
365 unsigned char tc_failure_code[2];
366 unsigned char telecommand_pkt_id[2];
367 unsigned char pkt_seq_control[2];
368 unsigned char tc_service;
369 unsigned char tc_subtype;
370 } Packet_TM_LFR_TC_EXE_ERROR_t;
371
372 typedef struct {
373 unsigned char targetLogicalAddress;
374 unsigned char protocolIdentifier;
375 unsigned char reserved;
376 unsigned char userApplication;
377 // PACKET HEADER
378 unsigned char packetID[2];
379 unsigned char packetSequenceControl[2];
380 unsigned char packetLength[2];
381 // DATA FIELD HEADER
382 unsigned char spare1_pusVersion_spare2;
383 unsigned char serviceType;
384 unsigned char serviceSubType;
385 unsigned char destinationID;
386 unsigned char time[6];
387 //
388 unsigned char tc_failure_code[2];
389 unsigned char telecommand_pkt_id[2];
390 unsigned char pkt_seq_control[2];
391 unsigned char tc_service;
392 unsigned char tc_subtype;
393 unsigned char pkt_len_rcv_value[2];
394 unsigned char pkt_datafieldsize_cnt[2];
395 unsigned char rcv_crc[2];
396 unsigned char computed_crc[2];
397 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
398
399 typedef struct {
400 unsigned char targetLogicalAddress;
401 unsigned char protocolIdentifier;
402 unsigned char reserved;
403 unsigned char userApplication;
404 unsigned char packetID[2];
405 unsigned char packetSequenceControl[2];
406 unsigned char packetLength[2];
407 // DATA FIELD HEADER
408 unsigned char spare1_pusVersion_spare2;
409 unsigned char serviceType;
410 unsigned char serviceSubType;
411 unsigned char destinationID;
412 unsigned char time[6];
413 // AUXILIARY HEADER
414 unsigned char sid;
415 unsigned char hkBIA;
416 unsigned char pktCnt;
417 unsigned char pktNr;
418 unsigned char acquisitionTime[6];
419 unsigned char blkNr[2];
420 } Header_TM_LFR_SCIENCE_SWF_t;
421
422 typedef struct {
423 unsigned char targetLogicalAddress;
424 unsigned char protocolIdentifier;
425 unsigned char reserved;
426 unsigned char userApplication;
427 unsigned char packetID[2];
428 unsigned char packetSequenceControl[2];
429 unsigned char packetLength[2];
430 // DATA FIELD HEADER
431 unsigned char spare1_pusVersion_spare2;
432 unsigned char serviceType;
433 unsigned char serviceSubType;
434 unsigned char destinationID;
435 unsigned char time[6];
436 // AUXILIARY DATA HEADER
437 unsigned char sid;
438 unsigned char hkBIA;
439 unsigned char acquisitionTime[6];
440 unsigned char blkNr[2];
441 } Header_TM_LFR_SCIENCE_CWF_t;
442
443 typedef struct {
444 unsigned char targetLogicalAddress;
445 unsigned char protocolIdentifier;
446 unsigned char reserved;
447 unsigned char userApplication;
448 unsigned char packetID[2];
449 unsigned char packetSequenceControl[2];
450 unsigned char packetLength[2];
451 // DATA FIELD HEADER
452 unsigned char spare1_pusVersion_spare2;
453 unsigned char serviceType;
454 unsigned char serviceSubType;
455 unsigned char destinationID;
456 unsigned char time[6];
457 // AUXILIARY HEADER
458 unsigned char sid;
459 unsigned char biaStatusInfo;
460 unsigned char pa_lfr_pkt_cnt_asm;
461 unsigned char pa_lfr_pkt_nr_asm;
462 unsigned char acquisitionTime[6];
463 unsigned char pa_lfr_asm_blk_nr[2];
464 } Header_TM_LFR_SCIENCE_ASM_t;
465
466 typedef struct {
467 unsigned char targetLogicalAddress;
468 unsigned char protocolIdentifier;
469 unsigned char reserved;
470 unsigned char userApplication;
471 unsigned char packetID[2];
472 unsigned char packetSequenceControl[2];
473 unsigned char packetLength[2];
474 // DATA FIELD HEADER
475 unsigned char spare1_pusVersion_spare2;
476 unsigned char serviceType;
477 unsigned char serviceSubType;
478 unsigned char destinationID;
479 unsigned char time[6];
480 // AUXILIARY HEADER
481 unsigned char sid;
482 unsigned char biaStatusInfo;
483 unsigned char acquisitionTime[6];
484 unsigned char source_data_spare;
485 unsigned char pa_lfr_bp_blk_nr[2];
486 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
487
488 typedef struct {
489 unsigned char targetLogicalAddress;
490 unsigned char protocolIdentifier;
491 unsigned char reserved;
492 unsigned char userApplication;
493 unsigned char packetID[2];
494 unsigned char packetSequenceControl[2];
495 unsigned char packetLength[2];
496 // DATA FIELD HEADER
497 unsigned char spare1_pusVersion_spare2;
498 unsigned char serviceType;
499 unsigned char serviceSubType;
500 unsigned char destinationID;
501 unsigned char time[6];
502 // AUXILIARY HEADER
503 unsigned char sid;
504 unsigned char biaStatusInfo;
505 unsigned char acquisitionTime[6];
506 unsigned char pa_lfr_bp_blk_nr[2];
507 } Header_TM_LFR_SCIENCE_BP_t;
508
509 typedef struct {
510 //targetLogicalAddress is removed by the grspw module
511 unsigned char protocolIdentifier;
512 unsigned char reserved;
513 unsigned char userApplication;
514 unsigned char packetID[2];
515 unsigned char packetSequenceControl[2];
516 unsigned char packetLength[2];
517 // DATA FIELD HEADER
518 unsigned char headerFlag_pusVersion_Ack;
519 unsigned char serviceType;
520 unsigned char serviceSubType;
521 unsigned char sourceID;
522 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
523 } ccsdsTelecommandPacket_t;
524
525 typedef struct {
526 unsigned char targetLogicalAddress;
527 unsigned char protocolIdentifier;
528 unsigned char reserved;
529 unsigned char userApplication;
530 unsigned char packetID[2];
531 unsigned char packetSequenceControl[2];
532 unsigned char packetLength[2];
533 unsigned char spare1_pusVersion_spare2;
534 unsigned char serviceType;
535 unsigned char serviceSubType;
536 unsigned char destinationID;
537 unsigned char time[6];
538 unsigned char sid;
539
540 //**************
541 // HK PARAMETERS
542 unsigned char lfr_status_word[2];
543 unsigned char lfr_sw_version[4];
544 unsigned char lfr_fpga_version[3];
545 // ressource statistics
546 unsigned char hk_lfr_cpu_load;
547 unsigned char hk_lfr_cpu_load_max;
548 unsigned char hk_lfr_cpu_load_aver;
549 // tc statistics
550 unsigned char hk_lfr_update_info_tc_cnt[2];
551 unsigned char hk_lfr_update_time_tc_cnt[2];
552 unsigned char hk_lfr_exe_tc_cnt[2];
553 unsigned char hk_lfr_rej_tc_cnt[2];
554 unsigned char hk_lfr_last_exe_tc_id[2];
555 unsigned char hk_lfr_last_exe_tc_type[2];
556 unsigned char hk_lfr_last_exe_tc_subtype[2];
557 unsigned char hk_lfr_last_exe_tc_time[6];
558 unsigned char hk_lfr_last_rej_tc_id[2];
559 unsigned char hk_lfr_last_rej_tc_type[2];
560 unsigned char hk_lfr_last_rej_tc_subtype[2];
561 unsigned char hk_lfr_last_rej_tc_time[6];
562 // anomaly statistics
563 unsigned char hk_lfr_le_cnt[2];
564 unsigned char hk_lfr_me_cnt[2];
565 unsigned char hk_lfr_he_cnt[2];
566 unsigned char hk_lfr_last_er_rid[2];
567 unsigned char hk_lfr_last_er_code;
568 unsigned char hk_lfr_last_er_time[6];
569 // vhdl_blk_status
570 unsigned char hk_lfr_vhdl_aa_sm;
571 unsigned char hk_lfr_vhdl_fft_sr;
572 unsigned char hk_lfr_vhdl_cic_hk;
573 unsigned char hk_lfr_vhdl_iir_cal;
574 // spacewire_if_statistics
575 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
576 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
577 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
578 unsigned char hk_lfr_dpu_spw_last_timc;
579 // ahb error statistics
580 unsigned char hk_lfr_last_fail_addr[4];
581 // temperatures
582 unsigned char hk_lfr_temp_scm[2];
583 unsigned char hk_lfr_temp_pcb[2];
584 unsigned char hk_lfr_temp_fpga[2];
585 // spacecraft potential
586 unsigned char hk_lfr_sc_v_f3[2];
587 unsigned char hk_lfr_sc_e1_f3[2];
588 unsigned char hk_lfr_sc_e2_f3[2];
589 // error counters
590 unsigned char hk_lfr_dpu_spw_parity;
591 unsigned char hk_lfr_dpu_spw_disconnect;
592 unsigned char hk_lfr_dpu_spw_escape;
593 unsigned char hk_lfr_dpu_spw_credit;