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