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