CORDET Framework - C2 Implementation
cordetfw/pustests/config/CrFwPckt.c
1 
51 #include "CrFwConstants.h"
52 #include "CrPsUserConstants.h"
54 #include "Pckt/CrFwPckt.h"
55 #include "BaseCmp/CrFwBaseCmp.h"
60 
66 
73 
76 
77 /*static const CrFwPcktLength_t offsetPar = sizeof(TmHeader_t);*/
78 /*internal functions*/
79 /*-----------------------------------------------------------------------------------------*/
80 
81 CrFwGroup_t CrFwPcktGetPcat(CrFwPckt_t pckt) {
82  CrPsApid_t apid;
83  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
84  {
85  apid = getTmHeaderAPID(pckt);
86  }
87  else
88  {
89  apid = getTcHeaderAPID(pckt);
90  }
91  return (apid & 0x000f);
92 }
93 
94 /*-----------------------------------------------------------------------------------------*/
95 void CrFwPcktSetPcat(CrFwPckt_t pckt, CrFwGroup_t pcat) {
96  CrPsApid_t apid;
97  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
98  {
99  apid = getTmHeaderAPID(pckt);
100  setTmHeaderAPID (pckt, (apid & 0x07f0)|(pcat & 0x000f));
101  }
102  else
103  {
104  apid = getTcHeaderAPID(pckt);
105  setTcHeaderAPID (pckt, (apid & 0x07f0)|(pcat & 0x000f));
106  }
107 }
108 
109 /*-----------------------------------------------------------------------------------------*/
110 CrFwDestSrc_t CrFwPcktGetPid(CrFwPckt_t pckt)
111 {
112  /*SO WIE IN CHEOPS (PID ist nur ein TEIL der Appid)*/
113  /* maske ist 0x07f0 ( also 0000011111110000 ) */
114  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
115  {
116  return (getTmHeaderAPID(pckt) & 0x07f0) >> 4;
117  }
118  else
119  {
120  return (getTcHeaderAPID(pckt) & 0x07f0) >> 4;
121  }
122 }
123 
124 
125 /*-----------------------------------------------------------------------------------------*/
126 void CrFwPcktSetPid(CrFwPckt_t pckt, unsigned short pid)
127 {
128  /*SO WIE IN CHEOPS (PID ist nur ein TEIL der Appid)*/
129  /* maske ist 0x07f0 ( also 0000011111110000 ) */
130  CrPsApid_t apid;
131  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
132  {
133  apid = getTmHeaderAPID(pckt);
134  apid = (apid & 0xf80f) | ((pid<<4) & 0x07f0);
135  setTmHeaderAPID(pckt, apid);
136  }
137  else
138  {
139  apid = getTcHeaderAPID(pckt);
140  apid = (apid & 0xf80f) | ((pid<<4) & 0x07f0);
141  setTcHeaderAPID(pckt, apid);
142  }
143 }
144 
145 /*CrFwPckt.h Functions*/
146 /*-----------------------------------------------------------------------------------------*/
149  if (pcktLength > CR_FW_MAX_PCKT_LENGTH) {
151  return NULL;
152  }
153 
154  if (pcktLength < 1) {
156  return NULL;
157  }
158 
159  for (i=0; i<CR_FW_MAX_NOF_PCKTS; i++) {
160  if (pcktInUse[i] == 0) {
161  pcktInUse[i] = 1;
164  return (&pcktArray[i*CR_FW_MAX_PCKT_LENGTH]);
165  }
166  }
168  return NULL;
169 }
170 
171 /*-----------------------------------------------------------------------------------------*/
172 void CrFwPcktRelease(CrFwPckt_t pckt) {
174 
175  for (i=0; i<CR_FW_MAX_NOF_PCKTS; i++) {
176  if (pckt == &pcktArray[i*CR_FW_MAX_PCKT_LENGTH]) {
177  if (pcktInUse[i] == 0) {
179  } else {
181  pcktInUse[i] = 0;
182  }
183  return;
184  }
185  }
186 
188  return;
189 }
190 
191 /*-----------------------------------------------------------------------------------------*/
194 
195  if (pcktLength > CR_FW_MAX_PCKT_LENGTH)
196  return 0;
197 
198  if (pcktLength < 1)
199  return 0;
200 
201  for (i=0; i<CR_FW_MAX_NOF_PCKTS; i++) {
202  if (pcktInUse[i] == 0)
203  return 1;
204  }
205  return 0;
206 }
207 
208 
209 
210 /*-----------------------------------------------------------------------------------------*/
212  return nOfAllocatedPckts;
213 }
214 
215 /*-----------------------------------------------------------------------------------------*/
217  return CR_FW_MAX_PCKT_LENGTH;
218 }
219 
220 /*-----------------------------------------------------------------------------------------*/
222  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
223  {
225  }
226  else
227  {
229  }
230 }
231 
232 /*-----------------------------------------------------------------------------------------*/
234  if (getTcHeaderPcktType(p) == 0)
235  {
236  return crRepType;
237  }
238  else
239  {
240  return crCmdType;
241  }
242 }
243 
244 /*-----------------------------------------------------------------------------------------*/
246  if (type == crRepType)
247  {
248  setTmHeaderPcktType(pckt, 0);
249  }
250  else
251  {
252  setTcHeaderPcktType(pckt, 1);
253  }
254 }
255 
257  /* Field not present */
258  (void)(pckt);
259  return 0;
260 }
261 
263  /* Field not present */
264  (void)(pckt);
265  (void)(id);
266 }
267 
268 /*-----------------------------------------------------------------------------------------*/
270  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
271  {
272  return (CrFwSeqCnt_t) getTmHeaderSeqCount(pckt);
273  }
274  else
275  {
276  return (CrFwSeqCnt_t) getTcHeaderSeqCount(pckt);
277  }
278 }
279 
280 /*-----------------------------------------------------------------------------------------*/
281 void CrFwPcktSetSeqCnt(CrFwPckt_t pckt, CrFwSeqCnt_t seqCnt) {
282  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
283  {
284  setTmHeaderSeqCount(pckt, seqCnt);
285  }
286  else
287  {
288  setTcHeaderSeqCount(pckt, seqCnt);
289  }
290 }
291 
292 /*-----------------------------------------------------------------------------------------*/
294  CrFwTimeStamp_t time;
295 
296  getTmHeaderTime(pckt, &time);
297 
298  return time;
299 }
300 
301 /*-----------------------------------------------------------------------------------------*/
302 void CrFwPcktSetTimeStamp(CrFwPckt_t pckt, CrFwTimeStamp_t timeStamp) {
303 
304  setTmHeaderTime(pckt, &timeStamp);
305 }
306 
307 /*-----------------------------------------------------------------------------------------*/
309  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
310  {
311  setTmHeaderServType(pckt, servType);
312  }
313  else
314  {
315  setTcHeaderServType(pckt, servType);
316  }
317 }
318 
319 /*-----------------------------------------------------------------------------------------*/
321  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
322  {
323  return (CrFwServSubType_t) getTmHeaderServType(pckt);
324  }
325  else
326  {
327  return (CrFwServSubType_t) getTcHeaderServType(pckt);
328  }
329 }
330 
331 /*-----------------------------------------------------------------------------------------*/
333  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
334  {
335  setTmHeaderServSubType(pckt, servSubType);
336  }
337  else
338  {
339  setTcHeaderServSubType(pckt, servSubType);
340  }
341 }
342 
343 /*-----------------------------------------------------------------------------------------*/
345  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
346  {
348  }
349  else
350  {
352  }
353 }
354 
355 /*-----------------------------------------------------------------------------------------*/
356 void CrFwPcktSetDiscriminant(CrFwPckt_t pckt, CrFwDiscriminant_t discriminant) {
357 
358  /*TODO: is a switch more performant?*/
359  if (CrFwPcktGetServType(pckt) == 1)
360  {
361  if(CrFwPcktGetServSubType(pckt) == 2)
362  {
363  /*Packet 1.2 - Failed Acceptance Verification Report*/
364  setVerFailedAccRepFailureCode(pckt, discriminant);
365  }
366  if(CrFwPcktGetServSubType(pckt) == 4)
367  {
368  /*Packet 1.4 - Failed Start of Execution Verification Report*/
369  setVerFailedStartRepFailureCode(pckt, discriminant);
370  }
371  if(CrFwPcktGetServSubType(pckt) == 6)
372  {
373  /*Packet 1.6 - Failed Progress of Execution Verification Report*/
374  setVerFailedPrgrRepFailureCode(pckt, discriminant);
375  }
376  if(CrFwPcktGetServSubType(pckt) == 8)
377  {
378  /*Packet 1.8 - Failed Completion of Execution Verification Report*/
379  setVerFailedTermRepFailureCode(pckt, discriminant);
380  }
381  if(CrFwPcktGetServSubType(pckt) == 10)
382  {
383  /*Packet 1.10 - Failed Routing Verification Report*/
384  setVerFailedRoutingRepFailureCode(pckt, discriminant);
385  }
386  }
387  /*Service 3*/
388  if (CrFwPcktGetServType(pckt) == 3)
389  {
390  if(CrFwPcktGetServSubType(pckt) == 1)
391  {
392  /*Packet 3.1 - Create Housekeeping Parameter Report Structure Command*/
393  setHkCreateCmdRepStrucId(pckt, discriminant);
394  }
395  if(CrFwPcktGetServSubType(pckt) == 2)
396  {
397  /*Packet 3.2 - Create Diagnostic Parameter Report Structure Command*/
398  setHkCreateCmdRepStrucId(pckt, discriminant);
399  }
400  if(CrFwPcktGetServSubType(pckt) == 10)
401  {
402  /*Packet 3.10 - Housekeeping Parameter Report Structure Report*/
403  setHkRepStructRepRepStrucId(pckt, discriminant);
404  }
405  if(CrFwPcktGetServSubType(pckt) == 12)
406  {
407  /*Packet 3.12 - Diagnostic Parameter Report Structure Report*/
408  setHkRepStructRepRepStrucId(pckt, discriminant);
409  }
410  if(CrFwPcktGetServSubType(pckt) == 25)
411  {
412  /*Packet 3.25 - Housekeeping Parameter Report*/
413  setHkRepRepStrucId(pckt, discriminant);
414  }
415  if(CrFwPcktGetServSubType(pckt) == 26)
416  {
417  /*Packet 3.26 - Diagnostic Parameter Report*/
418  setHkRepRepStrucId(pckt, discriminant);
419  }
420  }
421 
422 /*Service 5 */
423  if (CrFwPcktGetServType(pckt) == 5)
424  {
425  if(CrFwPcktGetServSubType(pckt) == 1)
426  {
427  /*Packet 5.1 - Informative Event Report (Level 1)*/
428  setEvtRep1EventId(pckt, discriminant);
429  }
430  if(CrFwPcktGetServSubType(pckt) == 2)
431  {
432  /*Packet 5.2 - Low Severity Event Report (Level 2)*/
433  setEvtRep2EventId(pckt, discriminant);
434  }
435  if(CrFwPcktGetServSubType(pckt) == 3)
436  {
437  /*Packet 5.3 - Medium Severity Event Report (Level 3)*/
438  setEvtRep3EventId(pckt, discriminant);
439  }
440  if(CrFwPcktGetServSubType(pckt) == 4)
441  {
442  /*Packet 5.4 - High Severity Event Report (Level 4)*/
443  setEvtRep4EventId(pckt, discriminant);
444  }
445  }
446 
447 /*TODO: add all IF'S (service 1 .. the failcode acts as discriminant*/
448 
449 }
450 
451 /*-----------------------------------------------------------------------------------------*/
453 
454 /*TODO add all IF'S (service 1 .. the failcode acts as discriminant*/
455  if (CrFwPcktGetServType(pckt) == 1)
456  {
457  if(CrFwPcktGetServSubType(pckt) == 2)
458  {
459  /*Packet 1.2 - Failed Acceptance Verification Report*/
461  }
462  if(CrFwPcktGetServSubType(pckt) == 4)
463  {
464  /*Packet 1.4 - Failed Start of Execution Verification Report*/
466  }
467  if(CrFwPcktGetServSubType(pckt) == 6)
468  {
469  /*Packet 1.6 - Failed Progress of Execution Verification Report*/
471  }
472  if(CrFwPcktGetServSubType(pckt) == 8)
473  {
474  /*Packet 1.8 - Failed Completion of Execution Verification Report*/
476  }
477  if(CrFwPcktGetServSubType(pckt) == 10)
478  {
479  /*Packet 1.10 - Failed Routing Verification Report*/
481  }
482  }
483 
484 /*Service 3*/
485  if (CrFwPcktGetServType(pckt) == 3)
486  {
487  if(CrFwPcktGetServSubType(pckt) == 1)
488  {
489  /*Packet 3.1 - Create Housekeeping Parameter Report Structure Command*/
491  }
492  if(CrFwPcktGetServSubType(pckt) == 2)
493  {
494  /*Packet 3.2 - Create Diagnostic Parameter Report Structure Command*/
496  }
497  if(CrFwPcktGetServSubType(pckt) == 10)
498  {
499  /*Packet 3.10 - Housekeeping Parameter Report Structure Report*/
501  }
502  if(CrFwPcktGetServSubType(pckt) == 12)
503  {
504  /*Packet 3.12 - Diagnostic Parameter Report Structure Report*/
506  }
507  if(CrFwPcktGetServSubType(pckt) == 25)
508  {
509  /*Packet 3.25 - Housekeeping Parameter Report*/
510  return (CrFwDiscriminant_t) getHkRepRepStrucId(pckt);
511  }
512  if(CrFwPcktGetServSubType(pckt) == 26)
513  {
514  /*Packet 3.26 - Diagnostic Parameter Report*/
515  return (CrFwDiscriminant_t) getHkRepRepStrucId(pckt);
516  }
517  }
518 
519 /*Service 5 */
520  if (CrFwPcktGetServType(pckt) == 5)
521  {
522  if(CrFwPcktGetServSubType(pckt) == 1)
523  {
524  /*Packet 5.1 - Informative Event Report (Level 1)*/
525  return (CrFwDiscriminant_t) getEvtRep1EventId(pckt);
526  }
527  if(CrFwPcktGetServSubType(pckt) == 2)
528  {
529  /*Packet 5.2 - Low Severity Event Report (Level 2)*/
530  return (CrFwDiscriminant_t) getEvtRep2EventId(pckt);
531  }
532  if(CrFwPcktGetServSubType(pckt) == 3)
533  {
534  /*Packet 5.3 - Medium Severity Event Report (Level 3)*/
535  return (CrFwDiscriminant_t) getEvtRep3EventId(pckt);
536  }
537  if(CrFwPcktGetServSubType(pckt) == 4)
538  {
539  /*Packet 5.4 - High Severity Event Report (Level 4)*/
540  return (CrFwDiscriminant_t) getEvtRep4EventId(pckt);
541  }
542  }
543 
544  return 0;
545 }
546 
547 /*-----------------------------------------------------------------------------------------*/
549  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
550  {
551  setTmHeaderDestId(pckt, dest);
552  }
553  else
554  {
555  CrFwPcktSetPid(pckt, dest);
556  }
557 }
558 
559 /*-----------------------------------------------------------------------------------------*/
561  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
562  {
563  return (CrFwDestSrc_t) getTmHeaderDestId(pckt);
564  }
565  else
566  {
567  return (CrFwDestSrc_t) CrFwPcktGetPid(pckt);
568  }
569 }
570 
571 /*-----------------------------------------------------------------------------------------*/
572 void CrFwPcktSetSrc(CrFwPckt_t pckt, CrFwDestSrc_t src) {
573  if (CrFwPcktGetCmdRepType(pckt) == crCmdType)
574  {
575  setTcHeaderSrcId(pckt, src);
576  }
577  else
578  {
579  CrFwPcktSetPid(pckt, src);
580  }
581 }
582 
583 /*-----------------------------------------------------------------------------------------*/
585  if (CrFwPcktGetCmdRepType(pckt) == crCmdType)
586  {
587  return (CrFwDestSrc_t) getTcHeaderSrcId(pckt);
588  }
589  else
590  {
591  return (CrFwDestSrc_t) CrFwPcktGetPid(pckt);
592  }
593 }
594 
595 /*-----------------------------------------------------------------------------------------*/
596 void CrFwPcktSetAckLevel(CrFwPckt_t pckt, CrFwBool_t accept, CrFwBool_t start,
597  CrFwBool_t progress, CrFwBool_t term) {
598  if (CrFwPcktGetCmdRepType(pckt) == crCmdType)
599  {
600  setTcHeaderAckAccFlag(pckt, accept);
601  setTcHeaderAckStartFlag(pckt, start);
602  setTcHeaderAckProgFlag(pckt, progress);
603  setTcHeaderAckTermFlag(pckt, term);
604  }
605 }
606 
607 /*-----------------------------------------------------------------------------------------*/
609  if (CrFwPcktGetCmdRepType(pckt) == crCmdType)
610  {
611  return (CrFwBool_t) getTcHeaderAckAccFlag(pckt);
612  }
613  return 0;
614 }
615 
616 /*-----------------------------------------------------------------------------------------*/
618  if (CrFwPcktGetCmdRepType(pckt) == crCmdType)
619  {
620  return (CrFwBool_t) getTcHeaderAckStartFlag(pckt);
621  }
622  return 0;
623 }
624 
625 /*-----------------------------------------------------------------------------------------*/
627  if (CrFwPcktGetCmdRepType(pckt) == crCmdType)
628  {
629  return (CrFwBool_t) getTcHeaderAckProgFlag(pckt);
630  }
631  return 0;
632 }
633 
634 /*-----------------------------------------------------------------------------------------*/
636  if (CrFwPcktGetCmdRepType(pckt) == crCmdType)
637  {
638  return (CrFwBool_t) getTcHeaderAckTermFlag(pckt);
639  }
640  return 0;
641 }
642 
643 /*-----------------------------------------------------------------------------------------*/
644 char* CrFwPcktGetParStart(CrFwPckt_t pckt) {
645  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
646  {
647  return (CrFwPckt_t) &pckt[sizeof(TmHeader_t)];
648  }
649  else
650  {
651  return (CrFwPckt_t) &pckt[sizeof(TcHeader_t)];
652  }
653 }
654 
655 /*-----------------------------------------------------------------------------------------*/
657  if (CrFwPcktGetCmdRepType(pckt) == crRepType)
658  {
659  return (CrFwPcktLength_t) (CrFwPcktGetLength(pckt)-sizeof(TmHeader_t));
660  }
661  else
662  {
663  return (CrFwPcktLength_t) (CrFwPcktGetLength(pckt)-sizeof(TcHeader_t));
664  }
665 }
666 
667 /*-----------------------------------------------------------------------------------------*/
668 void CrFwPcktSetGroup(CrFwPckt_t pckt, CrFwGroup_t group) {
669  CrFwPcktSetPcat(pckt, group+1);
670 }
671 
672 /*-----------------------------------------------------------------------------------------*/
674  return CrFwPcktGetPcat(pckt)-1;
675 }
676 
677 
678 
679 
static void setTcHeaderAckTermFlag(void *p, One_Bit_t AckTermFlag)
Set "AckTermFlag" in "TcHeader" packet.
Definition: CrPsPkt.h:502
CrFwBool_t CrFwPcktIsAvail(CrFwPcktLength_t pcktLength)
Check whether a packet of a specified length is available.
static CrPsEid_t getEvtRep2EventId(void *p)
Get "EventId" from "EvtRep2" packet.
static CrPsEid_t getEvtRep1EventId(void *p)
Get "EventId" from "EvtRep1" packet.
CrFwDestSrc_t CrFwPcktGetSrc(CrFwPckt_t pckt)
Return the source of the command or report encapsulated in a packet.
CrFwTimeStamp_t CrFwPcktGetTimeStamp(CrFwPckt_t pckt)
Return the time stamp of the command or report encapsulated in a packet.
CrFwCounterU4_t i
CrPsCmd5EidStart function definitions.
A packet allocation request has failed (see CrFwPcktMake).
CrFwServType_t CrFwPcktGetServType(CrFwPckt_t pckt)
Return the service type of the command or report encapsulated in a packet.
void CrFwPcktRelease(CrFwPckt_t pckt)
Release function for command or report packets.
CrFwDiscriminant_t CrFwPcktGetDiscriminant(CrFwPckt_t pckt)
Return the discriminant of the command or report encapsulated in a packet.
static void setHkRepStructRepRepStrucId(void *p, CrPsSid_t RepStrucId)
Set "RepStrucId" in "HkRepStructRep" packet.
CrFwPckt_t * pckt
The list of packets in the PQ.
static CrFwServSubType_t servSubType
Service sub-type.
Report type.
Definition: CrFwConstants.h:43
static CrPsFailCode_t getVerFailedRoutingRepFailureCode(void *p)
Get "FailureCode" from "VerFailedRoutingRep" packet.
CrFwInstanceId_t CrFwPcktGetCmdRepId(CrFwPckt_t pckt)
Return the command or report identifier of the command or report encapsulated in a packet...
#define CR_FW_MAX_PCKT_LENGTH
The maximum size in number of bytes of a packet.
void CrFwPcktSetServType(CrFwPckt_t pckt, CrFwServType_t servType)
Set the service type of the command or report encapsulated in a packet.
static One_Bit_t getTcHeaderAckStartFlag(void *p)
Get "AckStartFlag" from "TcHeader" packet.
Definition: CrPsPkt.h:419
unsigned char CrFwServSubType_t
Type used for the command or report sub-type.
void CrFwSetAppErrCode(CrFwAppErrCode_t errCode)
Set the value of the application error code (see CrFwGetAppErrCode).
Header file to define all user-configurable constants and types for the IASW Application.
unsigned char CrFwGroup_t
Type used for the destination or source group of a packet.
CrFwCmdRepType_t CrFwPcktGetCmdRepType(CrFwPckt_t pckt)
Return the type of a packet (either a command packet or a report packet).
static CrPsSid_t getHkRepStructRepRepStrucId(void *p)
Get "RepStrucId" from "HkRepStructRep" packet.
static void setTmHeaderServSubType(void *p, uint8_t ServSubType)
Set "ServSubType" in "TmHeader" packet.
Definition: CrPsPkt.h:926
CrFwBool_t CrFwPcktIsTermAck(CrFwPckt_t pckt)
Return the acknowledge level for command termination for the command encapsulated in the packet...
static CrPsFailCode_t getVerFailedTermRepFailureCode(void *p)
Get "FailureCode" from "VerFailedTermRep" packet.
static void setEvtRep1EventId(void *p, CrPsEid_t EventId)
Set "EventId" in "EvtRep1" packet.
static void setEvtRep4EventId(void *p, CrPsEid_t EventId)
Set "EventId" in "EvtRep4" packet.
void CrFwPcktSetSrc(CrFwPckt_t pckt, CrFwDestSrc_t src)
Set the source of the command or report encapsulated in a packet.
static void setTmHeaderTime(void *p, const void *src)
Set "Time" array in "TmHeader" packet.
Definition: CrPsPkt.h:986
static void setHkCreateCmdRepStrucId(void *p, CrPsSid_t RepStrucId)
Set "RepStrucId" in "HkCreateCmd" packet.
#define CR_FW_MAX_NOF_PCKTS
The maximum number of packets which can be created with the default packet implementation.
static CrPsFailCode_t getVerFailedStartRepFailureCode(void *p)
Get "FailureCode" from "VerFailedStartRep" packet.
unsigned short CrFwInstanceId_t
Type used for instance identifiers.
unsigned char CrFwDestSrc_t
Type used for the command or report destination and source.
CrFwCmdRepType_t
Enumerated type for command and reports.
Definition: CrFwConstants.h:39
CrFwPckt_t CrFwPcktMake(CrFwPcktLength_t pcktLength)
Make function for command or report packets.
void CrFwPcktSetCmdRepId(CrFwPckt_t pckt, CrFwInstanceId_t id)
Set the command or report identifier in the command or report encapsulated in a packet.
Interface for creating and accessing a report or command packet.
static FourTeen_Bit_t getTmHeaderSeqCount(void *p)
Get "SeqCount" from "TmHeader" packet.
Definition: CrPsPkt.h:763
static void getTmHeaderTime(void *p, void *dest)
Get "Time" array from "TmHeader" packet.
Definition: CrPsPkt.h:974
uint16_t CrPsApid_t
Type used for the Application ID of a packet.
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
Definition: CrFwConstants.h:30
static void setTmHeaderAPID(void *p, Eleven_Bit_t APID)
Set "APID" in "TmHeader" packet.
Definition: CrPsPkt.h:710
static void setEvtRep3EventId(void *p, CrPsEid_t EventId)
Set "EventId" in "EvtRep3" packet.
unsigned char CrFwServType_t
Type used for the service type of a command or report.
static void setTcHeaderAckProgFlag(void *p, One_Bit_t AckProgFlag)
Set "AckProgFlag" in "TcHeader" packet.
Definition: CrPsPkt.h:468
static One_Bit_t getTcHeaderAckTermFlag(void *p)
Get "AckTermFlag" from "TcHeader" packet.
Definition: CrPsPkt.h:487
static void setVerFailedRoutingRepFailureCode(void *p, CrPsFailCode_t FailureCode)
Set "FailureCode" in "VerFailedRoutingRep" packet.
void CrFwPcktSetCmdRepType(CrFwPckt_t pckt, CrFwCmdRepType_t type)
Set the type of a packet (either a command packet or a report packet).
Header file to define all invariant publicly available constants and types for the CORDET Framework...
CrFwSeqCnt_t CrFwPcktGetSeqCnt(CrFwPckt_t pckt)
Return the sequence counter of the command or report encapsulated in a packet.
Interface for accessing fields in packets of service "ServTest".
void CrFwPcktSetSeqCnt(CrFwPckt_t pckt, CrFwSeqCnt_t seqCnt)
Set the sequence counter of the command or report encapsulated in a packet.
Command type.
Definition: CrFwConstants.h:41
static void setTmHeaderDestId(void *p, uint8_t DestId)
Set "DestId" in "TmHeader" packet.
Definition: CrPsPkt.h:950
static CrPsSid_t getHkRepRepStrucId(void *p)
Get "RepStrucId" from "HkRep" packet.
CrFwDestSrc_t CrFwPcktGetDest(CrFwPckt_t pckt)
Return the destination of the command or report encapsulated in a packet.
CrFwPcktLength_t CrFwPcktGetLength(CrFwPckt_t pckt)
Return the length (in number of bytes) of a packet.
static void setEvtRep2EventId(void *p, CrPsEid_t EventId)
Set "EventId" in "EvtRep2" packet.
Interface for accessing fields in packets of service "ServReqVerif".
static void setVerFailedStartRepFailureCode(void *p, CrPsFailCode_t FailureCode)
Set "FailureCode" in "VerFailedStartRep" packet.
void CrFwPcktSetGroup(CrFwPckt_t pckt, CrFwGroup_t group)
Set the group of the command/report encapsulated in a packet.
unsigned short int CrFwPcktLength_t
Type for the packet length.
static CrPsEid_t getEvtRep4EventId(void *p)
Get "EventId" from "EvtRep4" packet.
static void setTcHeaderSrcId(void *p, uint8_t SrcId)
Set "SrcId" in "TcHeader" packet.
Definition: CrPsPkt.h:581
CrFwBool_t CrFwPcktIsProgressAck(CrFwPckt_t pckt)
Return the acknowledge level for command progress for the command encapsulated in the packet...
static Eleven_Bit_t getTmHeaderAPID(void *p)
Get "APID" from "TmHeader" packet.
Definition: CrPsPkt.h:695
static uint8_t getTcHeaderSrcId(void *p)
Get "SrcId" from "TcHeader" packet.
Definition: CrPsPkt.h:569
static void setVerFailedPrgrRepFailureCode(void *p, CrPsFailCode_t FailureCode)
Set "FailureCode" in "VerFailedPrgrRep" packet.
static CrFwCounterU2_t nOfAllocatedPckts
The number of currently allocated packets.
void CrFwPcktSetAckLevel(CrFwPckt_t pckt, CrFwBool_t accept, CrFwBool_t start, CrFwBool_t progress, CrFwBool_t term)
Set the acknowledge level for the command encapsulated in a packet.
CrFwPcktLength_t CrFwPcktGetMaxLength()
Return the maximum length of a packet in number of bytes.
char * CrFwPcktGetParStart(CrFwPckt_t pckt)
Return the start address of the packet&#39;s parameter area.
static Eleven_Bit_t getTcHeaderAPID(void *p)
Get "APID" from "TcHeader" packet.
Definition: CrPsPkt.h:225
Definition of the utility functions for the CORDET Framework.
static uint8_t getTmHeaderDestId(void *p)
Get "DestId" from "TmHeader" packet.
Definition: CrPsPkt.h:938
static uint8_t getTcHeaderServSubType(void *p)
Get "ServSubType" from "TcHeader" packet.
Definition: CrPsPkt.h:545
void CrFwPcktSetServSubType(CrFwPckt_t pckt, CrFwServSubType_t servSubType)
Set the service sub-type of the command or report encapsulated in a packet.
static char pcktArray[CR_FW_MAX_NOF_PCKTS *CR_FW_MAX_PCKT_LENGTH]
The array holding the packets.
static One_Bit_t getTcHeaderAckProgFlag(void *p)
Get "AckProgFlag" from "TcHeader" packet.
Definition: CrPsPkt.h:453
static void setTmHeaderServType(void *p, uint8_t ServType)
Set "ServType" in "TmHeader" packet.
Definition: CrPsPkt.h:902
static uint16_t getTcHeaderPcktDataLen(void *p)
Get "PcktDataLen" from "TcHeader" packet.
Definition: CrPsPkt.h:327
static void setTcHeaderAPID(void *p, Eleven_Bit_t APID)
Set "APID" in "TcHeader" packet.
Definition: CrPsPkt.h:240
unsigned short CrFwDiscriminant_t
Type used for the discriminant of a command or report.
static uint8_t getTcHeaderServType(void *p)
Get "ServType" from "TcHeader" packet.
Definition: CrPsPkt.h:521
static CrFwServType_t servType
Service type.
static CrFwBool_t pcktInUse[CR_FW_MAX_NOF_PCKTS]
The array holding the "in use" status of the packets.
CrFwServSubType_t CrFwPcktGetServSubType(CrFwPckt_t pckt)
Return the service sub-type of the command or report encapsulated in a packet.
static CrPsSid_t getHkCreateCmdRepStrucId(void *p)
Get "RepStrucId" from "HkCreateCmd" packet.
static CrFwDestSrc_t dest
Destination.
static FourTeen_Bit_t getTcHeaderSeqCount(void *p)
Get "SeqCount" from "TcHeader" packet.
Definition: CrPsPkt.h:293
CrFwGroup_t CrFwPcktGetGroup(CrFwPckt_t pckt)
Return the group of the command/report encapsulated in a packet.
CrFwCounterU2_t CrFwPcktGetNOfAllocated()
Return the number of packets which are currently allocated.
Interface for accessing fields in packets of service "ServEvt".
static CrPsFailCode_t getVerFailedAccRepFailureCode(void *p)
Get "FailureCode" from "VerFailedAccRep" packet.
void CrFwPcktSetDest(CrFwPckt_t pckt, CrFwDestSrc_t dest)
Set the destination of the command or report encapsulated in a packet.
Definition of Base Component.
static One_Bit_t getTcHeaderPcktType(void *p)
Get "PcktType" from "TcHeader" packet.
Definition: CrPsPkt.h:157
static uint8_t getTmHeaderServType(void *p)
Get "ServType" from "TmHeader" packet.
Definition: CrPsPkt.h:890
char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:36
static void setTcHeaderAckAccFlag(void *p, One_Bit_t AckAccFlag)
Set "AckAccFlag" in "TcHeader" packet.
Definition: CrPsPkt.h:400
static void setVerFailedAccRepFailureCode(void *p, CrPsFailCode_t FailureCode)
Set "FailureCode" in "VerFailedAccRep" packet.
CrFwPcktLength_t CrFwPcktGetParLength(CrFwPckt_t pckt)
Return the length in bytes of the packet&#39;s parameter area.
CrFwBool_t CrFwPcktIsAcceptAck(CrFwPckt_t pckt)
Return the acknowledge level for command acceptance for the command encapsulated in the packet...
void CrFwPcktSetTimeStamp(CrFwPckt_t pckt, CrFwTimeStamp_t timeStamp)
Set the time stamp of the command or report encapsulated in a packet.
static void setTcHeaderServType(void *p, uint8_t ServType)
Set "ServType" in "TcHeader" packet.
Definition: CrPsPkt.h:533
static void setTcHeaderPcktType(void *p, One_Bit_t PcktType)
Set "PcktType" in "TcHeader" packet.
Definition: CrPsPkt.h:172
Interface for accessing fields in packets of service "ServHk".
static void setTmHeaderPcktType(void *p, One_Bit_t PcktType)
Set "PcktType" in "TmHeader" packet.
Definition: CrPsPkt.h:642
static void setVerFailedTermRepFailureCode(void *p, CrPsFailCode_t FailureCode)
Set "FailureCode" in "VerFailedTermRep" packet.
static void setTcHeaderServSubType(void *p, uint8_t ServSubType)
Set "ServSubType" in "TcHeader" packet.
Definition: CrPsPkt.h:557
A packet release request has encountered an error (see CrFwPcktRelease).
static void setTcHeaderAckStartFlag(void *p, One_Bit_t AckStartFlag)
Set "AckStartFlag" in "TcHeader" packet.
Definition: CrPsPkt.h:434
CrFwBool_t CrFwPcktIsStartAck(CrFwPckt_t pckt)
Return the acknowledge level for command start for the command encapsulated in the packet...
static CrPsEid_t getEvtRep3EventId(void *p)
Get "EventId" from "EvtRep3" packet.
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
static void setHkRepRepStrucId(void *p, CrPsSid_t RepStrucId)
Set "RepStrucId" in "HkRep" packet.
unsigned int CrFwSeqCnt_t
Type used for the sequence counter of commands or reports.
void CrFwPcktSetDiscriminant(CrFwPckt_t pckt, CrFwDiscriminant_t discriminant)
Set the discriminant of the command or report encapsulated in a packet.
static void setTmHeaderSeqCount(void *p, FourTeen_Bit_t SeqCount)
Set "SeqCount" in "TmHeader" packet.
Definition: CrPsPkt.h:778
static uint8_t getTmHeaderServSubType(void *p)
Get "ServSubType" from "TmHeader" packet.
Definition: CrPsPkt.h:914
static CrPsFailCode_t getVerFailedPrgrRepFailureCode(void *p)
Get "FailureCode" from "VerFailedPrgrRep" packet.
static uint16_t getTmHeaderPcktDataLen(void *p)
Get "PcktDataLen" from "TmHeader" packet.
Definition: CrPsPkt.h:797
static void setTcHeaderSeqCount(void *p, FourTeen_Bit_t SeqCount)
Set "SeqCount" in "TcHeader" packet.
Definition: CrPsPkt.h:308
static One_Bit_t getTcHeaderAckAccFlag(void *p)
Get "AckAccFlag" from "TcHeader" packet.
Definition: CrPsPkt.h:385
static void setTmHeaderPcktDataLen(void *p, uint16_t PcktDataLen)
Set "PcktDataLen" in "TmHeader" packet.
Definition: CrPsPkt.h:809
unsigned int CrFwTimeStamp_t
Type used for the time stamp of a command or report.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved