@@ -1,6 +1,6 | |||||
1 | ############################################################################# |
|
1 | ############################################################################# | |
2 | # Makefile for building: bin/fsw |
|
2 | # Makefile for building: bin/fsw | |
3 |
# Generated by qmake (2.01a) (Qt 4.8.5) on: T |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Nov 7 08:03:44 2013 | |
4 | # Project: fsw-qt.pro |
|
4 | # Project: fsw-qt.pro | |
5 | # Template: app |
|
5 | # Template: app | |
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -1,6 +1,6 | |||||
1 | <?xml version="1.0" encoding="UTF-8"?> |
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <!DOCTYPE QtCreatorProject> |
|
2 | <!DOCTYPE QtCreatorProject> | |
3 |
<!-- Written by QtCreator 2.8.1, 2013-11-0 |
|
3 | <!-- Written by QtCreator 2.8.1, 2013-11-08T07:03:44. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -121,7 +121,6 | |||||
121 | #define CCSDS_TM_VALID 7 |
|
121 | #define CCSDS_TM_VALID 7 | |
122 |
|
122 | |||
123 | // TC SID |
|
123 | // TC SID | |
124 | #define SID_TC_DEFAULT 0 // the default SID for TC sent to the LFR |
|
|||
125 | #define SID_TC_GROUND 0 |
|
124 | #define SID_TC_GROUND 0 | |
126 | #define SID_TC_MISSION_TIMELINE 110 |
|
125 | #define SID_TC_MISSION_TIMELINE 110 | |
127 | #define SID_TC_TC_SEQUENCES 111 |
|
126 | #define SID_TC_TC_SEQUENCES 111 | |
@@ -135,6 +134,25 | |||||
135 | #define SID_TC_AOCS 11 |
|
134 | #define SID_TC_AOCS 11 | |
136 | #define SID_TC_RPW_INTERNAL 254 |
|
135 | #define SID_TC_RPW_INTERNAL 254 | |
137 |
|
136 | |||
|
137 | enum apid_destid{ | |||
|
138 | GROUND, | |||
|
139 | MISSION_TIMELINE, | |||
|
140 | TC_SEQUENCES, | |||
|
141 | RECOVERY_ACTION_CMD, | |||
|
142 | BACKUP_MISSION_TIMELINE, | |||
|
143 | DIRECT_CMD, | |||
|
144 | SPARE_GRD_SRC1, | |||
|
145 | SPARE_GRD_SRC2, | |||
|
146 | OBCP, | |||
|
147 | SYSTEM_CONTROL, | |||
|
148 | AOCS, | |||
|
149 | RPW_INTERNAL, | |||
|
150 | UNKNOWN | |||
|
151 | }; | |||
|
152 | // SEQUENCE COUNTERS | |||
|
153 | #define SEQ_CNT_MAX 16383 | |||
|
154 | #define SEQ_CNT_NB_DEST_ID 12 | |||
|
155 | ||||
138 | // TM SID |
|
156 | // TM SID | |
139 | #define SID_HK 1 |
|
157 | #define SID_HK 1 | |
140 | #define SID_PARAMETER_DUMP 10 |
|
158 | #define SID_PARAMETER_DUMP 10 | |
@@ -210,301 +228,301 enum TM_TYPE{ | |||||
210 |
|
228 | |||
211 | struct TMHeader_str |
|
229 | struct TMHeader_str | |
212 | { |
|
230 | { | |
213 |
|
|
231 | unsigned char targetLogicalAddress; | |
214 |
|
|
232 | unsigned char protocolIdentifier; | |
215 |
|
|
233 | unsigned char reserved; | |
216 |
|
|
234 | unsigned char userApplication; | |
217 |
|
|
235 | unsigned char packetID[2]; | |
218 |
|
|
236 | unsigned char packetSequenceControl[2]; | |
219 |
|
|
237 | unsigned char packetLength[2]; | |
220 | // DATA FIELD HEADER |
|
238 | // DATA FIELD HEADER | |
221 |
|
|
239 | unsigned char spare1_pusVersion_spare2; | |
222 |
|
|
240 | unsigned char serviceType; | |
223 |
|
|
241 | unsigned char serviceSubType; | |
224 |
|
|
242 | unsigned char destinationID; | |
225 |
|
|
243 | unsigned char time[6]; | |
226 | }; |
|
244 | }; | |
227 | typedef struct TMHeader_str TMHeader_t; |
|
245 | typedef struct TMHeader_str TMHeader_t; | |
228 |
|
246 | |||
229 | struct Packet_TM_LFR_TC_EXE_str |
|
247 | struct Packet_TM_LFR_TC_EXE_str | |
230 | { |
|
248 | { | |
231 |
|
|
249 | unsigned char targetLogicalAddress; | |
232 |
|
|
250 | unsigned char protocolIdentifier; | |
233 |
|
|
251 | unsigned char reserved; | |
234 |
|
|
252 | unsigned char userApplication; | |
235 |
|
|
253 | unsigned char packetID[2]; | |
236 |
|
|
254 | unsigned char packetSequenceControl[2]; | |
237 |
|
|
255 | unsigned char packetLength[2]; | |
238 | // DATA FIELD HEADER |
|
256 | // DATA FIELD HEADER | |
239 |
|
|
257 | unsigned char spare1_pusVersion_spare2; | |
240 |
|
|
258 | unsigned char serviceType; | |
241 |
|
|
259 | unsigned char serviceSubType; | |
242 |
|
|
260 | unsigned char destinationID; | |
243 |
|
|
261 | unsigned char time[6]; | |
244 |
|
|
262 | unsigned char data[LENGTH_TM_LFR_TC_EXE_MAX - 10 + 1]; | |
245 | }; |
|
263 | }; | |
246 | typedef struct Packet_TM_LFR_TC_EXE_str Packet_TM_LFR_TC_EXE_t; |
|
264 | typedef struct Packet_TM_LFR_TC_EXE_str Packet_TM_LFR_TC_EXE_t; | |
247 |
|
265 | |||
248 | struct Packet_TM_LFR_TC_EXE_SUCCESS_str |
|
266 | struct Packet_TM_LFR_TC_EXE_SUCCESS_str | |
249 | { |
|
267 | { | |
250 |
|
|
268 | unsigned char targetLogicalAddress; | |
251 |
|
|
269 | unsigned char protocolIdentifier; | |
252 |
|
|
270 | unsigned char reserved; | |
253 |
|
|
271 | unsigned char userApplication; | |
254 | // PACKET HEADER |
|
272 | // PACKET HEADER | |
255 |
|
|
273 | unsigned char packetID[2]; | |
256 |
|
|
274 | unsigned char packetSequenceControl[2]; | |
257 |
|
|
275 | unsigned char packetLength[2]; | |
258 | // DATA FIELD HEADER |
|
276 | // DATA FIELD HEADER | |
259 |
|
|
277 | unsigned char spare1_pusVersion_spare2; | |
260 |
|
|
278 | unsigned char serviceType; | |
261 |
|
|
279 | unsigned char serviceSubType; | |
262 |
|
|
280 | unsigned char destinationID; | |
263 |
|
|
281 | unsigned char time[6]; | |
264 | // |
|
282 | // | |
265 |
|
|
283 | unsigned char telecommand_pkt_id[2]; | |
266 |
|
|
284 | unsigned char pkt_seq_control[2]; | |
267 | }; |
|
285 | }; | |
268 | typedef struct Packet_TM_LFR_TC_EXE_SUCCESS_str Packet_TM_LFR_TC_EXE_SUCCESS_t; |
|
286 | typedef struct Packet_TM_LFR_TC_EXE_SUCCESS_str Packet_TM_LFR_TC_EXE_SUCCESS_t; | |
269 |
|
287 | |||
270 | struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str |
|
288 | struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str | |
271 | { |
|
289 | { | |
272 |
|
|
290 | unsigned char targetLogicalAddress; | |
273 |
|
|
291 | unsigned char protocolIdentifier; | |
274 |
|
|
292 | unsigned char reserved; | |
275 |
|
|
293 | unsigned char userApplication; | |
276 | // PACKET HEADER |
|
294 | // PACKET HEADER | |
277 |
|
|
295 | unsigned char packetID[2]; | |
278 |
|
|
296 | unsigned char packetSequenceControl[2]; | |
279 |
|
|
297 | unsigned char packetLength[2]; | |
280 | // DATA FIELD HEADER |
|
298 | // DATA FIELD HEADER | |
281 |
|
|
299 | unsigned char spare1_pusVersion_spare2; | |
282 |
|
|
300 | unsigned char serviceType; | |
283 |
|
|
301 | unsigned char serviceSubType; | |
284 |
|
|
302 | unsigned char destinationID; | |
285 |
|
|
303 | unsigned char time[6]; | |
286 | // |
|
304 | // | |
287 |
|
|
305 | unsigned char tc_failure_code[2]; | |
288 |
|
|
306 | unsigned char telecommand_pkt_id[2]; | |
289 |
|
|
307 | unsigned char pkt_seq_control[2]; | |
290 |
|
|
308 | unsigned char tc_service; | |
291 |
|
|
309 | unsigned char tc_subtype; | |
292 |
|
|
310 | unsigned char byte_position; | |
293 |
|
|
311 | unsigned char rcv_value; | |
294 | }; |
|
312 | }; | |
295 | typedef struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str Packet_TM_LFR_TC_EXE_INCONSISTENT_t; |
|
313 | typedef struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str Packet_TM_LFR_TC_EXE_INCONSISTENT_t; | |
296 |
|
314 | |||
297 | struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str |
|
315 | struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str | |
298 | { |
|
316 | { | |
299 |
|
|
317 | unsigned char targetLogicalAddress; | |
300 |
|
|
318 | unsigned char protocolIdentifier; | |
301 |
|
|
319 | unsigned char reserved; | |
302 |
|
|
320 | unsigned char userApplication; | |
303 | // PACKET HEADER |
|
321 | // PACKET HEADER | |
304 |
|
|
322 | unsigned char packetID[2]; | |
305 |
|
|
323 | unsigned char packetSequenceControl[2]; | |
306 |
|
|
324 | unsigned char packetLength[2]; | |
307 | // DATA FIELD HEADER |
|
325 | // DATA FIELD HEADER | |
308 |
|
|
326 | unsigned char spare1_pusVersion_spare2; | |
309 |
|
|
327 | unsigned char serviceType; | |
310 |
|
|
328 | unsigned char serviceSubType; | |
311 |
|
|
329 | unsigned char destinationID; | |
312 |
|
|
330 | unsigned char time[6]; | |
313 | // |
|
331 | // | |
314 |
|
|
332 | unsigned char tc_failure_code[2]; | |
315 |
|
|
333 | unsigned char telecommand_pkt_id[2]; | |
316 |
|
|
334 | unsigned char pkt_seq_control[2]; | |
317 |
|
|
335 | unsigned char tc_service; | |
318 |
|
|
336 | unsigned char tc_subtype; | |
319 |
|
|
337 | unsigned char lfr_status_word[2]; | |
320 | }; |
|
338 | }; | |
321 | typedef struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t; |
|
339 | typedef struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t; | |
322 |
|
340 | |||
323 | struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str |
|
341 | struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str | |
324 | { |
|
342 | { | |
325 |
|
|
343 | unsigned char targetLogicalAddress; | |
326 |
|
|
344 | unsigned char protocolIdentifier; | |
327 |
|
|
345 | unsigned char reserved; | |
328 |
|
|
346 | unsigned char userApplication; | |
329 | // PACKET HEADER |
|
347 | // PACKET HEADER | |
330 |
|
|
348 | unsigned char packetID[2]; | |
331 |
|
|
349 | unsigned char packetSequenceControl[2]; | |
332 |
|
|
350 | unsigned char packetLength[2]; | |
333 | // DATA FIELD HEADER |
|
351 | // DATA FIELD HEADER | |
334 |
|
|
352 | unsigned char spare1_pusVersion_spare2; | |
335 |
|
|
353 | unsigned char serviceType; | |
336 |
|
|
354 | unsigned char serviceSubType; | |
337 |
|
|
355 | unsigned char destinationID; | |
338 |
|
|
356 | unsigned char time[6]; | |
339 | // |
|
357 | // | |
340 |
|
|
358 | unsigned char tc_failure_code[2]; | |
341 |
|
|
359 | unsigned char telecommand_pkt_id[2]; | |
342 |
|
|
360 | unsigned char pkt_seq_control[2]; | |
343 |
|
|
361 | unsigned char tc_service; | |
344 |
|
|
362 | unsigned char tc_subtype; | |
345 | }; |
|
363 | }; | |
346 | typedef struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t; |
|
364 | typedef struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t; | |
347 |
|
365 | |||
348 | struct Packet_TM_LFR_TC_EXE_ERROR_str |
|
366 | struct Packet_TM_LFR_TC_EXE_ERROR_str | |
349 | { |
|
367 | { | |
350 |
|
|
368 | unsigned char targetLogicalAddress; | |
351 |
|
|
369 | unsigned char protocolIdentifier; | |
352 |
|
|
370 | unsigned char reserved; | |
353 |
|
|
371 | unsigned char userApplication; | |
354 | // PACKET HEADER |
|
372 | // PACKET HEADER | |
355 |
|
|
373 | unsigned char packetID[2]; | |
356 |
|
|
374 | unsigned char packetSequenceControl[2]; | |
357 |
|
|
375 | unsigned char packetLength[2]; | |
358 | // DATA FIELD HEADER |
|
376 | // DATA FIELD HEADER | |
359 |
|
|
377 | unsigned char spare1_pusVersion_spare2; | |
360 |
|
|
378 | unsigned char serviceType; | |
361 |
|
|
379 | unsigned char serviceSubType; | |
362 |
|
|
380 | unsigned char destinationID; | |
363 |
|
|
381 | unsigned char time[6]; | |
364 | // |
|
382 | // | |
365 |
|
|
383 | unsigned char tc_failure_code[2]; | |
366 |
|
|
384 | unsigned char telecommand_pkt_id[2]; | |
367 |
|
|
385 | unsigned char pkt_seq_control[2]; | |
368 |
|
|
386 | unsigned char tc_service; | |
369 |
|
|
387 | unsigned char tc_subtype; | |
370 | }; |
|
388 | }; | |
371 | typedef struct Packet_TM_LFR_TC_EXE_ERROR_str Packet_TM_LFR_TC_EXE_ERROR_t; |
|
389 | typedef struct Packet_TM_LFR_TC_EXE_ERROR_str Packet_TM_LFR_TC_EXE_ERROR_t; | |
372 |
|
390 | |||
373 | struct Packet_TM_LFR_TC_EXE_CORRUPTED_str |
|
391 | struct Packet_TM_LFR_TC_EXE_CORRUPTED_str | |
374 | { |
|
392 | { | |
375 |
|
|
393 | unsigned char targetLogicalAddress; | |
376 |
|
|
394 | unsigned char protocolIdentifier; | |
377 |
|
|
395 | unsigned char reserved; | |
378 |
|
|
396 | unsigned char userApplication; | |
379 | // PACKET HEADER |
|
397 | // PACKET HEADER | |
380 |
|
|
398 | unsigned char packetID[2]; | |
381 |
|
|
399 | unsigned char packetSequenceControl[2]; | |
382 |
|
|
400 | unsigned char packetLength[2]; | |
383 | // DATA FIELD HEADER |
|
401 | // DATA FIELD HEADER | |
384 |
|
|
402 | unsigned char spare1_pusVersion_spare2; | |
385 |
|
|
403 | unsigned char serviceType; | |
386 |
|
|
404 | unsigned char serviceSubType; | |
387 |
|
|
405 | unsigned char destinationID; | |
388 |
|
|
406 | unsigned char time[6]; | |
389 | // |
|
407 | // | |
390 |
|
|
408 | unsigned char tc_failure_code[2]; | |
391 |
|
|
409 | unsigned char telecommand_pkt_id[2]; | |
392 |
|
|
410 | unsigned char pkt_seq_control[2]; | |
393 |
|
|
411 | unsigned char tc_service; | |
394 |
|
|
412 | unsigned char tc_subtype; | |
395 |
|
|
413 | unsigned char pkt_len_rcv_value[2]; | |
396 |
|
|
414 | unsigned char pkt_datafieldsize_cnt[2]; | |
397 |
|
|
415 | unsigned char rcv_crc[2]; | |
398 |
|
|
416 | unsigned char computed_crc[2]; | |
399 | }; |
|
417 | }; | |
400 | typedef struct Packet_TM_LFR_TC_EXE_CORRUPTED_str Packet_TM_LFR_TC_EXE_CORRUPTED_t; |
|
418 | typedef struct Packet_TM_LFR_TC_EXE_CORRUPTED_str Packet_TM_LFR_TC_EXE_CORRUPTED_t; | |
401 |
|
419 | |||
402 | struct Header_TM_LFR_SCIENCE_SWF_str |
|
420 | struct Header_TM_LFR_SCIENCE_SWF_str | |
403 | { |
|
421 | { | |
404 |
|
|
422 | unsigned char targetLogicalAddress; | |
405 |
|
|
423 | unsigned char protocolIdentifier; | |
406 |
|
|
424 | unsigned char reserved; | |
407 |
|
|
425 | unsigned char userApplication; | |
408 |
|
|
426 | unsigned char packetID[2]; | |
409 |
|
|
427 | unsigned char packetSequenceControl[2]; | |
410 |
|
|
428 | unsigned char packetLength[2]; | |
411 | // DATA FIELD HEADER |
|
429 | // DATA FIELD HEADER | |
412 |
|
|
430 | unsigned char spare1_pusVersion_spare2; | |
413 |
|
|
431 | unsigned char serviceType; | |
414 |
|
|
432 | unsigned char serviceSubType; | |
415 |
|
|
433 | unsigned char destinationID; | |
416 |
|
|
434 | unsigned char time[6]; | |
417 | // AUXILIARY HEADER |
|
435 | // AUXILIARY HEADER | |
418 |
|
|
436 | unsigned char sid; | |
419 |
|
|
437 | unsigned char hkBIA; | |
420 |
|
|
438 | unsigned char pktCnt; | |
421 |
|
|
439 | unsigned char pktNr; | |
422 |
|
|
440 | unsigned char acquisitionTime[6]; | |
423 |
|
|
441 | unsigned char blkNr[2]; | |
424 | }; |
|
442 | }; | |
425 | typedef struct Header_TM_LFR_SCIENCE_SWF_str Header_TM_LFR_SCIENCE_SWF_t; |
|
443 | typedef struct Header_TM_LFR_SCIENCE_SWF_str Header_TM_LFR_SCIENCE_SWF_t; | |
426 |
|
444 | |||
427 | struct Header_TM_LFR_SCIENCE_CWF_str |
|
445 | struct Header_TM_LFR_SCIENCE_CWF_str | |
428 | { |
|
446 | { | |
429 |
|
|
447 | unsigned char targetLogicalAddress; | |
430 |
|
|
448 | unsigned char protocolIdentifier; | |
431 |
|
|
449 | unsigned char reserved; | |
432 |
|
|
450 | unsigned char userApplication; | |
433 |
|
|
451 | unsigned char packetID[2]; | |
434 |
|
|
452 | unsigned char packetSequenceControl[2]; | |
435 |
|
|
453 | unsigned char packetLength[2]; | |
436 | // DATA FIELD HEADER |
|
454 | // DATA FIELD HEADER | |
437 |
|
|
455 | unsigned char spare1_pusVersion_spare2; | |
438 |
|
|
456 | unsigned char serviceType; | |
439 |
|
|
457 | unsigned char serviceSubType; | |
440 |
|
|
458 | unsigned char destinationID; | |
441 |
|
|
459 | unsigned char time[6]; | |
442 | // AUXILIARY DATA HEADER |
|
460 | // AUXILIARY DATA HEADER | |
443 |
|
|
461 | unsigned char sid; | |
444 |
|
|
462 | unsigned char hkBIA; | |
445 |
|
|
463 | unsigned char acquisitionTime[6]; | |
446 |
|
|
464 | unsigned char blkNr[2]; | |
447 | }; |
|
465 | }; | |
448 | typedef struct Header_TM_LFR_SCIENCE_CWF_str Header_TM_LFR_SCIENCE_CWF_t; |
|
466 | typedef struct Header_TM_LFR_SCIENCE_CWF_str Header_TM_LFR_SCIENCE_CWF_t; | |
449 |
|
467 | |||
450 | struct Header_TM_LFR_SCIENCE_ASM_str |
|
468 | struct Header_TM_LFR_SCIENCE_ASM_str | |
451 | { |
|
469 | { | |
452 |
|
|
470 | unsigned char targetLogicalAddress; | |
453 |
|
|
471 | unsigned char protocolIdentifier; | |
454 |
|
|
472 | unsigned char reserved; | |
455 |
|
|
473 | unsigned char userApplication; | |
456 |
|
|
474 | unsigned char packetID[2]; | |
457 |
|
|
475 | unsigned char packetSequenceControl[2]; | |
458 |
|
|
476 | unsigned char packetLength[2]; | |
459 | // DATA FIELD HEADER |
|
477 | // DATA FIELD HEADER | |
460 |
|
|
478 | unsigned char spare1_pusVersion_spare2; | |
461 |
|
|
479 | unsigned char serviceType; | |
462 |
|
|
480 | unsigned char serviceSubType; | |
463 |
|
|
481 | unsigned char destinationID; | |
464 |
|
|
482 | unsigned char time[6]; | |
465 | // AUXILIARY HEADER |
|
483 | // AUXILIARY HEADER | |
466 |
|
|
484 | unsigned char sid; | |
467 |
|
|
485 | unsigned char biaStatusInfo; | |
468 |
|
|
486 | unsigned char cntASM; | |
469 |
|
|
487 | unsigned char nrASM; | |
470 |
|
|
488 | unsigned char acquisitionTime[6]; | |
471 |
|
|
489 | unsigned char blkNr[2]; | |
472 | }; |
|
490 | }; | |
473 | typedef struct Header_TM_LFR_SCIENCE_ASM_str Header_TM_LFR_SCIENCE_ASM_t; |
|
491 | typedef struct Header_TM_LFR_SCIENCE_ASM_str Header_TM_LFR_SCIENCE_ASM_t; | |
474 |
|
492 | |||
475 | struct ccsdsTelecommandPacket_str |
|
493 | struct ccsdsTelecommandPacket_str | |
476 | { |
|
494 | { | |
477 | //unsigned char targetLogicalAddress; // removed by the grspw module |
|
495 | //unsigned char targetLogicalAddress; // removed by the grspw module | |
478 |
|
|
496 | unsigned char protocolIdentifier; | |
479 |
|
|
497 | unsigned char reserved; | |
480 |
|
|
498 | unsigned char userApplication; | |
481 |
|
|
499 | unsigned char packetID[2]; | |
482 |
|
|
500 | unsigned char packetSequenceControl[2]; | |
483 |
|
|
501 | unsigned char packetLength[2]; | |
484 | // DATA FIELD HEADER |
|
502 | // DATA FIELD HEADER | |
485 |
|
|
503 | unsigned char headerFlag_pusVersion_Ack; | |
486 |
|
|
504 | unsigned char serviceType; | |
487 |
|
|
505 | unsigned char serviceSubType; | |
488 |
|
|
506 | unsigned char sourceID; | |
489 |
|
|
507 | unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10]; | |
490 | }; |
|
508 | }; | |
491 | typedef struct ccsdsTelecommandPacket_str ccsdsTelecommandPacket_t; |
|
509 | typedef struct ccsdsTelecommandPacket_str ccsdsTelecommandPacket_t; | |
492 |
|
510 | |||
493 | struct Packet_TM_LFR_HK_str |
|
511 | struct Packet_TM_LFR_HK_str | |
494 | { |
|
512 | { | |
495 |
|
|
513 | unsigned char targetLogicalAddress; | |
496 |
|
|
514 | unsigned char protocolIdentifier; | |
497 |
|
|
515 | unsigned char reserved; | |
498 |
|
|
516 | unsigned char userApplication; | |
499 |
|
|
517 | unsigned char packetID[2]; | |
500 |
|
|
518 | unsigned char packetSequenceControl[2]; | |
501 |
|
|
519 | unsigned char packetLength[2]; | |
502 |
|
|
520 | unsigned char spare1_pusVersion_spare2; | |
503 |
|
|
521 | unsigned char serviceType; | |
504 |
|
|
522 | unsigned char serviceSubType; | |
505 |
|
|
523 | unsigned char destinationID; | |
506 |
|
|
524 | unsigned char time[6]; | |
507 |
|
|
525 | unsigned char sid; | |
508 |
|
526 | |||
509 | //************** |
|
527 | //************** | |
510 | // HK PARAMETERS |
|
528 | // HK PARAMETERS | |
@@ -539,7 +557,7 struct Packet_TM_LFR_HK_str | |||||
539 | unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2]; |
|
557 | unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2]; | |
540 | unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2]; |
|
558 | unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2]; | |
541 | unsigned char hk_lfr_dpu_spw_tick_out_cnt; |
|
559 | unsigned char hk_lfr_dpu_spw_tick_out_cnt; | |
542 |
unsigned char hk_lfr_dpu_spw_last_tim |
|
560 | unsigned char hk_lfr_dpu_spw_last_time; | |
543 | // ahb error statistics |
|
561 | // ahb error statistics | |
544 | unsigned int hk_lfr_last_fail_addr; |
|
562 | unsigned int hk_lfr_last_fail_addr; | |
545 | // temperatures |
|
563 | // temperatures | |
@@ -594,48 +612,48 typedef struct Packet_TM_LFR_HK_str Pack | |||||
594 |
|
612 | |||
595 | struct Packet_TM_LFR_PARAMETER_DUMP_str |
|
613 | struct Packet_TM_LFR_PARAMETER_DUMP_str | |
596 | { |
|
614 | { | |
597 |
|
|
615 | unsigned char targetLogicalAddress; | |
598 |
|
|
616 | unsigned char protocolIdentifier; | |
599 |
|
|
617 | unsigned char reserved; | |
600 |
|
|
618 | unsigned char userApplication; | |
601 |
|
|
619 | unsigned char packetID[2]; | |
602 |
|
|
620 | unsigned char packetSequenceControl[2]; | |
603 |
|
|
621 | unsigned char packetLength[2]; | |
604 | // DATA FIELD HEADER |
|
622 | // DATA FIELD HEADER | |
605 |
|
|
623 | unsigned char spare1_pusVersion_spare2; | |
606 |
|
|
624 | unsigned char serviceType; | |
607 |
|
|
625 | unsigned char serviceSubType; | |
608 |
|
|
626 | unsigned char destinationID; | |
609 |
|
|
627 | unsigned char time[6]; | |
610 |
|
|
628 | unsigned char sid; | |
611 |
|
629 | |||
612 | //****************** |
|
630 | //****************** | |
613 | // COMMON PARAMETERS |
|
631 | // COMMON PARAMETERS | |
614 |
|
|
632 | unsigned char unused0; | |
615 |
|
|
633 | unsigned char bw_sp0_sp1_r0_r1; | |
616 |
|
634 | |||
617 | //****************** |
|
635 | //****************** | |
618 | // NORMAL PARAMETERS |
|
636 | // NORMAL PARAMETERS | |
619 |
|
|
637 | unsigned char sy_lfr_n_swf_l[2]; | |
620 |
|
|
638 | unsigned char sy_lfr_n_swf_p[2]; | |
621 |
|
|
639 | unsigned char sy_lfr_n_asm_p[2]; | |
622 |
|
|
640 | unsigned char sy_lfr_n_bp_p0; | |
623 |
|
|
641 | unsigned char sy_lfr_n_bp_p1; | |
624 |
|
642 | |||
625 | //***************** |
|
643 | //***************** | |
626 | // BURST PARAMETERS |
|
644 | // BURST PARAMETERS | |
627 |
|
|
645 | unsigned char sy_lfr_b_bp_p0; | |
628 |
|
|
646 | unsigned char sy_lfr_b_bp_p1; | |
629 |
|
647 | |||
630 | //**************** |
|
648 | //**************** | |
631 | // SBM1 PARAMETERS |
|
649 | // SBM1 PARAMETERS | |
632 |
|
|
650 | unsigned char sy_lfr_s1_bp_p0; | |
633 |
|
|
651 | unsigned char sy_lfr_s1_bp_p1; | |
634 |
|
652 | |||
635 | //**************** |
|
653 | //**************** | |
636 | // SBM2 PARAMETERS |
|
654 | // SBM2 PARAMETERS | |
637 |
|
|
655 | unsigned char sy_lfr_s2_bp_p0; | |
638 |
|
|
656 | unsigned char sy_lfr_s2_bp_p1; | |
639 | }; |
|
657 | }; | |
640 | typedef struct Packet_TM_LFR_PARAMETER_DUMP_str Packet_TM_LFR_PARAMETER_DUMP_t; |
|
658 | typedef struct Packet_TM_LFR_PARAMETER_DUMP_str Packet_TM_LFR_PARAMETER_DUMP_t; | |
641 |
|
659 |
@@ -24,16 +24,20 extern unsigned char lfrCurrentMode; | |||||
24 | // MODE PARAMETERS |
|
24 | // MODE PARAMETERS | |
25 | extern struct param_local_str param_local; |
|
25 | extern struct param_local_str param_local; | |
26 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
|
26 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; | |
27 |
extern unsigned short sequenceCounters |
|
27 | extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; | |
|
28 | extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; | |||
|
29 | extern unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID]; | |||
28 |
|
30 | |||
29 | // RTEMS TASKS |
|
31 | // RTEMS TASKS | |
30 | rtems_task Init( rtems_task_argument argument); |
|
32 | rtems_task Init( rtems_task_argument argument); | |
31 |
|
33 | |||
32 | // OTHER functions |
|
34 | // OTHER functions | |
33 | void create_names( void ); |
|
35 | void create_names( void ); | |
34 | rtems_status_code create_message_queues( void ); |
|
|||
35 | int create_all_tasks( void ); |
|
36 | int create_all_tasks( void ); | |
36 | int start_all_tasks( void ); |
|
37 | int start_all_tasks( void ); | |
|
38 | // | |||
|
39 | rtems_status_code create_message_queues( void ); | |||
|
40 | // | |||
37 | int start_recv_send_tasks( void ); |
|
41 | int start_recv_send_tasks( void ); | |
38 | // |
|
42 | // | |
39 | void init_local_mode_parameters( void ); |
|
43 | void init_local_mode_parameters( void ); |
@@ -32,4 +32,6 rtems_task dumb_task( rtems_task_argumen | |||||
32 |
|
32 | |||
33 | void init_housekeeping_parameters( void ); |
|
33 | void init_housekeeping_parameters( void ); | |
34 |
|
34 | |||
|
35 | void increment_seq_counter( unsigned char *packet_sequence_control); | |||
|
36 | ||||
35 | #endif // FSW_MISC_H_INCLUDED |
|
37 | #endif // FSW_MISC_H_INCLUDED |
@@ -148,6 +148,8 | |||||
148 | #define TASK_PRIORITY_STAT 200 |
|
148 | #define TASK_PRIORITY_STAT 200 | |
149 | #define TASK_PRIORITY_DUMB 200 |
|
149 | #define TASK_PRIORITY_DUMB 200 | |
150 |
|
150 | |||
|
151 | #define SEMQ_PRIORITY_CEILING 30 | |||
|
152 | ||||
151 | #define ACTION_MSG_QUEUE_COUNT 10 |
|
153 | #define ACTION_MSG_QUEUE_COUNT 10 | |
152 | #define ACTION_MSG_PKTS_COUNT 50 |
|
154 | #define ACTION_MSG_PKTS_COUNT 50 | |
153 | #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES) |
|
155 | #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES) | |
@@ -198,32 +200,6 | |||||
198 | #define NB_BYTES_CWF3_LIGHT_BLK 6 |
|
200 | #define NB_BYTES_CWF3_LIGHT_BLK 6 | |
199 | #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8 |
|
201 | #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8 | |
200 |
|
202 | |||
201 | //****************** |
|
|||
202 | // SEQUENCE COUNTERS |
|
|||
203 | #define SEQ_CNT_NB_PID 2 |
|
|||
204 | #define SEQ_CNT_NB_CAT 4 |
|
|||
205 | #define SEQ_CNT_NB_DEST_ID 11 |
|
|||
206 | // pid |
|
|||
207 | #define SEQ_CNT_PID_76 0 |
|
|||
208 | #define SEQ_CNT_PID_79 1 |
|
|||
209 | //cat |
|
|||
210 | #define SEQ_CNT_CAT_1 0 |
|
|||
211 | #define SEQ_CNT_CAT_4 1 |
|
|||
212 | #define SEQ_CNT_CAT_9 2 |
|
|||
213 | #define SEQ_CNT_CAT_12 3 |
|
|||
214 | // destination id |
|
|||
215 | #define SEQ_CNT_DST_ID_GROUND 0 |
|
|||
216 | #define SEQ_CNT_DST_ID_MISSION_TIMELINE 1 |
|
|||
217 | #define SEQ_CNT_DST_ID_TC_SEQUENCES 2 |
|
|||
218 | #define SEQ_CNT_DST_ID_RECOVERY_ACTION_CMD 3 |
|
|||
219 | #define SEQ_CNT_DST_ID_BACKUP_MISSION_TIMELINE 4 |
|
|||
220 | #define SEQ_CNT_DST_ID_DIRECT_CMD 5 |
|
|||
221 | #define SEQ_CNT_DST_ID_SPARE_GRD_SRC1 6 |
|
|||
222 | #define SEQ_CNT_DST_ID_SPARE_GRD_SRC2 7 |
|
|||
223 | #define SEQ_CNT_DST_ID_OBCP 8 |
|
|||
224 | #define SEQ_CNT_DST_ID_SYSTEM_CONTROL 9 |
|
|||
225 | #define SEQ_CNT_DST_ID_AOCS 10 |
|
|||
226 |
|
||||
227 | struct param_local_str{ |
|
203 | struct param_local_str{ | |
228 | unsigned int local_sbm1_nb_cwf_sent; |
|
204 | unsigned int local_sbm1_nb_cwf_sent; | |
229 | unsigned int local_sbm1_nb_cwf_max; |
|
205 | unsigned int local_sbm1_nb_cwf_max; |
@@ -6,8 +6,10 | |||||
6 | #include <math.h> |
|
6 | #include <math.h> | |
7 | #include <stdlib.h> // abs() is in the stdlib |
|
7 | #include <stdlib.h> // abs() is in the stdlib | |
8 | #include <stdio.h> // printf() |
|
8 | #include <stdio.h> // printf() | |
|
9 | #include <math.h> | |||
9 |
|
10 | |||
10 | #include "fsw_params.h" |
|
11 | #include "fsw_params.h" | |
|
12 | #include "fsw_spacewire.h" | |||
11 |
|
13 | |||
12 |
|
14 | |||
13 | extern volatile int spec_mat_f0_0[ ]; |
|
15 | extern volatile int spec_mat_f0_0[ ]; |
@@ -7,6 +7,7 | |||||
7 | #include "fsw_params.h" |
|
7 | #include "fsw_params.h" | |
8 | #include "wf_handler.h" |
|
8 | #include "wf_handler.h" | |
9 | #include "tm_lfr_tc_exe.h" |
|
9 | #include "tm_lfr_tc_exe.h" | |
|
10 | #include "fsw_misc.h" | |||
10 |
|
11 | |||
11 | extern int fdSPW; |
|
12 | extern int fdSPW; | |
12 | extern unsigned char lfrCurrentMode; |
|
13 | extern unsigned char lfrCurrentMode; |
@@ -5,9 +5,11 | |||||
5 | #include <stdio.h> |
|
5 | #include <stdio.h> | |
6 |
|
6 | |||
7 | #include "fsw_params.h" |
|
7 | #include "fsw_params.h" | |
|
8 | #include "fsw_spacewire.h" | |||
8 |
|
9 | |||
9 | extern time_management_regs_t *time_management_regs; |
|
10 | extern time_management_regs_t *time_management_regs; | |
10 | extern Packet_TM_LFR_HK_t housekeeping_packet; |
|
11 | extern Packet_TM_LFR_HK_t housekeeping_packet; | |
|
12 | extern unsigned short sequenceCounters_TC_EXE[]; | |||
11 |
|
13 | |||
12 | int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); |
|
14 | int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); | |
13 | int send_tm_lfr_tc_exe_inconsistent(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, |
|
15 | int send_tm_lfr_tc_exe_inconsistent(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, | |
@@ -18,6 +20,8 int send_tm_lfr_tc_exe_error(ccsdsTeleco | |||||
18 | int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, |
|
20 | int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, | |
19 | unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV); |
|
21 | unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV); | |
20 |
|
22 | |||
|
23 | void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id ); | |||
|
24 | ||||
21 | #endif // TM_LFR_TC_EXE_H_INCLUDED |
|
25 | #endif // TM_LFR_TC_EXE_H_INCLUDED | |
22 |
|
26 | |||
23 |
|
27 |
@@ -7,6 +7,8 | |||||
7 | #include <math.h> |
|
7 | #include <math.h> | |
8 |
|
8 | |||
9 | #include "fsw_params.h" |
|
9 | #include "fsw_params.h" | |
|
10 | #include "fsw_spacewire.h" | |||
|
11 | #include "fsw_misc.h" | |||
10 |
|
12 | |||
11 | #define pi 3.1415 |
|
13 | #define pi 3.1415 | |
12 |
|
14 | |||
@@ -31,6 +33,9 extern Packet_TM_LFR_HK_t housekeeping_p | |||||
31 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
|
33 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; | |
32 | extern struct param_local_str param_local; |
|
34 | extern struct param_local_str param_local; | |
33 |
|
35 | |||
|
36 | extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; | |||
|
37 | extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; | |||
|
38 | ||||
34 | extern rtems_name misc_name[5]; |
|
39 | extern rtems_name misc_name[5]; | |
35 | extern rtems_name Task_name[20]; /* array of task ids */ |
|
40 | extern rtems_name Task_name[20]; /* array of task ids */ | |
36 | extern rtems_id Task_id[20]; /* array of task ids */ |
|
41 | extern rtems_id Task_id[20]; /* array of task ids */ | |
@@ -78,4 +83,6 void set_local_nb_interrupt_f0_MAX(); | |||||
78 | void reset_local_sbm1_nb_cwf_sent(); |
|
83 | void reset_local_sbm1_nb_cwf_sent(); | |
79 | void reset_local_sbm2_nb_cwf_sent(); |
|
84 | void reset_local_sbm2_nb_cwf_sent(); | |
80 |
|
85 | |||
|
86 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ); | |||
|
87 | ||||
81 | #endif // WF_HANDLER_H_INCLUDED |
|
88 | #endif // WF_HANDLER_H_INCLUDED |
@@ -83,7 +83,9 struct param_local_str param_local; | |||||
83 | // HK PACKETS |
|
83 | // HK PACKETS | |
84 | Packet_TM_LFR_HK_t housekeeping_packet; |
|
84 | Packet_TM_LFR_HK_t housekeeping_packet; | |
85 | // sequence counters are incremented by APID (PID + CAT) and destination ID |
|
85 | // sequence counters are incremented by APID (PID + CAT) and destination ID | |
86 | unsigned short sequenceCounters[SEQ_CNT_NB_PID][SEQ_CNT_NB_CAT][SEQ_CNT_NB_DEST_ID]; |
|
86 | unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; | |
|
87 | unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; | |||
|
88 | unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID]; | |||
87 | spw_stats spacewire_stats; |
|
89 | spw_stats spacewire_stats; | |
88 | spw_stats spacewire_stats_backup; |
|
90 | spw_stats spacewire_stats_backup; | |
89 |
|
91 |
@@ -197,8 +197,6 void init_local_mode_parameters( void ) | |||||
197 | */ |
|
197 | */ | |
198 |
|
198 | |||
199 | unsigned int i; |
|
199 | unsigned int i; | |
200 | unsigned int j; |
|
|||
201 | unsigned int k; |
|
|||
202 |
|
200 | |||
203 | // LOCAL PARAMETERS |
|
201 | // LOCAL PARAMETERS | |
204 | set_local_sbm1_nb_cwf_max(); |
|
202 | set_local_sbm1_nb_cwf_max(); | |
@@ -213,16 +211,13 void init_local_mode_parameters( void ) | |||||
213 | reset_local_sbm2_nb_cwf_sent(); |
|
211 | reset_local_sbm2_nb_cwf_sent(); | |
214 |
|
212 | |||
215 | // init sequence counters |
|
213 | // init sequence counters | |
216 | for (i = 0; i<SEQ_CNT_NB_PID; i++) |
|
214 | ||
217 | { |
|
215 | for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++) | |
218 | for(j = 0; j<SEQ_CNT_NB_CAT; j++) |
|
|||
219 |
|
|
216 | { | |
220 | for(k = 0; k<SEQ_CNT_NB_DEST_ID; k++) |
|
217 | sequenceCounters_TC_EXE[i] = 0x00; | |
221 | { |
|
|||
222 | sequenceCounters[i][j][k] = 0x00; |
|
|||
223 | } |
|
218 | } | |
224 | } |
|
219 | sequenceCounters_SCIENCE_NORMAL_BURST = 0x00; | |
225 | } |
|
220 | sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00; | |
226 | } |
|
221 | } | |
227 |
|
222 | |||
228 | void create_names( void ) // create all names for tasks and queues |
|
223 | void create_names( void ) // create all names for tasks and queues | |
@@ -352,7 +347,7 int create_all_tasks( void ) // create a | |||||
352 | { |
|
347 | { | |
353 | status = rtems_task_create( |
|
348 | status = rtems_task_create( | |
354 | Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE, |
|
349 | Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE, | |
355 | RTEMS_DEFAULT_MODES, |
|
350 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
356 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS] |
|
351 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS] | |
357 | ); |
|
352 | ); | |
358 | } |
|
353 | } | |
@@ -589,4 +584,3 rtems_status_code create_message_queues( | |||||
589 |
|
584 | |||
590 | return ret; |
|
585 | return ret; | |
591 | } |
|
586 | } | |
592 |
|
@@ -204,6 +204,7 rtems_task hous_task(rtems_task_argument | |||||
204 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_6 ); |
|
204 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_6 ); | |
205 | } |
|
205 | } | |
206 | else { |
|
206 | else { | |
|
207 | increment_seq_counter( housekeeping_packet.packetSequenceControl ); | |||
207 | housekeeping_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
208 | housekeeping_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
208 | housekeeping_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
209 | housekeeping_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
209 | housekeeping_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
210 | housekeeping_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
@@ -215,7 +216,7 rtems_task hous_task(rtems_task_argument | |||||
215 | spacewire_update_statistics(); |
|
216 | spacewire_update_statistics(); | |
216 |
|
217 | |||
217 | // SEND PACKET |
|
218 | // SEND PACKET | |
218 |
status = rtems_message_queue_ |
|
219 | status = rtems_message_queue_send( queue_id, &housekeeping_packet, | |
219 | PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES); |
|
220 | PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES); | |
220 | if (status != RTEMS_SUCCESSFUL) { |
|
221 | if (status != RTEMS_SUCCESSFUL) { | |
221 | PRINTF1("in HOUS *** ERR send: %d\n", status) |
|
222 | PRINTF1("in HOUS *** ERR send: %d\n", status) | |
@@ -293,3 +294,32 void init_housekeeping_parameters( void | |||||
293 |
|
294 | |||
294 | } |
|
295 | } | |
295 |
|
296 | |||
|
297 | void increment_seq_counter( unsigned char *packet_sequence_control) | |||
|
298 | { | |||
|
299 | unsigned short sequence_cnt; | |||
|
300 | unsigned short segmentation_grouping_flag; | |||
|
301 | unsigned short new_packet_sequence_control; | |||
|
302 | ||||
|
303 | segmentation_grouping_flag = (unsigned short) ( (packet_sequence_control[0] & 0xc0) << 8 ); // keep bits 7 downto 6 | |||
|
304 | sequence_cnt = (unsigned short) ( | |||
|
305 | ( (packet_sequence_control[0] & 0x3f) << 8 ) // keep bits 5 downto 0 | |||
|
306 | + packet_sequence_control[1] | |||
|
307 | ); | |||
|
308 | ||||
|
309 | if ( sequence_cnt < SEQ_CNT_MAX) | |||
|
310 | { | |||
|
311 | sequence_cnt = sequence_cnt + 1; | |||
|
312 | } | |||
|
313 | else | |||
|
314 | { | |||
|
315 | sequence_cnt = 0; | |||
|
316 | } | |||
|
317 | ||||
|
318 | new_packet_sequence_control = segmentation_grouping_flag | sequence_cnt ; | |||
|
319 | ||||
|
320 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); | |||
|
321 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); | |||
|
322 | } | |||
|
323 | ||||
|
324 | ||||
|
325 |
@@ -8,7 +8,6 | |||||
8 | */ |
|
8 | */ | |
9 |
|
9 | |||
10 | #include <fsw_processing.h> |
|
10 | #include <fsw_processing.h> | |
11 | #include <math.h> |
|
|||
12 |
|
11 | |||
13 | #include "fsw_processing_globals.c" |
|
12 | #include "fsw_processing_globals.c" | |
14 |
|
13 |
@@ -21,6 +21,9 char *lstates[6] = {"Error-reset", | |||||
21 | "Run" |
|
21 | "Run" | |
22 | }; |
|
22 | }; | |
23 |
|
23 | |||
|
24 | rtems_name semq_name; | |||
|
25 | rtems_id semq_id; | |||
|
26 | ||||
24 | //*********** |
|
27 | //*********** | |
25 | // RTEMS TASK |
|
28 | // RTEMS TASK | |
26 | rtems_task spiq_task(rtems_task_argument unused) |
|
29 | rtems_task spiq_task(rtems_task_argument unused) | |
@@ -600,3 +603,21 rtems_timer_service_routine user_routine | |||||
600 | status = RTEMS_SUCCESSFUL; |
|
603 | status = RTEMS_SUCCESSFUL; | |
601 | } |
|
604 | } | |
602 | } |
|
605 | } | |
|
606 | ||||
|
607 | rtems_status_code rtems_message_queue_send_lfr( rtems_id id, const void *buffer, size_t size ) | |||
|
608 | { | |||
|
609 | rtems_status_code status; | |||
|
610 | rtems_mode previous_mode_set; | |||
|
611 | ||||
|
612 | // set the preemption OFF | |||
|
613 | status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &previous_mode_set ); | |||
|
614 | ||||
|
615 | // use the message queue | |||
|
616 | status = rtems_message_queue_send_lfr( id, buffer, size ); | |||
|
617 | ||||
|
618 | // set the preemption ON | |||
|
619 | status = rtems_task_mode( RTEMS_PREEMPT , RTEMS_PREEMPT_MASK, &previous_mode_set ); | |||
|
620 | ||||
|
621 | return status; | |||
|
622 | } | |||
|
623 |
@@ -212,6 +212,7 int action_dump_par( rtems_id queue_id ) | |||||
212 | int status; |
|
212 | int status; | |
213 |
|
213 | |||
214 | // UPDATE TIME |
|
214 | // UPDATE TIME | |
|
215 | increment_seq_counter( parameter_dump_packet.packetSequenceControl ); | |||
215 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
216 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
216 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
217 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
217 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
218 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
@@ -43,8 +43,7 int send_tm_lfr_tc_exe_success( ccsdsTel | |||||
43 | // PACKET HEADER |
|
43 | // PACKET HEADER | |
44 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); |
|
44 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); | |
45 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); |
|
45 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); | |
46 | TM.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
46 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
47 | TM.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
|||
48 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_SUCCESS >> 8); |
|
47 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_SUCCESS >> 8); | |
49 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_SUCCESS ); |
|
48 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_SUCCESS ); | |
50 | // DATA FIELD HEADER |
|
49 | // DATA FIELD HEADER | |
@@ -67,7 +66,7 int send_tm_lfr_tc_exe_success( ccsdsTel | |||||
67 | messageSize = PACKET_LENGTH_TC_EXE_SUCCESS + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
66 | messageSize = PACKET_LENGTH_TC_EXE_SUCCESS + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
68 |
|
67 | |||
69 | // SEND DATA |
|
68 | // SEND DATA | |
70 |
status = rtems_message_queue_ |
|
69 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
71 | if (status != RTEMS_SUCCESSFUL) { |
|
70 | if (status != RTEMS_SUCCESSFUL) { | |
72 | PRINTF("in send_tm_lfr_tc_exe_success *** ERR\n") |
|
71 | PRINTF("in send_tm_lfr_tc_exe_success *** ERR\n") | |
73 | } |
|
72 | } | |
@@ -106,15 +105,14 int send_tm_lfr_tc_exe_inconsistent( ccs | |||||
106 | // PACKET HEADER |
|
105 | // PACKET HEADER | |
107 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); |
|
106 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); | |
108 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); |
|
107 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); | |
109 | TM.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
108 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
110 | TM.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
|||
111 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT >> 8); |
|
109 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT >> 8); | |
112 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT ); |
|
110 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT ); | |
113 | // DATA FIELD HEADER |
|
111 | // DATA FIELD HEADER | |
114 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
112 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
115 | TM.serviceType = TM_TYPE_TC_EXE; |
|
113 | TM.serviceType = TM_TYPE_TC_EXE; | |
116 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
114 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
117 | TM.destinationID = TM_DESTINATION_ID_GROUND; // default destination id |
|
115 | TM.destinationID = TC->sourceID; | |
118 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
116 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
119 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
117 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
120 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
118 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
@@ -136,7 +134,7 int send_tm_lfr_tc_exe_inconsistent( ccs | |||||
136 | messageSize = PACKET_LENGTH_TC_EXE_INCONSISTENT + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
134 | messageSize = PACKET_LENGTH_TC_EXE_INCONSISTENT + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
137 |
|
135 | |||
138 | // SEND DATA |
|
136 | // SEND DATA | |
139 |
status = rtems_message_queue_ |
|
137 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
140 | if (status != RTEMS_SUCCESSFUL) { |
|
138 | if (status != RTEMS_SUCCESSFUL) { | |
141 | PRINTF("in send_tm_lfr_tc_exe_inconsistent *** ERR\n") |
|
139 | PRINTF("in send_tm_lfr_tc_exe_inconsistent *** ERR\n") | |
142 | } |
|
140 | } | |
@@ -172,15 +170,14 int send_tm_lfr_tc_exe_not_executable( c | |||||
172 | // PACKET HEADER |
|
170 | // PACKET HEADER | |
173 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); |
|
171 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); | |
174 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); |
|
172 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); | |
175 | TM.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
173 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
176 | TM.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
|||
177 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE >> 8); |
|
174 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE >> 8); | |
178 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE ); |
|
175 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE ); | |
179 | // DATA FIELD HEADER |
|
176 | // DATA FIELD HEADER | |
180 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
177 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
181 | TM.serviceType = TM_TYPE_TC_EXE; |
|
178 | TM.serviceType = TM_TYPE_TC_EXE; | |
182 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
179 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
183 |
TM.destinationID = T |
|
180 | TM.destinationID = TC->sourceID; // default destination id | |
184 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
181 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
185 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
182 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
186 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
183 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
@@ -202,7 +199,7 int send_tm_lfr_tc_exe_not_executable( c | |||||
202 | messageSize = PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
199 | messageSize = PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
203 |
|
200 | |||
204 | // SEND DATA |
|
201 | // SEND DATA | |
205 |
status = rtems_message_queue_ |
|
202 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
206 | if (status != RTEMS_SUCCESSFUL) { |
|
203 | if (status != RTEMS_SUCCESSFUL) { | |
207 | PRINTF("in send_tm_lfr_tc_exe_not_executable *** ERR\n") |
|
204 | PRINTF("in send_tm_lfr_tc_exe_not_executable *** ERR\n") | |
208 | } |
|
205 | } | |
@@ -238,15 +235,14 int send_tm_lfr_tc_exe_not_implemented( | |||||
238 | // PACKET HEADER |
|
235 | // PACKET HEADER | |
239 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); |
|
236 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); | |
240 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); |
|
237 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); | |
241 | TM.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
238 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
242 | TM.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
|||
243 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED >> 8); |
|
239 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED >> 8); | |
244 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED ); |
|
240 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED ); | |
245 | // DATA FIELD HEADER |
|
241 | // DATA FIELD HEADER | |
246 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
242 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
247 | TM.serviceType = TM_TYPE_TC_EXE; |
|
243 | TM.serviceType = TM_TYPE_TC_EXE; | |
248 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
244 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
249 |
TM.destinationID = T |
|
245 | TM.destinationID = TC->sourceID; // default destination id | |
250 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
246 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
251 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
247 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
252 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
248 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
@@ -266,7 +262,7 int send_tm_lfr_tc_exe_not_implemented( | |||||
266 | messageSize = PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
262 | messageSize = PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
267 |
|
263 | |||
268 | // SEND DATA |
|
264 | // SEND DATA | |
269 |
status = rtems_message_queue_ |
|
265 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
270 | if (status != RTEMS_SUCCESSFUL) { |
|
266 | if (status != RTEMS_SUCCESSFUL) { | |
271 | PRINTF("in send_tm_lfr_tc_exe_not_implemented *** ERR\n") |
|
267 | PRINTF("in send_tm_lfr_tc_exe_not_implemented *** ERR\n") | |
272 | } |
|
268 | } | |
@@ -302,15 +298,14 int send_tm_lfr_tc_exe_error( ccsdsTelec | |||||
302 | // PACKET HEADER |
|
298 | // PACKET HEADER | |
303 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); |
|
299 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); | |
304 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); |
|
300 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); | |
305 | TM.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
301 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
306 | TM.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
|||
307 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR >> 8); |
|
302 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR >> 8); | |
308 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR ); |
|
303 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR ); | |
309 | // DATA FIELD HEADER |
|
304 | // DATA FIELD HEADER | |
310 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
305 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
311 | TM.serviceType = TM_TYPE_TC_EXE; |
|
306 | TM.serviceType = TM_TYPE_TC_EXE; | |
312 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
307 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
313 |
TM.destinationID = T |
|
308 | TM.destinationID = TC->sourceID; // default destination id | |
314 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
309 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
315 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
310 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
316 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
311 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
@@ -330,7 +325,7 int send_tm_lfr_tc_exe_error( ccsdsTelec | |||||
330 | messageSize = PACKET_LENGTH_TC_EXE_ERROR + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
325 | messageSize = PACKET_LENGTH_TC_EXE_ERROR + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
331 |
|
326 | |||
332 | // SEND DATA |
|
327 | // SEND DATA | |
333 |
status = rtems_message_queue_ |
|
328 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
334 | if (status != RTEMS_SUCCESSFUL) { |
|
329 | if (status != RTEMS_SUCCESSFUL) { | |
335 | PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n") |
|
330 | PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n") | |
336 | } |
|
331 | } | |
@@ -374,15 +369,14 int send_tm_lfr_tc_exe_corrupted(ccsdsTe | |||||
374 | // PACKET HEADER |
|
369 | // PACKET HEADER | |
375 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); |
|
370 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); | |
376 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); |
|
371 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); | |
377 | TM.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
372 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
378 | TM.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
|||
379 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED >> 8); |
|
373 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED >> 8); | |
380 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED ); |
|
374 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED ); | |
381 | // DATA FIELD HEADER |
|
375 | // DATA FIELD HEADER | |
382 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
376 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
383 | TM.serviceType = TM_TYPE_TC_EXE; |
|
377 | TM.serviceType = TM_TYPE_TC_EXE; | |
384 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
378 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
385 |
TM.destinationID = T |
|
379 | TM.destinationID = TC->sourceID; // default destination id | |
386 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
380 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
387 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
381 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
388 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
382 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
@@ -410,10 +404,87 int send_tm_lfr_tc_exe_corrupted(ccsdsTe | |||||
410 | messageSize = PACKET_LENGTH_TC_EXE_CORRUPTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
404 | messageSize = PACKET_LENGTH_TC_EXE_CORRUPTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
411 |
|
405 | |||
412 | // SEND DATA |
|
406 | // SEND DATA | |
413 |
status = rtems_message_queue_ |
|
407 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
414 | if (status != RTEMS_SUCCESSFUL) { |
|
408 | if (status != RTEMS_SUCCESSFUL) { | |
415 | PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n") |
|
409 | PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n") | |
416 | } |
|
410 | } | |
417 |
|
411 | |||
418 | return status; |
|
412 | return status; | |
419 | } |
|
413 | } | |
|
414 | ||||
|
415 | void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id ) | |||
|
416 | { | |||
|
417 | unsigned short sequence_cnt; | |||
|
418 | unsigned short segmentation_grouping_flag; | |||
|
419 | unsigned short new_packet_sequence_control; | |||
|
420 | unsigned char i; | |||
|
421 | ||||
|
422 | switch (destination_id) | |||
|
423 | { | |||
|
424 | case SID_TC_GROUND: | |||
|
425 | i = GROUND; | |||
|
426 | break; | |||
|
427 | case SID_TC_MISSION_TIMELINE: | |||
|
428 | i = MISSION_TIMELINE; | |||
|
429 | break; | |||
|
430 | case SID_TC_TC_SEQUENCES: | |||
|
431 | i = TC_SEQUENCES; | |||
|
432 | break; | |||
|
433 | case SID_TC_RECOVERY_ACTION_CMD: | |||
|
434 | i = RECOVERY_ACTION_CMD; | |||
|
435 | break; | |||
|
436 | case SID_TC_BACKUP_MISSION_TIMELINE: | |||
|
437 | i = BACKUP_MISSION_TIMELINE; | |||
|
438 | break; | |||
|
439 | case SID_TC_DIRECT_CMD: | |||
|
440 | i = DIRECT_CMD; | |||
|
441 | break; | |||
|
442 | case SID_TC_SPARE_GRD_SRC1: | |||
|
443 | i = SPARE_GRD_SRC1; | |||
|
444 | break; | |||
|
445 | case SID_TC_SPARE_GRD_SRC2: | |||
|
446 | i = SPARE_GRD_SRC2; | |||
|
447 | break; | |||
|
448 | case SID_TC_OBCP: | |||
|
449 | i = OBCP; | |||
|
450 | break; | |||
|
451 | case SID_TC_SYSTEM_CONTROL: | |||
|
452 | i = SYSTEM_CONTROL; | |||
|
453 | break; | |||
|
454 | case SID_TC_AOCS: | |||
|
455 | i = AOCS; | |||
|
456 | break; | |||
|
457 | case SID_TC_RPW_INTERNAL: | |||
|
458 | i = RPW_INTERNAL; | |||
|
459 | break; | |||
|
460 | default: | |||
|
461 | i = UNKNOWN; | |||
|
462 | break; | |||
|
463 | } | |||
|
464 | ||||
|
465 | if (i != UNKNOWN) | |||
|
466 | { | |||
|
467 | segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8; | |||
|
468 | sequence_cnt = sequenceCounters_TC_EXE[ i ] & 0x3fff; | |||
|
469 | ||||
|
470 | new_packet_sequence_control = segmentation_grouping_flag | sequence_cnt ; | |||
|
471 | ||||
|
472 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); | |||
|
473 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); | |||
|
474 | ||||
|
475 | // increment the seuqence counter for the next packet | |||
|
476 | if ( sequenceCounters_TC_EXE[ i ] < SEQ_CNT_MAX) | |||
|
477 | { | |||
|
478 | sequenceCounters_TC_EXE[ i ] = sequenceCounters_TC_EXE[ i ] + 1; | |||
|
479 | } | |||
|
480 | else | |||
|
481 | { | |||
|
482 | sequenceCounters_TC_EXE[ i ] = 0; | |||
|
483 | } | |||
|
484 | } | |||
|
485 | else | |||
|
486 | { | |||
|
487 | PRINTF1("in increment_seq_counter_destination_id *** ERR destination ID %d not known\n", destination_id) | |||
|
488 | } | |||
|
489 | ||||
|
490 | } |
@@ -533,14 +533,14 int init_header_snapshot_wf_table( unsig | |||||
533 | headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
533 | headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
534 | headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; |
|
534 | headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; | |
535 | // AUXILIARY DATA HEADER |
|
535 | // AUXILIARY DATA HEADER | |
536 | headerSWF[ i ].sid = sid; |
|
|||
537 | headerSWF[ i ].hkBIA = DEFAULT_HKBIA; |
|
|||
538 | headerSWF[ i ].time[0] = 0x00; |
|
536 | headerSWF[ i ].time[0] = 0x00; | |
539 | headerSWF[ i ].time[0] = 0x00; |
|
537 | headerSWF[ i ].time[0] = 0x00; | |
540 | headerSWF[ i ].time[0] = 0x00; |
|
538 | headerSWF[ i ].time[0] = 0x00; | |
541 | headerSWF[ i ].time[0] = 0x00; |
|
539 | headerSWF[ i ].time[0] = 0x00; | |
542 | headerSWF[ i ].time[0] = 0x00; |
|
540 | headerSWF[ i ].time[0] = 0x00; | |
543 | headerSWF[ i ].time[0] = 0x00; |
|
541 | headerSWF[ i ].time[0] = 0x00; | |
|
542 | headerSWF[ i ].sid = sid; | |||
|
543 | headerSWF[ i ].hkBIA = DEFAULT_HKBIA; | |||
544 | } |
|
544 | } | |
545 | return LFR_SUCCESSFUL; |
|
545 | return LFR_SUCCESSFUL; | |
546 | } |
|
546 | } | |
@@ -732,6 +732,8 int send_waveform_SWF( volatile int *wav | |||||
732 | else { |
|
732 | else { | |
733 | spw_ioctl_send_SWF.dlen = 340 * NB_BYTES_SWF_BLK; |
|
733 | spw_ioctl_send_SWF.dlen = 340 * NB_BYTES_SWF_BLK; | |
734 | } |
|
734 | } | |
|
735 | // SET PACKET SEQUENCE COUNTER | |||
|
736 | increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid ); | |||
735 | // SET PACKET TIME |
|
737 | // SET PACKET TIME | |
736 | headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
738 | headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
737 | headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
739 | headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
@@ -795,6 +797,8 int send_waveform_CWF(volatile int *wave | |||||
795 | else { |
|
797 | else { | |
796 | spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_SWF_BLK; |
|
798 | spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_SWF_BLK; | |
797 | } |
|
799 | } | |
|
800 | // SET PACKET SEQUENCE COUNTER | |||
|
801 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid ); | |||
798 | // SET PACKET TIME |
|
802 | // SET PACKET TIME | |
799 | coarseTime = time_management_regs->coarse_time; |
|
803 | coarseTime = time_management_regs->coarse_time; | |
800 | fineTime = time_management_regs->fine_time; |
|
804 | fineTime = time_management_regs->fine_time; | |
@@ -887,6 +891,8 int send_waveform_CWF3_light(volatile in | |||||
887 | else { |
|
891 | else { | |
888 | spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_CWF3_LIGHT_BLK; |
|
892 | spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_CWF3_LIGHT_BLK; | |
889 | } |
|
893 | } | |
|
894 | // SET PACKET SEQUENCE COUNTER | |||
|
895 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 ); | |||
890 | // SET PACKET TIME |
|
896 | // SET PACKET TIME | |
891 | coarseTime = time_management_regs->coarse_time; |
|
897 | coarseTime = time_management_regs->coarse_time; | |
892 | fineTime = time_management_regs->fine_time; |
|
898 | fineTime = time_management_regs->fine_time; | |
@@ -1170,3 +1176,44 rtems_id get_pkts_queue_id( void ) | |||||
1170 | } |
|
1176 | } | |
1171 | return queue_id; |
|
1177 | return queue_id; | |
1172 | } |
|
1178 | } | |
|
1179 | ||||
|
1180 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ) | |||
|
1181 | { | |||
|
1182 | unsigned short *sequence_cnt; | |||
|
1183 | unsigned short segmentation_grouping_flag; | |||
|
1184 | unsigned short new_packet_sequence_control; | |||
|
1185 | ||||
|
1186 | if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2) | |||
|
1187 | || (sid ==SID_BURST_CWF_F2) ) | |||
|
1188 | { | |||
|
1189 | sequence_cnt = &sequenceCounters_SCIENCE_NORMAL_BURST; | |||
|
1190 | } | |||
|
1191 | else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) ) | |||
|
1192 | { | |||
|
1193 | sequence_cnt = &sequenceCounters_SCIENCE_SBM1_SBM2; | |||
|
1194 | } | |||
|
1195 | else | |||
|
1196 | { | |||
|
1197 | sequence_cnt = &sequenceCounters_TC_EXE[ UNKNOWN ]; | |||
|
1198 | PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid) | |||
|
1199 | } | |||
|
1200 | ||||
|
1201 | segmentation_grouping_flag = (packet_sequence_control[ 0 ] & 0xc0) << 8; | |||
|
1202 | *sequence_cnt = (*sequence_cnt) & 0x3fff; | |||
|
1203 | ||||
|
1204 | new_packet_sequence_control = segmentation_grouping_flag | *sequence_cnt ; | |||
|
1205 | ||||
|
1206 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); | |||
|
1207 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); | |||
|
1208 | ||||
|
1209 | // increment the seuqence counter for the next packet | |||
|
1210 | if ( *sequence_cnt < SEQ_CNT_MAX) | |||
|
1211 | { | |||
|
1212 | *sequence_cnt = *sequence_cnt + 1; | |||
|
1213 | } | |||
|
1214 | else | |||
|
1215 | { | |||
|
1216 | *sequence_cnt = 0; | |||
|
1217 | } | |||
|
1218 | ||||
|
1219 | } |
General Comments 0
You need to be logged in to leave comments.
Login now