##// END OF EJS Templates
Bug 167...
paul -
r152:de079a204567 VHDLib206
parent child
Show More
@@ -1,6 +1,6
1 1 #############################################################################
2 2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.6) on: Tue Jun 17 07:27:34 2014
3 # Generated by qmake (2.01a) (Qt 4.8.6) on: Tue Jun 17 09:36:20 2014
4 4 # Project: fsw-qt.pro
5 5 # Template: app
6 6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
@@ -19,24 +19,25 int action_load_sbm2_par(ccsdsTelecomman
19 19 int action_dump_par(rtems_id queue_id );
20 20
21 21 // NORMAL
22 int set_sy_lfr_n_swf_l(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
23 int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
24 int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
25 int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
26 int set_sy_lfr_n_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
27 int set_sy_lfr_n_cwf_long_f3(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
22 int check_common_par_consistency( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
23 int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC );
24 int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC );
25 int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC );
26 int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC );
27 int set_sy_lfr_n_bp_p1( ccsdsTelecommandPacket_t *TC );
28 int set_sy_lfr_n_cwf_long_f3( ccsdsTelecommandPacket_t *TC );
28 29
29 30 // BURST
30 int set_sy_lfr_b_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
31 int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
31 int set_sy_lfr_b_bp_p0( ccsdsTelecommandPacket_t *TC );
32 int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC );
32 33
33 34 // SBM1
34 int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
35 int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
35 int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC );
36 int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC );
36 37
37 38 // SBM2
38 int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
39 int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
39 int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC );
40 int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC );
40 41
41 42 // TC_LFR_UPDATE_INFO
42 43 unsigned int check_update_info_hk_lfr_mode( unsigned char mode );
This diff has been collapsed as it changes many lines, (544 lines changed) Show them Hide them
@@ -41,10 +41,6 int action_load_normal_par(ccsdsTelecomm
41 41 int result;
42 42 int flag;
43 43 rtems_status_code status;
44 unsigned char sy_lfr_n_bp_p0;
45 unsigned char sy_lfr_n_bp_p1;
46 unsigned int sy_lfr_n_asm_p;
47 float aux;
48 44
49 45 flag = LFR_SUCCESSFUL;
50 46
@@ -54,114 +50,21 int action_load_normal_par(ccsdsTelecomm
54 50 flag = LFR_DEFAULT;
55 51 }
56 52
57 //***************
58 // sy_lfr_n_swf_l
59 if (flag == LFR_SUCCESSFUL)
60 {
61 result = set_sy_lfr_n_swf_l( TC, queue_id, time );
62 if (result != LFR_SUCCESSFUL)
63 {
64 flag = LFR_DEFAULT;
65 }
66 }
67
68 //***************
69 // sy_lfr_n_swf_p
70 if (flag == LFR_SUCCESSFUL)
71 {
72 result = set_sy_lfr_n_swf_p( TC, queue_id, time );
73 if (result != LFR_SUCCESSFUL)
74 {
75 flag = LFR_DEFAULT;
76 }
77 }
78
79 //****************************************************************
80 // check the consistency between sy_lfr_n_bp_p0 and sy_lfr_n_bp_p1
81 if (flag == LFR_SUCCESSFUL)
82 {
83 sy_lfr_n_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P0 ];
84 sy_lfr_n_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P1 ];
85 aux = ( (float ) sy_lfr_n_bp_p1 / sy_lfr_n_bp_p0 ) - floor(sy_lfr_n_bp_p1 / sy_lfr_n_bp_p0);
86 if (aux != 0)
87 {
88 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P0+10, sy_lfr_n_bp_p0 );
89 flag = LFR_DEFAULT;
90 }
91 }
92
93 //***************
94 // sy_lfr_n_bp_p0
95 if (flag == LFR_SUCCESSFUL)
96 {
97 result = set_sy_lfr_n_bp_p0( TC, queue_id );
98 if (result != LFR_SUCCESSFUL)
99 {
100 flag = LFR_DEFAULT;
101 }
102 }
103
104 //****************************************************************
105 // check the consistency between sy_lfr_n_bp_p0 and sy_lfr_n_bp_p1
53 // CHECK THE PARAMETERS SET CONSISTENCY
106 54 if (flag == LFR_SUCCESSFUL)
107 55 {
108 sy_lfr_n_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P0 ];
109 sy_lfr_n_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P1 ];
110 aux = ( (float ) sy_lfr_n_bp_p1 / sy_lfr_n_bp_p0 ) - floor(sy_lfr_n_bp_p1 / sy_lfr_n_bp_p0);
111 if (aux != 0)
112 {
113 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P1+10, sy_lfr_n_bp_p1 );
114 flag = LFR_DEFAULT;
115 }
56 flag = check_common_par_consistency( TC, queue_id );
116 57 }
117 58
118 //***************
119 // sy_lfr_n_bp_p1
120 if (flag == LFR_SUCCESSFUL)
121 {
122 result = set_sy_lfr_n_bp_p1( TC, queue_id );
123 if (result != LFR_SUCCESSFUL)
124 {
125 flag = LFR_DEFAULT;
126 }
127 }
128
129 //****************************************************************
130 // check the consistency between sy_lfr_n_asm_p and sy_lfr_n_bp_p0
59 // SET THE PARAMETERS IF THEY ARE CONSISTENT
131 60 if (flag == LFR_SUCCESSFUL)
132 61 {
133 sy_lfr_n_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P0 ];
134 sy_lfr_n_asm_p =
135 TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P ] * 256
136 + TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P + 1 ];
137 aux = ( (float ) sy_lfr_n_asm_p / sy_lfr_n_bp_p0 ) - floor(sy_lfr_n_asm_p / sy_lfr_n_bp_p0);
138 if (aux != 0)
139 {
140 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_ASM_P+10, sy_lfr_n_asm_p );
141 flag = LFR_DEFAULT;
142 }
143 }
144
145 //***************
146 // sy_lfr_n_asm_p
147 if (flag == LFR_SUCCESSFUL)
148 {
149 result = set_sy_lfr_n_asm_p( TC, queue_id );
150 if (result != LFR_SUCCESSFUL)
151 {
152 flag = LFR_DEFAULT;
153 }
154 }
155
156 //*********************
157 // sy_lfr_n_cwf_long_f3
158 if (flag == LFR_SUCCESSFUL)
159 {
160 result = set_sy_lfr_n_cwf_long_f3( TC, queue_id );
161 if (result != LFR_SUCCESSFUL)
162 {
163 flag = LFR_DEFAULT;
164 }
62 result = set_sy_lfr_n_swf_l( TC );
63 result = set_sy_lfr_n_swf_p( TC );
64 result = set_sy_lfr_n_bp_p0( TC );
65 result = set_sy_lfr_n_bp_p1( TC );
66 result = set_sy_lfr_n_asm_p( TC );
67 result = set_sy_lfr_n_cwf_long_f3( TC );
165 68 }
166 69
167 70 return flag;
@@ -190,6 +93,27 int action_load_burst_par(ccsdsTelecomma
190 93 result = LFR_DEFAULT;
191 94 }
192 95
96 sy_lfr_b_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P0 ];
97 sy_lfr_b_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P1 ];
98
99 // sy_lfr_b_bp_p0
100 if (flag == LFR_SUCCESSFUL)
101 {
102 if (sy_lfr_b_bp_p0 < DEFAULT_SY_LFR_B_BP_P0 )
103 {
104 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_B_BP_P0+10, sy_lfr_b_bp_p0 );
105 flag = WRONG_APP_DATA;
106 }
107 }
108 // sy_lfr_b_bp_p1
109 if (flag == LFR_SUCCESSFUL)
110 {
111 if (sy_lfr_b_bp_p1 < DEFAULT_SY_LFR_B_BP_P1 )
112 {
113 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_B_BP_P1+10, sy_lfr_b_bp_p1 );
114 flag = WRONG_APP_DATA;
115 }
116 }
193 117 //****************************************************************
194 118 // check the consistency between sy_lfr_b_bp_p0 and sy_lfr_b_bp_p1
195 119 if (flag == LFR_SUCCESSFUL)
@@ -204,26 +128,11 int action_load_burst_par(ccsdsTelecomma
204 128 }
205 129 }
206 130
207 //***************
208 // sy_lfr_b_bp_p0
131 // SET HTE PARAMETERS
209 132 if (flag == LFR_SUCCESSFUL)
210 133 {
211 result = set_sy_lfr_b_bp_p0( TC, queue_id );
212 if (result != LFR_SUCCESSFUL)
213 {
214 flag = LFR_DEFAULT;
215 }
216 }
217
218 //***************
219 // sy_lfr_b_bp_p1
220 if (flag == LFR_SUCCESSFUL)
221 {
222 result = set_sy_lfr_b_bp_p1( TC, queue_id );
223 if (result != LFR_SUCCESSFUL)
224 {
225 flag = LFR_DEFAULT;
226 }
134 result = set_sy_lfr_b_bp_p0( TC );
135 result = set_sy_lfr_b_bp_p1( TC );
227 136 }
228 137
229 138 return flag;
@@ -252,12 +161,31 int action_load_sbm1_par(ccsdsTelecomman
252 161 result = LFR_DEFAULT;
253 162 }
254 163
164 sy_lfr_s1_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P0 ];
165 sy_lfr_s1_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P1 ];
166
167 // sy_lfr_s1_bp_p0
168 if (flag == LFR_SUCCESSFUL)
169 {
170 if (sy_lfr_s1_bp_p0 < DEFAULT_SY_LFR_S1_BP_P0 )
171 {
172 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S1_BP_P0+10, sy_lfr_s1_bp_p0 );
173 flag = WRONG_APP_DATA;
174 }
175 }
176 // sy_lfr_s1_bp_p1
177 if (flag == LFR_SUCCESSFUL)
178 {
179 if (sy_lfr_s1_bp_p1 < DEFAULT_SY_LFR_S1_BP_P1 )
180 {
181 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S1_BP_P1+10, sy_lfr_s1_bp_p1 );
182 flag = WRONG_APP_DATA;
183 }
184 }
255 185 //******************************************************************
256 186 // check the consistency between sy_lfr_s1_bp_p0 and sy_lfr_s1_bp_p1
257 187 if (flag == LFR_SUCCESSFUL)
258 188 {
259 sy_lfr_s1_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P0 ];
260 sy_lfr_s1_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P1 ];
261 189 aux = ( (float ) sy_lfr_s1_bp_p1 / (sy_lfr_s1_bp_p0*0.25) ) - floor(sy_lfr_s1_bp_p1 / (sy_lfr_s1_bp_p0*0.25));
262 190 if (aux != 0)
263 191 {
@@ -266,26 +194,11 int action_load_sbm1_par(ccsdsTelecomman
266 194 }
267 195 }
268 196
269 //***************
270 // sy_lfr_s1_bp_p0
197 // SET THE PARAMETERS
271 198 if (flag == LFR_SUCCESSFUL)
272 199 {
273 result = set_sy_lfr_s1_bp_p0( TC, queue_id );
274 if (result != LFR_SUCCESSFUL)
275 {
276 flag = LFR_DEFAULT;
277 }
278 }
279
280 //***************
281 // sy_lfr_s1_bp_p1
282 if (flag == LFR_SUCCESSFUL)
283 {
284 result = set_sy_lfr_s1_bp_p1( TC, queue_id );
285 if (result != LFR_SUCCESSFUL)
286 {
287 flag = LFR_DEFAULT;
288 }
200 result = set_sy_lfr_s1_bp_p0( TC );
201 result = set_sy_lfr_s1_bp_p1( TC );
289 202 }
290 203
291 204 return flag;
@@ -314,6 +227,27 int action_load_sbm2_par(ccsdsTelecomman
314 227 result = LFR_DEFAULT;
315 228 }
316 229
230 sy_lfr_s2_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P0 ];
231 sy_lfr_s2_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P1 ];
232
233 // sy_lfr_s2_bp_p0
234 if (flag == LFR_SUCCESSFUL)
235 {
236 if (sy_lfr_s2_bp_p0 < DEFAULT_SY_LFR_S2_BP_P0 )
237 {
238 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S2_BP_P0+10, sy_lfr_s2_bp_p0 );
239 flag = WRONG_APP_DATA;
240 }
241 }
242 // sy_lfr_s2_bp_p1
243 if (flag == LFR_SUCCESSFUL)
244 {
245 if (sy_lfr_s2_bp_p1 < DEFAULT_SY_LFR_S2_BP_P1 )
246 {
247 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S2_BP_P1+10, sy_lfr_s2_bp_p1 );
248 flag = WRONG_APP_DATA;
249 }
250 }
317 251 //******************************************************************
318 252 // check the consistency between sy_lfr_s2_bp_p0 and sy_lfr_s2_bp_p1
319 253 if (flag == LFR_SUCCESSFUL)
@@ -328,26 +262,11 int action_load_sbm2_par(ccsdsTelecomman
328 262 }
329 263 }
330 264
331 //***************
332 // sy_lfr_s2_bp_p0
265 // SET THE PARAMETERS
333 266 if (flag == LFR_SUCCESSFUL)
334 267 {
335 result = set_sy_lfr_s2_bp_p0( TC, queue_id );
336 if (result != LFR_SUCCESSFUL)
337 {
338 flag = LFR_DEFAULT;
339 }
340 }
341
342 //***************
343 // sy_lfr_s2_bp_p1
344 if (flag == LFR_SUCCESSFUL)
345 {
346 result = set_sy_lfr_s2_bp_p1( TC, queue_id );
347 if (result != LFR_SUCCESSFUL)
348 {
349 flag = LFR_DEFAULT;
350 }
268 result = set_sy_lfr_s2_bp_p0( TC );
269 result = set_sy_lfr_s2_bp_p1( TC );
351 270 }
352 271
353 272 return flag;
@@ -395,7 +314,113 int action_dump_par( rtems_id queue_id )
395 314 //***********************
396 315 // NORMAL MODE PARAMETERS
397 316
398 int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time )
317 int check_common_par_consistency( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
318 {
319 unsigned char msb;
320 unsigned char lsb;
321 int flag;
322 float aux;
323 rtems_status_code status;
324
325 unsigned int sy_lfr_n_swf_l;
326 unsigned int sy_lfr_n_swf_p;
327 unsigned int sy_lfr_n_asm_p;
328 unsigned char sy_lfr_n_bp_p0;
329 unsigned char sy_lfr_n_bp_p1;
330 unsigned char sy_lfr_n_cwf_long_f3;
331
332 flag = LFR_SUCCESSFUL;
333
334 //***************
335 // get parameters
336 msb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_L ];
337 lsb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_L+1 ];
338 sy_lfr_n_swf_l = msb * 256 + lsb;
339
340 msb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_P ];
341 lsb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_P+1 ];
342 sy_lfr_n_swf_p = msb * 256 + lsb;
343
344 msb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P ];
345 lsb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P+1 ];
346 sy_lfr_n_asm_p = msb * 256 + lsb;
347
348 sy_lfr_n_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P0 ];
349
350 sy_lfr_n_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P1 ];
351
352 sy_lfr_n_cwf_long_f3 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_CWF_LONG_F3 ];
353
354 //******************
355 // check consistency
356 // sy_lfr_n_swf_l
357 if (sy_lfr_n_swf_l != 2048)
358 {
359 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_SWF_L+10, lsb );
360 flag = WRONG_APP_DATA;
361 }
362 // sy_lfr_n_swf_p
363 if (flag == LFR_SUCCESSFUL)
364 {
365 if ( sy_lfr_n_swf_p < 16 )
366 {
367 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_SWF_P+10, lsb );
368 flag = WRONG_APP_DATA;
369 }
370 }
371 // sy_lfr_n_bp_p0
372 if (flag == LFR_SUCCESSFUL)
373 {
374 if (sy_lfr_n_bp_p0 < SY_LFR_N_BP_P0)
375 {
376 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P0+10, sy_lfr_n_bp_p0 );
377 flag = WRONG_APP_DATA;
378 }
379 }
380 // sy_lfr_n_asm_p
381 if (flag == LFR_SUCCESSFUL)
382 {
383 if (sy_lfr_n_asm_p == 0)
384 {
385 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_ASM_P+10, sy_lfr_n_asm_p );
386 flag = WRONG_APP_DATA;
387 }
388 }
389 // sy_lfr_n_asm_p shall be a whole multiple of sy_lfr_n_bp_p0
390 if (flag == LFR_SUCCESSFUL)
391 {
392 aux = ( (float ) sy_lfr_n_asm_p / sy_lfr_n_bp_p0 ) - floor(sy_lfr_n_asm_p / sy_lfr_n_bp_p0);
393 if (aux != 0)
394 {
395 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_ASM_P+10, sy_lfr_n_asm_p );
396 flag = WRONG_APP_DATA;
397 }
398 }
399 // sy_lfr_n_bp_p1
400 if (flag == LFR_SUCCESSFUL)
401 {
402 if (sy_lfr_n_bp_p1 < SY_LFR_N_BP_P1)
403 {
404 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P1+10, sy_lfr_n_bp_p1 );
405 flag = WRONG_APP_DATA;
406 }
407 }
408 // sy_lfr_n_bp_p1 shall be a whole multiple of sy_lfr_n_bp_p0
409 if (flag == LFR_SUCCESSFUL)
410 {
411 aux = ( (float ) sy_lfr_n_bp_p1 / sy_lfr_n_bp_p0 ) - floor(sy_lfr_n_bp_p1 / sy_lfr_n_bp_p0);
412 if (aux != 0)
413 {
414 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P1+10, sy_lfr_n_bp_p1 );
415 flag = LFR_DEFAULT;
416 }
417 }
418 // sy_lfr_n_cwf_long_f3
419
420 return flag;
421 }
422
423 int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC )
399 424 {
400 425 /** This function sets the number of points of a snapshot (sy_lfr_n_swf_l).
401 426 *
@@ -404,40 +429,17 int set_sy_lfr_n_swf_l( ccsdsTelecommand
404 429 *
405 430 */
406 431
407 unsigned int tmp;
408 432 int result;
409 unsigned char msb;
410 unsigned char lsb;
411 rtems_status_code status;
412
413 msb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_L ];
414 lsb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_L+1 ];
415
416 tmp = ( unsigned int ) floor(
417 ( ( msb*256 ) + lsb ) / 16
418 ) * 16;
419 433
420 if ( (tmp < 16) || (tmp > 2048) ) // the snapshot period is a multiple of 16
421 { // 2048 is the maximum limit due to the size of the buffers
422 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_SWF_L+10, lsb );
423 result = WRONG_APP_DATA;
424 }
425 else if (tmp != 2048)
426 {
427 status = send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
428 result = FUNCT_NOT_IMPL;
429 }
430 else
431 {
432 parameter_dump_packet.sy_lfr_n_swf_l[0] = (unsigned char) (tmp >> 8);
433 parameter_dump_packet.sy_lfr_n_swf_l[1] = (unsigned char) (tmp );
434 result = LFR_SUCCESSFUL;
435 }
434 result = LFR_SUCCESSFUL;
435
436 parameter_dump_packet.sy_lfr_n_swf_l[0] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_L ];
437 parameter_dump_packet.sy_lfr_n_swf_l[1] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_L+1 ];
436 438
437 439 return result;
438 440 }
439 441
440 int set_sy_lfr_n_swf_p(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time)
442 int set_sy_lfr_n_swf_p(ccsdsTelecommandPacket_t *TC )
441 443 {
442 444 /** This function sets the time between two snapshots, in s (sy_lfr_n_swf_p).
443 445 *
@@ -446,33 +448,17 int set_sy_lfr_n_swf_p(ccsdsTelecommandP
446 448 *
447 449 */
448 450
449 unsigned int tmp;
450 451 int result;
451 unsigned char msb;
452 unsigned char lsb;
453 rtems_status_code status;
454
455 msb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_P ];
456 lsb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_P+1 ];
457
458 tmp = msb * 256 + lsb;
459 452
460 if ( tmp < 16 )
461 {
462 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_SWF_P+10, lsb );
463 result = WRONG_APP_DATA;
464 }
465 else
466 {
467 parameter_dump_packet.sy_lfr_n_swf_p[0] = (unsigned char) (tmp >> 8);
468 parameter_dump_packet.sy_lfr_n_swf_p[1] = (unsigned char) (tmp );
469 result = LFR_SUCCESSFUL;
470 }
453 result = LFR_SUCCESSFUL;
454
455 parameter_dump_packet.sy_lfr_n_swf_p[0] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_P ];
456 parameter_dump_packet.sy_lfr_n_swf_p[1] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_P+1 ];
471 457
472 458 return result;
473 459 }
474 460
475 int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
461 int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC )
476 462 {
477 463 /** This function sets the time between two full spectral matrices transmission, in s (SY_LFR_N_ASM_P).
478 464 *
@@ -482,20 +468,16 int set_sy_lfr_n_asm_p( ccsdsTelecommand
482 468 */
483 469
484 470 int result;
485 unsigned char msb;
486 unsigned char lsb;
471
472 result = LFR_SUCCESSFUL;
487 473
488 msb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P ];
489 lsb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P+1 ];
490
491 parameter_dump_packet.sy_lfr_n_asm_p[0] = msb;
492 parameter_dump_packet.sy_lfr_n_asm_p[1] = lsb;
493 result = LFR_SUCCESSFUL;
474 parameter_dump_packet.sy_lfr_n_asm_p[0] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P ];
475 parameter_dump_packet.sy_lfr_n_asm_p[1] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P+1 ];
494 476
495 477 return result;
496 478 }
497 479
498 int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
480 int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC )
499 481 {
500 482 /** This function sets the time between two basic parameter sets, in s (SY_LFR_N_BP_P0).
501 483 *
@@ -505,26 +487,15 int set_sy_lfr_n_bp_p0( ccsdsTelecommand
505 487 */
506 488
507 489 int status;
508 unsigned char val;
509 490
510 491 status = LFR_SUCCESSFUL;
511 492
512 val = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P0 ];
513
514 if (val < SY_LFR_N_BP_P0)
515 {
516 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P0+10, val );
517 status = WRONG_APP_DATA;
518 }
519 else
520 {
521 parameter_dump_packet.sy_lfr_n_bp_p0 = val;
522 }
493 parameter_dump_packet.sy_lfr_n_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P0 ];
523 494
524 495 return status;
525 496 }
526 497
527 int set_sy_lfr_n_bp_p1(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
498 int set_sy_lfr_n_bp_p1(ccsdsTelecommandPacket_t *TC )
528 499 {
529 500 /** This function sets the time between two basic parameter sets (autocorrelation + crosscorrelation), in s (sy_lfr_n_bp_p1).
530 501 *
@@ -534,26 +505,15 int set_sy_lfr_n_bp_p1(ccsdsTelecommandP
534 505 */
535 506
536 507 int status;
537 unsigned char val;
538 508
539 509 status = LFR_SUCCESSFUL;
540 510
541 val = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P1 ];
542
543 if (val < SY_LFR_N_BP_P1)
544 {
545 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P1+10, val );
546 status = WRONG_APP_DATA;
547 }
548 else
549 {
550 parameter_dump_packet.sy_lfr_n_bp_p1 = val;
551 }
511 parameter_dump_packet.sy_lfr_n_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P1 ];
552 512
553 513 return status;
554 514 }
555 515
556 int set_sy_lfr_n_cwf_long_f3(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
516 int set_sy_lfr_n_cwf_long_f3(ccsdsTelecommandPacket_t *TC )
557 517 {
558 518 /** This function allows to switch from CWF_F3 packets to CWF_LONG_F3 packets.
559 519 *
@@ -573,7 +533,7 int set_sy_lfr_n_cwf_long_f3(ccsdsTeleco
573 533
574 534 //**********************
575 535 // BURST MODE PARAMETERS
576 int set_sy_lfr_b_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
536 int set_sy_lfr_b_bp_p0(ccsdsTelecommandPacket_t *TC)
577 537 {
578 538 /** This function sets the time between two basic parameter sets, in s (SY_LFR_B_BP_P0).
579 539 *
@@ -583,26 +543,15 int set_sy_lfr_b_bp_p0( ccsdsTelecommand
583 543 */
584 544
585 545 int status;
586 unsigned char val;
587 546
588 547 status = LFR_SUCCESSFUL;
589 548
590 val = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P0 ];
591
592 if (val < DEFAULT_SY_LFR_B_BP_P0 )
593 {
594 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_B_BP_P0+10, val );
595 status = WRONG_APP_DATA;
596 }
597 else
598 {
599 parameter_dump_packet.sy_lfr_b_bp_p0 = val;
600 }
549 parameter_dump_packet.sy_lfr_b_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P0 ];
601 550
602 551 return status;
603 552 }
604 553
605 int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
554 int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC )
606 555 {
607 556 /** This function sets the time between two basic parameter sets, in s (SY_LFR_B_BP_P1).
608 557 *
@@ -612,28 +561,17 int set_sy_lfr_b_bp_p1( ccsdsTelecommand
612 561 */
613 562
614 563 int status;
615 unsigned char val;
616 564
617 565 status = LFR_SUCCESSFUL;
618 566
619 val = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P1 ];
620
621 if (val < DEFAULT_SY_LFR_B_BP_P1 )
622 {
623 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_B_BP_P1+10, val );
624 status = WRONG_APP_DATA;
625 }
626 else
627 {
628 parameter_dump_packet.sy_lfr_b_bp_p1 = val;
629 }
567 parameter_dump_packet.sy_lfr_b_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P1 ];
630 568
631 569 return status;
632 570 }
633 571
634 572 //*********************
635 573 // SBM1 MODE PARAMETERS
636 int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
574 int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC )
637 575 {
638 576 /** This function sets the time between two basic parameter sets, in s (SY_LFR_S1_BP_P0).
639 577 *
@@ -643,26 +581,15 int set_sy_lfr_s1_bp_p0( ccsdsTelecomman
643 581 */
644 582
645 583 int status;
646 unsigned char val;
647 584
648 585 status = LFR_SUCCESSFUL;
649 586
650 val = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P0 ];
651
652 if (val < DEFAULT_SY_LFR_S1_BP_P0 )
653 {
654 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S1_BP_P0+10, val );
655 status = WRONG_APP_DATA;
656 }
657 else
658 {
659 parameter_dump_packet.sy_lfr_s1_bp_p0 = val;
660 }
587 parameter_dump_packet.sy_lfr_s1_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P0 ];
661 588
662 589 return status;
663 590 }
664 591
665 int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
592 int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC )
666 593 {
667 594 /** This function sets the time between two basic parameter sets, in s (SY_LFR_S1_BP_P1).
668 595 *
@@ -672,28 +599,17 int set_sy_lfr_s1_bp_p1( ccsdsTelecomman
672 599 */
673 600
674 601 int status;
675 unsigned char val;
676 602
677 603 status = LFR_SUCCESSFUL;
678 604
679 val = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P1 ];
680
681 if (val < DEFAULT_SY_LFR_S1_BP_P1 )
682 {
683 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S1_BP_P1+10, val );
684 status = WRONG_APP_DATA;
685 }
686 else
687 {
688 parameter_dump_packet.sy_lfr_s1_bp_p1 = val;
689 }
605 parameter_dump_packet.sy_lfr_s1_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P1 ];
690 606
691 607 return status;
692 608 }
693 609
694 610 //*********************
695 611 // SBM2 MODE PARAMETERS
696 int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
612 int set_sy_lfr_s2_bp_p0(ccsdsTelecommandPacket_t *TC)
697 613 {
698 614 /** This function sets the time between two basic parameter sets, in s (SY_LFR_S2_BP_P0).
699 615 *
@@ -703,26 +619,15 int set_sy_lfr_s2_bp_p0( ccsdsTelecomman
703 619 */
704 620
705 621 int status;
706 unsigned char val;
707 622
708 623 status = LFR_SUCCESSFUL;
709 624
710 val = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P0 ];
711
712 if (val < DEFAULT_SY_LFR_S2_BP_P0 )
713 {
714 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S2_BP_P0+10, val );
715 status = WRONG_APP_DATA;
716 }
717 else
718 {
719 parameter_dump_packet.sy_lfr_s2_bp_p0 = val;
720 }
625 parameter_dump_packet.sy_lfr_s2_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P0 ];
721 626
722 627 return status;
723 628 }
724 629
725 int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
630 int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC )
726 631 {
727 632 /** This function sets the time between two basic parameter sets, in s (SY_LFR_S2_BP_P1).
728 633 *
@@ -732,21 +637,10 int set_sy_lfr_s2_bp_p1( ccsdsTelecomman
732 637 */
733 638
734 639 int status;
735 unsigned char val;
736 640
737 641 status = LFR_SUCCESSFUL;
738 642
739 val = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P1 ];
740
741 if (val < DEFAULT_SY_LFR_S2_BP_P1 )
742 {
743 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S2_BP_P1+10, val );
744 status = WRONG_APP_DATA;
745 }
746 else
747 {
748 parameter_dump_packet.sy_lfr_s2_bp_p1 = val;
749 }
643 parameter_dump_packet.sy_lfr_s2_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P1 ];
750 644
751 645 return status;
752 646 }
@@ -132,7 +132,7 int send_tm_lfr_tc_exe_inconsistent( ccs
132 132 TM.tc_service = TC->serviceType; // type of the rejected TC
133 133 TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC
134 134 TM.byte_position = byte_position;
135 TM.rcv_value = rcv_value;
135 TM.rcv_value = (unsigned char) rcv_value;
136 136
137 137 messageSize = PACKET_LENGTH_TC_EXE_INCONSISTENT + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES;
138 138
General Comments 0
You need to be logged in to leave comments. Login now