##// END OF EJS Templates
target is set to 254 (LFR address)...
paul@pc-solar1.lab-lpp.local -
r14:b984446d1da2 default
parent child
Show More
1 NO CONTENT: modified file, binary diff hidden
@@ -1,142 +1,142
1 1 #ifndef CCSDS_H_INCLUDED
2 2 #define CCSDS_H_INCLUDED
3 3
4 4 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
5 5 #define CCSDS_TM_PKT_MAX_SIZE 4412
6 6 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
7 7 #define CCSDS_TC_PKT_MAX_SIZE 50 // size of the TC_LFR_UPDATE_INFO packet
8 8 #define CCSDS_TC_TM_PACKET_OFFSET 7
9 9 #define CCSDS_PROCESS_ID 76
10 10 #define CCSDS_PACKET_CATEGORY 12
11 #define CCSDS_NODE_ADDRESS 0x01 // SY_DPU_LFR_LA 1 is not allowed by the StarDundee brick, use 101 instead 0x65
12 #define CCSDS_DESTINATION_ID 0x02 // SY_LFR_DPU_LA 2 is not allowed by the StarDundee brick, use 102 instead 0x66
11 #define CCSDS_NODE_ADDRESS 0xfe
12 #define CCSDS_DESTINATION_ID 0x01
13 13 #define CCSDS_PROTOCOLE_ID 0x02
14 14 #define CCSDS_USER_APP 0x00
15 15
16 16 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
17 17 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
18 18
19 19 #define ILLEGAL_APID 0
20 20 #define WRONG_LEN_PACKET 1
21 21 #define INCOR_CHECKSUM 2
22 22 #define ILL_TYPE 3
23 23 #define ILL_SUBTYPE 4
24 24 #define WRONG_APP_DATA 5
25 25 #define WRONG_CMD_CODE 6
26 26 #define CCSDS_TM_VALID 7
27 27 //
28 28 #define TC_NOT_EXE 40000
29 29 #define WRONG_SRC_ID 40001
30 30 #define FUNCT_NOT_IMPL 40002
31 31 #define FAIL_DETECTED 40003
32 32 #define NOT_ALLOWED 40004
33 33 #define CORRUPTED 40005
34 34
35 35 // // TC SUBTYPES
36 36 #define TC_SUBTYPE_RESET 3
37 37 #define TC_SUBTYPE_LOAD_COMM 20
38 38 #define TC_SUBTYPE_LOAD_NORM 21
39 39 #define TC_SUBTYPE_LOAD_BURST 24
40 40 #define TC_SUBTYPE_LOAD_SBM1 27
41 41 #define TC_SUBTYPE_LOAD_SBM2 28
42 42 #define TC_SUBTYPE_DUMP 30
43 43 #define TC_SUBTYPE_ENTER 40
44 44 #define TC_SUBTYPE_UPDT_INFO 50
45 45 #define TC_SUBTYPE_EN_CAL 60
46 46 #define TC_SUBTYPE_DIS_CAL 61
47 47 #define TC_SUBTYPE_UPDT_TIME 129
48 48
49 49 #define SID_DEFAULT 0
50 50 #define SID_EXE_INC 5
51 51 #define SID_NOT_EXE 40000
52 52 #define SID_NOT_IMP 40002
53 53 #define SID_EXE_ERR 40003
54 54 #define SID_EXE_CORR 40005
55 55
56 56 #define SID_NORM_SWF_F0 3
57 57 #define SID_NORM_SWF_F1 4
58 58 #define SID_NORM_SWF_F2 5
59 59 #define SID_NORM_CWF_F3 1
60 60 #define SID_BURST_CWF_F2 2
61 61 #define SID_SBM1_CWF_F1 24
62 62 #define SID_SBM2_CWF_F2 25
63 63 #define SID_NORM_ASM_F0 11
64 64 #define SID_NORM_ASM_F1 12
65 65 #define SID_NORM_ASM_F2 13
66 66 #define SID_NORM_BP1_F0 14
67 67 #define SID_NORM_BP1_F1 15
68 68 #define SID_NORM_BP1_F2 16
69 69 #define SID_NORM_BP2_F0 19
70 70 #define SID_NORM_BP2_F1 20
71 71 #define SID_NORM_BP2_F2 21
72 72 #define SID_BURST_BP1_F0 17
73 73 #define SID_BURST_BP2_F0 22
74 74 #define SID_BURST_BP1_F1 18
75 75 #define SID_BURST_BP2_F1 23
76 76 #define SID_SBM1_BP1_F0 28
77 77 #define SID_SBM1_BP2_F0 31
78 78 #define SID_SBM2_BP1_F0 29
79 79 #define SID_SBM2_BP2_F0 32
80 80 #define SID_SBM1_BP1_F1 30
81 81 #define SID_SBM1_BP2_F1 33
82 82
83 83 #define TM_LEN_EXE 20 - CCSDS_TC_TM_PACKET_OFFSET
84 84 #define TM_LEN_NOT_EXE 26 - CCSDS_TC_TM_PACKET_OFFSET
85 85 #define TM_LEN_NOT_IMP 24 - CCSDS_TC_TM_PACKET_OFFSET
86 86 #define TM_LEN_EXE_ERR 24 - CCSDS_TC_TM_PACKET_OFFSET
87 87 #define TM_LEN_EXE_CORR 32 - CCSDS_TC_TM_PACKET_OFFSET
88 88 #define TM_HEADER_LEN 16
89 89 #define TM_LEN_SCI_NORM_SWF_340 340 * 12 + 6 + 10 - 1
90 90 #define TM_LEN_SCI_NORM_SWF_8 8 * 12 + 6 + 10 - 1
91 91
92 92 enum TM_TYPE{
93 93 TM_LFR_TC_EXE_OK,
94 94 TM_LFR_TC_EXE_ERR,
95 95 TM_LFR_HK,
96 96 TM_LFR_SCI,
97 97 TM_LFR_SCI_SBM,
98 98 TM_LFR_PAR_DUMP
99 99 };
100 100
101 101 struct TMHeader_str
102 102 {
103 103 volatile unsigned char targetLogicalAddress;
104 104 volatile unsigned char protocolIdentifier;
105 105 volatile unsigned char reserved;
106 106 volatile unsigned char userApplication;
107 107 volatile unsigned char packetID[2];
108 108 volatile unsigned char packetSequenceControl[2];
109 109 volatile unsigned char packetLength[2];
110 110 volatile unsigned char dataFieldHeader[10];
111 111 };
112 112 typedef struct TMHeader_str TMHeader_t;
113 113
114 114 struct ExtendedTMHeader_str
115 115 {
116 116 volatile unsigned char targetLogicalAddress;
117 117 volatile unsigned char protocolIdentifier;
118 118 volatile unsigned char reserved;
119 119 volatile unsigned char userApplication;
120 120 volatile unsigned char packetID[2];
121 121 volatile unsigned char packetSequenceControl[2];
122 122 volatile unsigned char packetLength[2];
123 123 volatile unsigned char dataFieldHeader[10];
124 124 volatile unsigned char auxiliaryHeader[6];
125 125 };
126 126 typedef struct ExtendedTMHeader_str ExtendedTMHeader_t;
127 127
128 128 struct ccsdsTelecommandPacket_str
129 129 {
130 130 //unsigned char targetLogicalAddress; // removed by the grspw module
131 131 volatile unsigned char protocolIdentifier;
132 132 volatile unsigned char reserved;
133 133 volatile unsigned char userApplication;
134 134 volatile unsigned char packetID[2];
135 135 volatile unsigned char packetSequenceControl[2];
136 136 volatile unsigned char packetLength[2];
137 137 volatile unsigned char dataFieldHeader[4];
138 138 volatile unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
139 139 };
140 140 typedef struct ccsdsTelecommandPacket_str ccsdsTelecommandPacket_t;
141 141
142 142 #endif // CCSDS_H_INCLUDED
General Comments 0
You need to be logged in to leave comments. Login now