##// END OF EJS Templates
Sync
paul -
r1:fd2d3c41c953 default
parent child
Show More
@@ -1,670 +1,668
1 #ifndef CCSDS_TYPES_H_INCLUDED
1 #ifndef CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
3
3
4 #include "fsw_params_processing.h"
5
6 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
4 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
7 #define CCSDS_TC_TM_PACKET_OFFSET 7
5 #define CCSDS_TC_TM_PACKET_OFFSET 7
8 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
6 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
9 #define CCSDS_TM_PKT_MAX_SIZE 4412
7 #define CCSDS_TM_PKT_MAX_SIZE 4412
10 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
8 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
11 #define CCSDS_TC_PKT_MAX_SIZE 256
9 #define CCSDS_TC_PKT_MAX_SIZE 256
12 #define CCSDS_TC_PKT_MIN_SIZE 16
10 #define CCSDS_TC_PKT_MIN_SIZE 16
13 #define CCSDS_PROCESS_ID 76
11 #define CCSDS_PROCESS_ID 76
14 #define CCSDS_PACKET_CATEGORY 12
12 #define CCSDS_PACKET_CATEGORY 12
15 #define CCSDS_NODE_ADDRESS 0xfe
13 #define CCSDS_NODE_ADDRESS 0xfe
16 #define CCSDS_USER_APP 0x00
14 #define CCSDS_USER_APP 0x00
17
15
18 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
16 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
19 #define DEFAULT_RESERVED 0x00
17 #define DEFAULT_RESERVED 0x00
20 #define DEFAULT_HKBIA 0x1e // 0001 1110
18 #define DEFAULT_HKBIA 0x1e // 0001 1110
21
19
22 // PACKET ID
20 // PACKET ID
23 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
21 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
24 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
22 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
25 #define APID_TM_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9
23 #define APID_TM_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9
26 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
24 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
27 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
25 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
28 #define TM_PACKET_PID_DEFAULT 76
26 #define TM_PACKET_PID_DEFAULT 76
29 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
27 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
30 #define TM_PACKET_CAT_TC_EXE 1
28 #define TM_PACKET_CAT_TC_EXE 1
31 #define TM_PACKET_CAT_HK 4
29 #define TM_PACKET_CAT_HK 4
32 #define TM_PACKET_CAT_PARAMETER_DUMP 9
30 #define TM_PACKET_CAT_PARAMETER_DUMP 9
33 #define TM_PACKET_CAT_SCIENCE 12
31 #define TM_PACKET_CAT_SCIENCE 12
34 #define TC_PACKET_CAT 12
32 #define TC_PACKET_CAT 12
35
33
36 // PACKET SEQUENCE CONTROL
34 // PACKET SEQUENCE CONTROL
37 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
35 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
38 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
36 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
39 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
37 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
40 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
38 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
41 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
39 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
42
40
43 // DESTINATION ID
41 // DESTINATION ID
44 #define TM_DESTINATION_ID_GROUND 0
42 #define TM_DESTINATION_ID_GROUND 0
45 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
43 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
46 #define TM_DESTINATION_ID_TC_SEQUENCES 111
44 #define TM_DESTINATION_ID_TC_SEQUENCES 111
47 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
45 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
48 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
46 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
49 #define TM_DESTINATION_ID_DIRECT_CMD 120
47 #define TM_DESTINATION_ID_DIRECT_CMD 120
50 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
48 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
51 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
49 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
52 #define TM_DESTINATION_ID_OBCP 15
50 #define TM_DESTINATION_ID_OBCP 15
53 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
51 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
54 #define TM_DESTINATION_ID_AOCS 11
52 #define TM_DESTINATION_ID_AOCS 11
55
53
56
54
57 #ifdef LPP_DPU_DESTID
55 #ifdef LPP_DPU_DESTID
58 #define CCSDS_DESTINATION_ID 32
56 #define CCSDS_DESTINATION_ID 32
59 #else
57 #else
60 #define CCSDS_DESTINATION_ID 0x01
58 #define CCSDS_DESTINATION_ID 0x01
61 #endif
59 #endif
62 #define CCSDS_PROTOCOLE_ID 0x02
60 #define CCSDS_PROTOCOLE_ID 0x02
63 #define CCSDS_RESERVED 0x00
61 #define CCSDS_RESERVED 0x00
64 #define CCSDS_USER_APP 0x00
62 #define CCSDS_USER_APP 0x00
65
63
66 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
64 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
67 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
65 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
68 #define SIZE_HK_PARAMETERS 112
66 #define SIZE_HK_PARAMETERS 112
69
67
70 // TC TYPES
68 // TC TYPES
71 #define TC_TYPE_GEN 181
69 #define TC_TYPE_GEN 181
72 #define TC_TYPE_TIME 9
70 #define TC_TYPE_TIME 9
73
71
74 // TC SUBTYPES
72 // TC SUBTYPES
75 #define TC_SUBTYPE_RESET 1
73 #define TC_SUBTYPE_RESET 1
76 #define TC_SUBTYPE_LOAD_COMM 11
74 #define TC_SUBTYPE_LOAD_COMM 11
77 #define TC_SUBTYPE_LOAD_NORM 13
75 #define TC_SUBTYPE_LOAD_NORM 13
78 #define TC_SUBTYPE_LOAD_BURST 19
76 #define TC_SUBTYPE_LOAD_BURST 19
79 #define TC_SUBTYPE_LOAD_SBM1 25
77 #define TC_SUBTYPE_LOAD_SBM1 25
80 #define TC_SUBTYPE_LOAD_SBM2 27
78 #define TC_SUBTYPE_LOAD_SBM2 27
81 #define TC_SUBTYPE_DUMP 31
79 #define TC_SUBTYPE_DUMP 31
82 #define TC_SUBTYPE_ENTER 41
80 #define TC_SUBTYPE_ENTER 41
83 #define TC_SUBTYPE_UPDT_INFO 51
81 #define TC_SUBTYPE_UPDT_INFO 51
84 #define TC_SUBTYPE_EN_CAL 61
82 #define TC_SUBTYPE_EN_CAL 61
85 #define TC_SUBTYPE_DIS_CAL 63
83 #define TC_SUBTYPE_DIS_CAL 63
86 #define TC_SUBTYPE_UPDT_TIME 129
84 #define TC_SUBTYPE_UPDT_TIME 129
87
85
88 // TC LEN
86 // TC LEN
89 #define TC_LEN_RESET 12
87 #define TC_LEN_RESET 12
90 #define TC_LEN_LOAD_COMM 14
88 #define TC_LEN_LOAD_COMM 14
91 #define TC_LEN_LOAD_NORM 22
89 #define TC_LEN_LOAD_NORM 22
92 #define TC_LEN_LOAD_BURST 14
90 #define TC_LEN_LOAD_BURST 14
93 #define TC_LEN_LOAD_SBM1 14
91 #define TC_LEN_LOAD_SBM1 14
94 #define TC_LEN_LOAD_SBM2 14
92 #define TC_LEN_LOAD_SBM2 14
95 #define TC_LEN_DUMP 12
93 #define TC_LEN_DUMP 12
96 #define TC_LEN_ENTER 20
94 #define TC_LEN_ENTER 20
97 #define TC_LEN_UPDT_INFO 46
95 #define TC_LEN_UPDT_INFO 46
98 #define TC_LEN_EN_CAL 12
96 #define TC_LEN_EN_CAL 12
99 #define TC_LEN_DIS_CAL 12
97 #define TC_LEN_DIS_CAL 12
100 #define TC_LEN_UPDT_TIME 18
98 #define TC_LEN_UPDT_TIME 18
101
99
102 // TM TYPES
100 // TM TYPES
103 #define TM_TYPE_TC_EXE 1
101 #define TM_TYPE_TC_EXE 1
104 #define TM_TYPE_HK 3
102 #define TM_TYPE_HK 3
105 #define TM_TYPE_PARAMETER_DUMP 3
103 #define TM_TYPE_PARAMETER_DUMP 3
106 #define TM_TYPE_LFR_SCIENCE 21
104 #define TM_TYPE_LFR_SCIENCE 21
107
105
108 // TM SUBTYPES
106 // TM SUBTYPES
109 #define TM_SUBTYPE_EXE_OK 7
107 #define TM_SUBTYPE_EXE_OK 7
110 #define TM_SUBTYPE_EXE_NOK 8
108 #define TM_SUBTYPE_EXE_NOK 8
111 #define TM_SUBTYPE_HK 25
109 #define TM_SUBTYPE_HK 25
112 #define TM_SUBTYPE_PARAMETER_DUMP 25
110 #define TM_SUBTYPE_PARAMETER_DUMP 25
113 #define TM_SUBTYPE_SCIENCE 3
111 #define TM_SUBTYPE_SCIENCE 3
114 #define TM_SUBTYPE_LFR_SCIENCE 3
112 #define TM_SUBTYPE_LFR_SCIENCE 3
115
113
116 // FAILURE CODES
114 // FAILURE CODES
117 #define ILLEGAL_APID 0
115 #define ILLEGAL_APID 0
118 #define WRONG_LEN_PKT 1
116 #define WRONG_LEN_PKT 1
119 #define INCOR_CHECKSUM 2
117 #define INCOR_CHECKSUM 2
120 #define ILL_TYPE 3
118 #define ILL_TYPE 3
121 #define ILL_SUBTYPE 4
119 #define ILL_SUBTYPE 4
122 #define WRONG_APP_DATA 5 // 0x00 0x05
120 #define WRONG_APP_DATA 5 // 0x00 0x05
123 #define TC_NOT_EXE 42000 // 0xa4 0x10
121 #define TC_NOT_EXE 42000 // 0xa4 0x10
124 #define WRONG_SRC_ID 42001 // 0xa4 0x11
122 #define WRONG_SRC_ID 42001 // 0xa4 0x11
125 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
123 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
126 #define FAIL_DETECTED 42003 // 0xa4 0x13
124 #define FAIL_DETECTED 42003 // 0xa4 0x13
127 #define NOT_ALLOWED 42004 // 0xa4 0x14
125 #define NOT_ALLOWED 42004 // 0xa4 0x14
128 #define CORRUPTED 42005 // 0xa4 0x15
126 #define CORRUPTED 42005 // 0xa4 0x15
129 #define CCSDS_TM_VALID 7
127 #define CCSDS_TM_VALID 7
130
128
131 // TC SID
129 // TC SID
132 #define SID_TC_GROUND 0
130 #define SID_TC_GROUND 0
133 #define SID_TC_MISSION_TIMELINE 110
131 #define SID_TC_MISSION_TIMELINE 110
134 #define SID_TC_TC_SEQUENCES 111
132 #define SID_TC_TC_SEQUENCES 111
135 #define SID_TC_RECOVERY_ACTION_CMD 112
133 #define SID_TC_RECOVERY_ACTION_CMD 112
136 #define SID_TC_BACKUP_MISSION_TIMELINE 113
134 #define SID_TC_BACKUP_MISSION_TIMELINE 113
137 #define SID_TC_DIRECT_CMD 120
135 #define SID_TC_DIRECT_CMD 120
138 #define SID_TC_SPARE_GRD_SRC1 121
136 #define SID_TC_SPARE_GRD_SRC1 121
139 #define SID_TC_SPARE_GRD_SRC2 122
137 #define SID_TC_SPARE_GRD_SRC2 122
140 #define SID_TC_OBCP 15
138 #define SID_TC_OBCP 15
141 #define SID_TC_SYSTEM_CONTROL 14
139 #define SID_TC_SYSTEM_CONTROL 14
142 #define SID_TC_AOCS 11
140 #define SID_TC_AOCS 11
143 #define SID_TC_RPW_INTERNAL 254
141 #define SID_TC_RPW_INTERNAL 254
144
142
145 enum apid_destid{
143 enum apid_destid{
146 GROUND,
144 GROUND,
147 MISSION_TIMELINE,
145 MISSION_TIMELINE,
148 TC_SEQUENCES,
146 TC_SEQUENCES,
149 RECOVERY_ACTION_CMD,
147 RECOVERY_ACTION_CMD,
150 BACKUP_MISSION_TIMELINE,
148 BACKUP_MISSION_TIMELINE,
151 DIRECT_CMD,
149 DIRECT_CMD,
152 SPARE_GRD_SRC1,
150 SPARE_GRD_SRC1,
153 SPARE_GRD_SRC2,
151 SPARE_GRD_SRC2,
154 OBCP,
152 OBCP,
155 SYSTEM_CONTROL,
153 SYSTEM_CONTROL,
156 AOCS,
154 AOCS,
157 RPW_INTERNAL
155 RPW_INTERNAL
158 };
156 };
159 // SEQUENCE COUNTERS
157 // SEQUENCE COUNTERS
160 #define SEQ_CNT_MAX 16383
158 #define SEQ_CNT_MAX 16383
161 #define SEQ_CNT_NB_DEST_ID 12
159 #define SEQ_CNT_NB_DEST_ID 12
162
160
163 // TM SID
161 // TM SID
164 #define SID_HK 1
162 #define SID_HK 1
165 #define SID_PARAMETER_DUMP 10
163 #define SID_PARAMETER_DUMP 10
166
164
167 #define SID_NORM_SWF_F0 3
165 #define SID_NORM_SWF_F0 3
168 #define SID_NORM_SWF_F1 4
166 #define SID_NORM_SWF_F1 4
169 #define SID_NORM_SWF_F2 5
167 #define SID_NORM_SWF_F2 5
170 #define SID_NORM_CWF_F3 1
168 #define SID_NORM_CWF_F3 1
171 #define SID_BURST_CWF_F2 2
169 #define SID_BURST_CWF_F2 2
172 #define SID_SBM1_CWF_F1 24
170 #define SID_SBM1_CWF_F1 24
173 #define SID_SBM2_CWF_F2 25
171 #define SID_SBM2_CWF_F2 25
174 #define SID_NORM_ASM_F0 11
172 #define SID_NORM_ASM_F0 11
175 #define SID_NORM_ASM_F1 12
173 #define SID_NORM_ASM_F1 12
176 #define SID_NORM_ASM_F2 13
174 #define SID_NORM_ASM_F2 13
177 #define SID_NORM_BP1_F0 14
175 #define SID_NORM_BP1_F0 14
178 #define SID_NORM_BP1_F1 15
176 #define SID_NORM_BP1_F1 15
179 #define SID_NORM_BP1_F2 16
177 #define SID_NORM_BP1_F2 16
180 #define SID_NORM_BP2_F0 19
178 #define SID_NORM_BP2_F0 19
181 #define SID_NORM_BP2_F1 20
179 #define SID_NORM_BP2_F1 20
182 #define SID_NORM_BP2_F2 21
180 #define SID_NORM_BP2_F2 21
183 #define SID_BURST_BP1_F0 17
181 #define SID_BURST_BP1_F0 17
184 #define SID_BURST_BP2_F0 22
182 #define SID_BURST_BP2_F0 22
185 #define SID_BURST_BP1_F1 18
183 #define SID_BURST_BP1_F1 18
186 #define SID_BURST_BP2_F1 23
184 #define SID_BURST_BP2_F1 23
187 #define SID_SBM1_BP1_F0 28
185 #define SID_SBM1_BP1_F0 28
188 #define SID_SBM1_BP2_F0 31
186 #define SID_SBM1_BP2_F0 31
189 #define SID_SBM2_BP1_F0 29
187 #define SID_SBM2_BP1_F0 29
190 #define SID_SBM2_BP2_F0 32
188 #define SID_SBM2_BP2_F0 32
191 #define SID_SBM2_BP1_F1 30
189 #define SID_SBM2_BP1_F1 30
192 #define SID_SBM2_BP2_F1 33
190 #define SID_SBM2_BP2_F1 33
193 #define SID_NORM_CWF_LONG_F3 34
191 #define SID_NORM_CWF_LONG_F3 34
194
192
195 // LENGTH (BYTES)
193 // LENGTH (BYTES)
196 #define LENGTH_TM_LFR_TC_EXE_MAX 32
194 #define LENGTH_TM_LFR_TC_EXE_MAX 32
197 #define LENGTH_TM_LFR_HK 126
195 #define LENGTH_TM_LFR_HK 126
198
196
199 // HEADER_LENGTH
197 // HEADER_LENGTH
200 #define TM_HEADER_LEN 16
198 #define TM_HEADER_LEN 16
201 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
199 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
202 // PACKET_LENGTH
200 // PACKET_LENGTH
203 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
201 #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)
202 #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)
203 #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)
204 #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)
205 #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)
206 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
209 #define PACKET_LENGTH_HK (124 - CCSDS_TC_TM_PACKET_OFFSET)
207 #define PACKET_LENGTH_HK (124 - CCSDS_TC_TM_PACKET_OFFSET)
210 #define PACKET_LENGTH_PARAMETER_DUMP (36 - CCSDS_TC_TM_PACKET_OFFSET)
208 #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
209 #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
210 #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
211 #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)
212 #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
213 #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)
214 #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
215 #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
216 #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
217 #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
218 #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
219 #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
220 #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
221 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (806 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 26
224
222
225 #define PACKET_LENGTH_DELTA 11 // 7 + 4
223 #define PACKET_LENGTH_DELTA 11 // 7 + 4
226
224
227 #define SPARE1_PUSVERSION_SPARE2 0x10
225 #define SPARE1_PUSVERSION_SPARE2 0x10
228
226
229 // R1
227 // R1
230 #define TM_LEN_SCI_SWF_340 4101 // 340 * 12 + 10 + 12 - 1
228 #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
229 #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
230 #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
231 #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
232 #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
233 #define TM_LEN_SCI_CWF3_LIGHT_8 67 // 8 * 6 + 10 + 10 - 1
236 // R2
234 // R2
237 #define TM_LEN_SCI_SWF_304 3669 // 304 * 12 + 10 + 12 - 1
235 #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
236 #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
237 #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
238 #define TM_LEN_SCI_CWF_672 4051 // 672 * 6 + 10 + 10 - 1
241 //
239 //
242 #define DEFAULT_PKTCNT 0x07
240 #define DEFAULT_PKTCNT 0x07
243 #define BLK_NR_304 0x0130
241 #define BLK_NR_304 0x0130
244 #define BLK_NR_224 0x00e0
242 #define BLK_NR_224 0x00e0
245 #define BLK_NR_CWF 0x0150 // 336
243 #define BLK_NR_CWF 0x0150 // 336
246 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
244 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
247
245
248 enum TM_TYPE{
246 enum TM_TYPE{
249 TM_LFR_TC_EXE_OK,
247 TM_LFR_TC_EXE_OK,
250 TM_LFR_TC_EXE_ERR,
248 TM_LFR_TC_EXE_ERR,
251 TM_LFR_HK,
249 TM_LFR_HK,
252 TM_LFR_SCI,
250 TM_LFR_SCI,
253 TM_LFR_SCI_SBM,
251 TM_LFR_SCI_SBM,
254 TM_LFR_PAR_DUMP
252 TM_LFR_PAR_DUMP
255 };
253 };
256
254
257 typedef struct {
255 typedef struct {
258 unsigned char targetLogicalAddress;
256 unsigned char targetLogicalAddress;
259 unsigned char protocolIdentifier;
257 unsigned char protocolIdentifier;
260 unsigned char reserved;
258 unsigned char reserved;
261 unsigned char userApplication;
259 unsigned char userApplication;
262 // PACKET HEADER
260 // PACKET HEADER
263 unsigned char packetID[2];
261 unsigned char packetID[2];
264 unsigned char packetSequenceControl[2];
262 unsigned char packetSequenceControl[2];
265 unsigned char packetLength[2];
263 unsigned char packetLength[2];
266 // DATA FIELD HEADER
264 // DATA FIELD HEADER
267 unsigned char spare1_pusVersion_spare2;
265 unsigned char spare1_pusVersion_spare2;
268 unsigned char serviceType;
266 unsigned char serviceType;
269 unsigned char serviceSubType;
267 unsigned char serviceSubType;
270 unsigned char destinationID;
268 unsigned char destinationID;
271 unsigned char time[6];
269 unsigned char time[6];
272 //
270 //
273 unsigned char telecommand_pkt_id[2];
271 unsigned char telecommand_pkt_id[2];
274 unsigned char pkt_seq_control[2];
272 unsigned char pkt_seq_control[2];
275 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
273 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
276
274
277 typedef struct {
275 typedef struct {
278 unsigned char targetLogicalAddress;
276 unsigned char targetLogicalAddress;
279 unsigned char protocolIdentifier;
277 unsigned char protocolIdentifier;
280 unsigned char reserved;
278 unsigned char reserved;
281 unsigned char userApplication;
279 unsigned char userApplication;
282 // PACKET HEADER
280 // PACKET HEADER
283 unsigned char packetID[2];
281 unsigned char packetID[2];
284 unsigned char packetSequenceControl[2];
282 unsigned char packetSequenceControl[2];
285 unsigned char packetLength[2];
283 unsigned char packetLength[2];
286 // DATA FIELD HEADER
284 // DATA FIELD HEADER
287 unsigned char spare1_pusVersion_spare2;
285 unsigned char spare1_pusVersion_spare2;
288 unsigned char serviceType;
286 unsigned char serviceType;
289 unsigned char serviceSubType;
287 unsigned char serviceSubType;
290 unsigned char destinationID;
288 unsigned char destinationID;
291 unsigned char time[6];
289 unsigned char time[6];
292 //
290 //
293 unsigned char tc_failure_code[2];
291 unsigned char tc_failure_code[2];
294 unsigned char telecommand_pkt_id[2];
292 unsigned char telecommand_pkt_id[2];
295 unsigned char pkt_seq_control[2];
293 unsigned char pkt_seq_control[2];
296 unsigned char tc_service;
294 unsigned char tc_service;
297 unsigned char tc_subtype;
295 unsigned char tc_subtype;
298 unsigned char byte_position;
296 unsigned char byte_position;
299 unsigned char rcv_value;
297 unsigned char rcv_value;
300 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
298 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
301
299
302 typedef struct {
300 typedef struct {
303 unsigned char targetLogicalAddress;
301 unsigned char targetLogicalAddress;
304 unsigned char protocolIdentifier;
302 unsigned char protocolIdentifier;
305 unsigned char reserved;
303 unsigned char reserved;
306 unsigned char userApplication;
304 unsigned char userApplication;
307 // PACKET HEADER
305 // PACKET HEADER
308 unsigned char packetID[2];
306 unsigned char packetID[2];
309 unsigned char packetSequenceControl[2];
307 unsigned char packetSequenceControl[2];
310 unsigned char packetLength[2];
308 unsigned char packetLength[2];
311 // DATA FIELD HEADER
309 // DATA FIELD HEADER
312 unsigned char spare1_pusVersion_spare2;
310 unsigned char spare1_pusVersion_spare2;
313 unsigned char serviceType;
311 unsigned char serviceType;
314 unsigned char serviceSubType;
312 unsigned char serviceSubType;
315 unsigned char destinationID;
313 unsigned char destinationID;
316 unsigned char time[6];
314 unsigned char time[6];
317 //
315 //
318 unsigned char tc_failure_code[2];
316 unsigned char tc_failure_code[2];
319 unsigned char telecommand_pkt_id[2];
317 unsigned char telecommand_pkt_id[2];
320 unsigned char pkt_seq_control[2];
318 unsigned char pkt_seq_control[2];
321 unsigned char tc_service;
319 unsigned char tc_service;
322 unsigned char tc_subtype;
320 unsigned char tc_subtype;
323 unsigned char lfr_status_word[2];
321 unsigned char lfr_status_word[2];
324 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
322 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
325
323
326 typedef struct {
324 typedef struct {
327 unsigned char targetLogicalAddress;
325 unsigned char targetLogicalAddress;
328 unsigned char protocolIdentifier;
326 unsigned char protocolIdentifier;
329 unsigned char reserved;
327 unsigned char reserved;
330 unsigned char userApplication;
328 unsigned char userApplication;
331 // PACKET HEADER
329 // PACKET HEADER
332 unsigned char packetID[2];
330 unsigned char packetID[2];
333 unsigned char packetSequenceControl[2];
331 unsigned char packetSequenceControl[2];
334 unsigned char packetLength[2];
332 unsigned char packetLength[2];
335 // DATA FIELD HEADER
333 // DATA FIELD HEADER
336 unsigned char spare1_pusVersion_spare2;
334 unsigned char spare1_pusVersion_spare2;
337 unsigned char serviceType;
335 unsigned char serviceType;
338 unsigned char serviceSubType;
336 unsigned char serviceSubType;
339 unsigned char destinationID;
337 unsigned char destinationID;
340 unsigned char time[6];
338 unsigned char time[6];
341 //
339 //
342 unsigned char tc_failure_code[2];
340 unsigned char tc_failure_code[2];
343 unsigned char telecommand_pkt_id[2];
341 unsigned char telecommand_pkt_id[2];
344 unsigned char pkt_seq_control[2];
342 unsigned char pkt_seq_control[2];
345 unsigned char tc_service;
343 unsigned char tc_service;
346 unsigned char tc_subtype;
344 unsigned char tc_subtype;
347 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
345 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
348
346
349 typedef struct {
347 typedef struct {
350 unsigned char targetLogicalAddress;
348 unsigned char targetLogicalAddress;
351 unsigned char protocolIdentifier;
349 unsigned char protocolIdentifier;
352 unsigned char reserved;
350 unsigned char reserved;
353 unsigned char userApplication;
351 unsigned char userApplication;
354 // PACKET HEADER
352 // PACKET HEADER
355 unsigned char packetID[2];
353 unsigned char packetID[2];
356 unsigned char packetSequenceControl[2];
354 unsigned char packetSequenceControl[2];
357 unsigned char packetLength[2];
355 unsigned char packetLength[2];
358 // DATA FIELD HEADER
356 // DATA FIELD HEADER
359 unsigned char spare1_pusVersion_spare2;
357 unsigned char spare1_pusVersion_spare2;
360 unsigned char serviceType;
358 unsigned char serviceType;
361 unsigned char serviceSubType;
359 unsigned char serviceSubType;
362 unsigned char destinationID;
360 unsigned char destinationID;
363 unsigned char time[6];
361 unsigned char time[6];
364 //
362 //
365 unsigned char tc_failure_code[2];
363 unsigned char tc_failure_code[2];
366 unsigned char telecommand_pkt_id[2];
364 unsigned char telecommand_pkt_id[2];
367 unsigned char pkt_seq_control[2];
365 unsigned char pkt_seq_control[2];
368 unsigned char tc_service;
366 unsigned char tc_service;
369 unsigned char tc_subtype;
367 unsigned char tc_subtype;
370 } Packet_TM_LFR_TC_EXE_ERROR_t;
368 } Packet_TM_LFR_TC_EXE_ERROR_t;
371
369
372 typedef struct {
370 typedef struct {
373 unsigned char targetLogicalAddress;
371 unsigned char targetLogicalAddress;
374 unsigned char protocolIdentifier;
372 unsigned char protocolIdentifier;
375 unsigned char reserved;
373 unsigned char reserved;
376 unsigned char userApplication;
374 unsigned char userApplication;
377 // PACKET HEADER
375 // PACKET HEADER
378 unsigned char packetID[2];
376 unsigned char packetID[2];
379 unsigned char packetSequenceControl[2];
377 unsigned char packetSequenceControl[2];
380 unsigned char packetLength[2];
378 unsigned char packetLength[2];
381 // DATA FIELD HEADER
379 // DATA FIELD HEADER
382 unsigned char spare1_pusVersion_spare2;
380 unsigned char spare1_pusVersion_spare2;
383 unsigned char serviceType;
381 unsigned char serviceType;
384 unsigned char serviceSubType;
382 unsigned char serviceSubType;
385 unsigned char destinationID;
383 unsigned char destinationID;
386 unsigned char time[6];
384 unsigned char time[6];
387 //
385 //
388 unsigned char tc_failure_code[2];
386 unsigned char tc_failure_code[2];
389 unsigned char telecommand_pkt_id[2];
387 unsigned char telecommand_pkt_id[2];
390 unsigned char pkt_seq_control[2];
388 unsigned char pkt_seq_control[2];
391 unsigned char tc_service;
389 unsigned char tc_service;
392 unsigned char tc_subtype;
390 unsigned char tc_subtype;
393 unsigned char pkt_len_rcv_value[2];
391 unsigned char pkt_len_rcv_value[2];
394 unsigned char pkt_datafieldsize_cnt[2];
392 unsigned char pkt_datafieldsize_cnt[2];
395 unsigned char rcv_crc[2];
393 unsigned char rcv_crc[2];
396 unsigned char computed_crc[2];
394 unsigned char computed_crc[2];
397 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
395 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
398
396
399 typedef struct {
397 typedef struct {
400 unsigned char targetLogicalAddress;
398 unsigned char targetLogicalAddress;
401 unsigned char protocolIdentifier;
399 unsigned char protocolIdentifier;
402 unsigned char reserved;
400 unsigned char reserved;
403 unsigned char userApplication;
401 unsigned char userApplication;
404 unsigned char packetID[2];
402 unsigned char packetID[2];
405 unsigned char packetSequenceControl[2];
403 unsigned char packetSequenceControl[2];
406 unsigned char packetLength[2];
404 unsigned char packetLength[2];
407 // DATA FIELD HEADER
405 // DATA FIELD HEADER
408 unsigned char spare1_pusVersion_spare2;
406 unsigned char spare1_pusVersion_spare2;
409 unsigned char serviceType;
407 unsigned char serviceType;
410 unsigned char serviceSubType;
408 unsigned char serviceSubType;
411 unsigned char destinationID;
409 unsigned char destinationID;
412 unsigned char time[6];
410 unsigned char time[6];
413 // AUXILIARY HEADER
411 // AUXILIARY HEADER
414 unsigned char sid;
412 unsigned char sid;
415 unsigned char hkBIA;
413 unsigned char hkBIA;
416 unsigned char pktCnt;
414 unsigned char pktCnt;
417 unsigned char pktNr;
415 unsigned char pktNr;
418 unsigned char acquisitionTime[6];
416 unsigned char acquisitionTime[6];
419 unsigned char blkNr[2];
417 unsigned char blkNr[2];
420 } Header_TM_LFR_SCIENCE_SWF_t;
418 } Header_TM_LFR_SCIENCE_SWF_t;
421
419
422 typedef struct {
420 typedef struct {
423 unsigned char targetLogicalAddress;
421 unsigned char targetLogicalAddress;
424 unsigned char protocolIdentifier;
422 unsigned char protocolIdentifier;
425 unsigned char reserved;
423 unsigned char reserved;
426 unsigned char userApplication;
424 unsigned char userApplication;
427 unsigned char packetID[2];
425 unsigned char packetID[2];
428 unsigned char packetSequenceControl[2];
426 unsigned char packetSequenceControl[2];
429 unsigned char packetLength[2];
427 unsigned char packetLength[2];
430 // DATA FIELD HEADER
428 // DATA FIELD HEADER
431 unsigned char spare1_pusVersion_spare2;
429 unsigned char spare1_pusVersion_spare2;
432 unsigned char serviceType;
430 unsigned char serviceType;
433 unsigned char serviceSubType;
431 unsigned char serviceSubType;
434 unsigned char destinationID;
432 unsigned char destinationID;
435 unsigned char time[6];
433 unsigned char time[6];
436 // AUXILIARY DATA HEADER
434 // AUXILIARY DATA HEADER
437 unsigned char sid;
435 unsigned char sid;
438 unsigned char hkBIA;
436 unsigned char hkBIA;
439 unsigned char acquisitionTime[6];
437 unsigned char acquisitionTime[6];
440 unsigned char blkNr[2];
438 unsigned char blkNr[2];
441 } Header_TM_LFR_SCIENCE_CWF_t;
439 } Header_TM_LFR_SCIENCE_CWF_t;
442
440
443 typedef struct {
441 typedef struct {
444 unsigned char targetLogicalAddress;
442 unsigned char targetLogicalAddress;
445 unsigned char protocolIdentifier;
443 unsigned char protocolIdentifier;
446 unsigned char reserved;
444 unsigned char reserved;
447 unsigned char userApplication;
445 unsigned char userApplication;
448 unsigned char packetID[2];
446 unsigned char packetID[2];
449 unsigned char packetSequenceControl[2];
447 unsigned char packetSequenceControl[2];
450 unsigned char packetLength[2];
448 unsigned char packetLength[2];
451 // DATA FIELD HEADER
449 // DATA FIELD HEADER
452 unsigned char spare1_pusVersion_spare2;
450 unsigned char spare1_pusVersion_spare2;
453 unsigned char serviceType;
451 unsigned char serviceType;
454 unsigned char serviceSubType;
452 unsigned char serviceSubType;
455 unsigned char destinationID;
453 unsigned char destinationID;
456 unsigned char time[6];
454 unsigned char time[6];
457 // AUXILIARY HEADER
455 // AUXILIARY HEADER
458 unsigned char sid;
456 unsigned char sid;
459 unsigned char biaStatusInfo;
457 unsigned char biaStatusInfo;
460 unsigned char pa_lfr_pkt_cnt_asm;
458 unsigned char pa_lfr_pkt_cnt_asm;
461 unsigned char pa_lfr_pkt_nr_asm;
459 unsigned char pa_lfr_pkt_nr_asm;
462 unsigned char acquisitionTime[6];
460 unsigned char acquisitionTime[6];
463 unsigned char pa_lfr_asm_blk_nr[2];
461 unsigned char pa_lfr_asm_blk_nr[2];
464 } Header_TM_LFR_SCIENCE_ASM_t;
462 } Header_TM_LFR_SCIENCE_ASM_t;
465
463
466 typedef struct {
464 typedef struct {
467 unsigned char targetLogicalAddress;
465 unsigned char targetLogicalAddress;
468 unsigned char protocolIdentifier;
466 unsigned char protocolIdentifier;
469 unsigned char reserved;
467 unsigned char reserved;
470 unsigned char userApplication;
468 unsigned char userApplication;
471 unsigned char packetID[2];
469 unsigned char packetID[2];
472 unsigned char packetSequenceControl[2];
470 unsigned char packetSequenceControl[2];
473 unsigned char packetLength[2];
471 unsigned char packetLength[2];
474 // DATA FIELD HEADER
472 // DATA FIELD HEADER
475 unsigned char spare1_pusVersion_spare2;
473 unsigned char spare1_pusVersion_spare2;
476 unsigned char serviceType;
474 unsigned char serviceType;
477 unsigned char serviceSubType;
475 unsigned char serviceSubType;
478 unsigned char destinationID;
476 unsigned char destinationID;
479 unsigned char time[6];
477 unsigned char time[6];
480 // AUXILIARY HEADER
478 // AUXILIARY HEADER
481 unsigned char sid;
479 unsigned char sid;
482 unsigned char biaStatusInfo;
480 unsigned char biaStatusInfo;
483 unsigned char acquisitionTime[6];
481 unsigned char acquisitionTime[6];
484 unsigned char source_data_spare;
482 unsigned char source_data_spare;
485 unsigned char pa_lfr_bp_blk_nr[2];
483 unsigned char pa_lfr_bp_blk_nr[2];
486 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
484 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
487
485
488 typedef struct {
486 typedef struct {
489 unsigned char targetLogicalAddress;
487 unsigned char targetLogicalAddress;
490 unsigned char protocolIdentifier;
488 unsigned char protocolIdentifier;
491 unsigned char reserved;
489 unsigned char reserved;
492 unsigned char userApplication;
490 unsigned char userApplication;
493 unsigned char packetID[2];
491 unsigned char packetID[2];
494 unsigned char packetSequenceControl[2];
492 unsigned char packetSequenceControl[2];
495 unsigned char packetLength[2];
493 unsigned char packetLength[2];
496 // DATA FIELD HEADER
494 // DATA FIELD HEADER
497 unsigned char spare1_pusVersion_spare2;
495 unsigned char spare1_pusVersion_spare2;
498 unsigned char serviceType;
496 unsigned char serviceType;
499 unsigned char serviceSubType;
497 unsigned char serviceSubType;
500 unsigned char destinationID;
498 unsigned char destinationID;
501 unsigned char time[6];
499 unsigned char time[6];
502 // AUXILIARY HEADER
500 // AUXILIARY HEADER
503 unsigned char sid;
501 unsigned char sid;
504 unsigned char biaStatusInfo;
502 unsigned char biaStatusInfo;
505 unsigned char acquisitionTime[6];
503 unsigned char acquisitionTime[6];
506 unsigned char pa_lfr_bp_blk_nr[2];
504 unsigned char pa_lfr_bp_blk_nr[2];
507 } Header_TM_LFR_SCIENCE_BP_t;
505 } Header_TM_LFR_SCIENCE_BP_t;
508
506
509 typedef struct {
507 typedef struct {
510 //targetLogicalAddress is removed by the grspw module
508 //targetLogicalAddress is removed by the grspw module
511 unsigned char protocolIdentifier;
509 unsigned char protocolIdentifier;
512 unsigned char reserved;
510 unsigned char reserved;
513 unsigned char userApplication;
511 unsigned char userApplication;
514 unsigned char packetID[2];
512 unsigned char packetID[2];
515 unsigned char packetSequenceControl[2];
513 unsigned char packetSequenceControl[2];
516 unsigned char packetLength[2];
514 unsigned char packetLength[2];
517 // DATA FIELD HEADER
515 // DATA FIELD HEADER
518 unsigned char headerFlag_pusVersion_Ack;
516 unsigned char headerFlag_pusVersion_Ack;
519 unsigned char serviceType;
517 unsigned char serviceType;
520 unsigned char serviceSubType;
518 unsigned char serviceSubType;
521 unsigned char sourceID;
519 unsigned char sourceID;
522 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
520 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
523 } ccsdsTelecommandPacket_t;
521 } ccsdsTelecommandPacket_t;
524
522
525 typedef struct {
523 typedef struct {
526 unsigned char targetLogicalAddress;
524 unsigned char targetLogicalAddress;
527 unsigned char protocolIdentifier;
525 unsigned char protocolIdentifier;
528 unsigned char reserved;
526 unsigned char reserved;
529 unsigned char userApplication;
527 unsigned char userApplication;
530 unsigned char packetID[2];
528 unsigned char packetID[2];
531 unsigned char packetSequenceControl[2];
529 unsigned char packetSequenceControl[2];
532 unsigned char packetLength[2];
530 unsigned char packetLength[2];
533 unsigned char spare1_pusVersion_spare2;
531 unsigned char spare1_pusVersion_spare2;
534 unsigned char serviceType;
532 unsigned char serviceType;
535 unsigned char serviceSubType;
533 unsigned char serviceSubType;
536 unsigned char destinationID;
534 unsigned char destinationID;
537 unsigned char time[6];
535 unsigned char time[6];
538 unsigned char sid;
536 unsigned char sid;
539
537
540 //**************
538 //**************
541 // HK PARAMETERS
539 // HK PARAMETERS
542 unsigned char lfr_status_word[2];
540 unsigned char lfr_status_word[2];
543 unsigned char lfr_sw_version[4];
541 unsigned char lfr_sw_version[4];
544 unsigned char lfr_fpga_version[3];
542 unsigned char lfr_fpga_version[3];
545 // ressource statistics
543 // ressource statistics
546 unsigned char hk_lfr_cpu_load;
544 unsigned char hk_lfr_cpu_load;
547 unsigned char hk_lfr_cpu_load_max;
545 unsigned char hk_lfr_cpu_load_max;
548 unsigned char hk_lfr_cpu_load_aver;
546 unsigned char hk_lfr_cpu_load_aver;
549 // tc statistics
547 // tc statistics
550 unsigned char hk_lfr_update_info_tc_cnt[2];
548 unsigned char hk_lfr_update_info_tc_cnt[2];
551 unsigned char hk_lfr_update_time_tc_cnt[2];
549 unsigned char hk_lfr_update_time_tc_cnt[2];
552 unsigned char hk_lfr_exe_tc_cnt[2];
550 unsigned char hk_lfr_exe_tc_cnt[2];
553 unsigned char hk_lfr_rej_tc_cnt[2];
551 unsigned char hk_lfr_rej_tc_cnt[2];
554 unsigned char hk_lfr_last_exe_tc_id[2];
552 unsigned char hk_lfr_last_exe_tc_id[2];
555 unsigned char hk_lfr_last_exe_tc_type[2];
553 unsigned char hk_lfr_last_exe_tc_type[2];
556 unsigned char hk_lfr_last_exe_tc_subtype[2];
554 unsigned char hk_lfr_last_exe_tc_subtype[2];
557 unsigned char hk_lfr_last_exe_tc_time[6];
555 unsigned char hk_lfr_last_exe_tc_time[6];
558 unsigned char hk_lfr_last_rej_tc_id[2];
556 unsigned char hk_lfr_last_rej_tc_id[2];
559 unsigned char hk_lfr_last_rej_tc_type[2];
557 unsigned char hk_lfr_last_rej_tc_type[2];
560 unsigned char hk_lfr_last_rej_tc_subtype[2];
558 unsigned char hk_lfr_last_rej_tc_subtype[2];
561 unsigned char hk_lfr_last_rej_tc_time[6];
559 unsigned char hk_lfr_last_rej_tc_time[6];
562 // anomaly statistics
560 // anomaly statistics
563 unsigned char hk_lfr_le_cnt[2];
561 unsigned char hk_lfr_le_cnt[2];
564 unsigned char hk_lfr_me_cnt[2];
562 unsigned char hk_lfr_me_cnt[2];
565 unsigned char hk_lfr_he_cnt[2];
563 unsigned char hk_lfr_he_cnt[2];
566 unsigned char hk_lfr_last_er_rid[2];
564 unsigned char hk_lfr_last_er_rid[2];
567 unsigned char hk_lfr_last_er_code;
565 unsigned char hk_lfr_last_er_code;
568 unsigned char hk_lfr_last_er_time[6];
566 unsigned char hk_lfr_last_er_time[6];
569 // vhdl_blk_status
567 // vhdl_blk_status
570 unsigned char hk_lfr_vhdl_aa_sm;
568 unsigned char hk_lfr_vhdl_aa_sm;
571 unsigned char hk_lfr_vhdl_fft_sr;
569 unsigned char hk_lfr_vhdl_fft_sr;
572 unsigned char hk_lfr_vhdl_cic_hk;
570 unsigned char hk_lfr_vhdl_cic_hk;
573 unsigned char hk_lfr_vhdl_iir_cal;
571 unsigned char hk_lfr_vhdl_iir_cal;
574 // spacewire_if_statistics
572 // spacewire_if_statistics
575 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
573 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
576 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
574 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
577 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
575 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
578 unsigned char hk_lfr_dpu_spw_last_timc;
576 unsigned char hk_lfr_dpu_spw_last_timc;
579 // ahb error statistics
577 // ahb error statistics
580 unsigned char hk_lfr_last_fail_addr[4];
578 unsigned char hk_lfr_last_fail_addr[4];
581 // temperatures
579 // temperatures
582 unsigned char hk_lfr_temp_scm[2];
580 unsigned char hk_lfr_temp_scm[2];
583 unsigned char hk_lfr_temp_pcb[2];
581 unsigned char hk_lfr_temp_pcb[2];
584 unsigned char hk_lfr_temp_fpga[2];
582 unsigned char hk_lfr_temp_fpga[2];
585 // spacecraft potential
583 // spacecraft potential
586 unsigned char hk_lfr_sc_v_f3[2];
584 unsigned char hk_lfr_sc_v_f3[2];
587 unsigned char hk_lfr_sc_e1_f3[2];
585 unsigned char hk_lfr_sc_e1_f3[2];
588 unsigned char hk_lfr_sc_e2_f3[2];
586 unsigned char hk_lfr_sc_e2_f3[2];
589 // error counters
587 // error counters
590 unsigned char hk_lfr_dpu_spw_parity;
588 unsigned char hk_lfr_dpu_spw_parity;
591 unsigned char hk_lfr_dpu_spw_disconnect;
589 unsigned char hk_lfr_dpu_spw_disconnect;
592 unsigned char hk_lfr_dpu_spw_escape;
590 unsigned char hk_lfr_dpu_spw_escape;
593 unsigned char hk_lfr_dpu_spw_credit;
591 unsigned char hk_lfr_dpu_spw_credit;
594 unsigned char hk_lfr_dpu_spw_write_sync;
592 unsigned char hk_lfr_dpu_spw_write_sync;
595 unsigned char hk_lfr_dpu_spw_rx_ahb;
593 unsigned char hk_lfr_dpu_spw_rx_ahb;
596 unsigned char hk_lfr_dpu_spw_tx_ahb;
594 unsigned char hk_lfr_dpu_spw_tx_ahb;
597 unsigned char hk_lfr_dpu_spw_early_eop;
595 unsigned char hk_lfr_dpu_spw_early_eop;
598 unsigned char hk_lfr_dpu_spw_invalid_addr;
596 unsigned char hk_lfr_dpu_spw_invalid_addr;
599 unsigned char hk_lfr_dpu_spw_eep;
597 unsigned char hk_lfr_dpu_spw_eep;
600 unsigned char hk_lfr_dpu_spw_rx_too_big;
598 unsigned char hk_lfr_dpu_spw_rx_too_big;
601 // timecode
599 // timecode
602 unsigned char hk_lfr_timecode_erroneous;
600 unsigned char hk_lfr_timecode_erroneous;
603 unsigned char hk_lfr_timecode_missing;
601 unsigned char hk_lfr_timecode_missing;
604 unsigned char hk_lfr_timecode_invalid;
602 unsigned char hk_lfr_timecode_invalid;
605 // time
603 // time
606 unsigned char hk_lfr_time_timecode_it;
604 unsigned char hk_lfr_time_timecode_it;
607 unsigned char hk_lfr_time_not_synchro;
605 unsigned char hk_lfr_time_not_synchro;
608 unsigned char hk_lfr_time_timecode_ctr;
606 unsigned char hk_lfr_time_timecode_ctr;
609 // hk_lfr_buffer_dpu_
607 // hk_lfr_buffer_dpu_
610 unsigned char hk_lfr_buffer_dpu_tc_fifo;
608 unsigned char hk_lfr_buffer_dpu_tc_fifo;
611 unsigned char hk_lfr_buffer_dpu_tm_fifo;
609 unsigned char hk_lfr_buffer_dpu_tm_fifo;
612 // hk_lfr_ahb_
610 // hk_lfr_ahb_
613 unsigned char hk_lfr_ahb_correctable;
611 unsigned char hk_lfr_ahb_correctable;
614 unsigned char hk_lfr_ahb_uncorrectable;
612 unsigned char hk_lfr_ahb_uncorrectable;
615 // spare
613 // spare
616 unsigned char parameters_spare;
614 unsigned char parameters_spare;
617 } Packet_TM_LFR_HK_t;
615 } Packet_TM_LFR_HK_t;
618
616
619 typedef struct {
617 typedef struct {
620 unsigned char targetLogicalAddress;
618 unsigned char targetLogicalAddress;
621 unsigned char protocolIdentifier;
619 unsigned char protocolIdentifier;
622 unsigned char reserved;
620 unsigned char reserved;
623 unsigned char userApplication;
621 unsigned char userApplication;
624 unsigned char packetID[2];
622 unsigned char packetID[2];
625 unsigned char packetSequenceControl[2];
623 unsigned char packetSequenceControl[2];
626 unsigned char packetLength[2];
624 unsigned char packetLength[2];
627 // DATA FIELD HEADER
625 // DATA FIELD HEADER
628 unsigned char spare1_pusVersion_spare2;
626 unsigned char spare1_pusVersion_spare2;
629 unsigned char serviceType;
627 unsigned char serviceType;
630 unsigned char serviceSubType;
628 unsigned char serviceSubType;
631 unsigned char destinationID;
629 unsigned char destinationID;
632 unsigned char time[6];
630 unsigned char time[6];
633 unsigned char sid;
631 unsigned char sid;
634
632
635 //******************
633 //******************
636 // COMMON PARAMETERS
634 // COMMON PARAMETERS
637 unsigned char unused0;
635 unsigned char unused0;
638 unsigned char bw_sp0_sp1_r0_r1;
636 unsigned char bw_sp0_sp1_r0_r1;
639
637
640 //******************
638 //******************
641 // NORMAL PARAMETERS
639 // NORMAL PARAMETERS
642 unsigned char sy_lfr_n_swf_l[2];
640 unsigned char sy_lfr_n_swf_l[2];
643 unsigned char sy_lfr_n_swf_p[2];
641 unsigned char sy_lfr_n_swf_p[2];
644 unsigned char sy_lfr_n_asm_p[2];
642 unsigned char sy_lfr_n_asm_p[2];
645 unsigned char sy_lfr_n_bp_p0;
643 unsigned char sy_lfr_n_bp_p0;
646 unsigned char sy_lfr_n_bp_p1;
644 unsigned char sy_lfr_n_bp_p1;
647 unsigned char sy_lfr_n_cwf_long_f3;
645 unsigned char sy_lfr_n_cwf_long_f3;
648 unsigned char lfr_normal_parameters_spare;
646 unsigned char lfr_normal_parameters_spare;
649
647
650 //*****************
648 //*****************
651 // BURST PARAMETERS
649 // BURST PARAMETERS
652 unsigned char sy_lfr_b_bp_p0;
650 unsigned char sy_lfr_b_bp_p0;
653 unsigned char sy_lfr_b_bp_p1;
651 unsigned char sy_lfr_b_bp_p1;
654
652
655 //****************
653 //****************
656 // SBM1 PARAMETERS
654 // SBM1 PARAMETERS
657 unsigned char sy_lfr_s1_bp_p0;
655 unsigned char sy_lfr_s1_bp_p0;
658 unsigned char sy_lfr_s1_bp_p1;
656 unsigned char sy_lfr_s1_bp_p1;
659
657
660 //****************
658 //****************
661 // SBM2 PARAMETERS
659 // SBM2 PARAMETERS
662 unsigned char sy_lfr_s2_bp_p0;
660 unsigned char sy_lfr_s2_bp_p0;
663 unsigned char sy_lfr_s2_bp_p1;
661 unsigned char sy_lfr_s2_bp_p1;
664
662
665 // SPARE
663 // SPARE
666 unsigned char source_data_spare;
664 unsigned char source_data_spare;
667 } Packet_TM_LFR_PARAMETER_DUMP_t;
665 } Packet_TM_LFR_PARAMETER_DUMP_t;
668
666
669
667
670 #endif // CCSDS_TYPES_H_INCLUDED
668 #endif // CCSDS_TYPES_H_INCLUDED
General Comments 0
You need to be logged in to leave comments. Login now