CORDET Framework - C2 Implementation
CrPsPktServTest.h
Go to the documentation of this file.
1 
23 #ifndef CRPSPKTSERVTEST_H_
24 #define CRPSPKTSERVTEST_H_
25 
26 #include "CrPsUserConstants.h"
27 #include "CrPsPkt.h"
28 
32 typedef struct __attribute__((packed)) _AreYouAliveCmd_t {
36  TcHeader_t Header;
37 
38 } AreYouAliveCmd_t ;
39 
43 typedef struct __attribute__((packed)) _AreYouAliveRep_t {
47  TmHeader_t Header;
48 
49 } AreYouAliveRep_t ;
50 
54 typedef struct __attribute__((packed)) _OnBoardConnectCmd_t {
58  TcHeader_t Header;
59 
63  CrPsApid_t AppId;
64 
65 } OnBoardConnectCmd_t ;
66 
70 typedef struct __attribute__((packed)) _OnBoardConnectRep_t {
74  TmHeader_t Header;
75 
79  CrPsDestSrc_t Dest;
80 
81 } OnBoardConnectRep_t ;
82 
88 static inline CrPsApid_t getOnBoardConnectCmdAppId(void* p)
89 {
90  OnBoardConnectCmd_t* t;
91  t = (OnBoardConnectCmd_t*)p;
92  return __builtin_bswap16(t->AppId);
93 }
94 
100 static inline void setOnBoardConnectCmdAppId(void* p, CrPsApid_t AppId)
101 {
102  OnBoardConnectCmd_t* t;
103  t = (OnBoardConnectCmd_t*)p;
104  t->AppId = __builtin_bswap16(AppId);
105 }
106 
113 {
114  OnBoardConnectRep_t* t;
115  t = (OnBoardConnectRep_t*)p;
116  return __builtin_bswap16(t->Dest);
117 }
118 
124 static inline void setOnBoardConnectRepDest(void* p, CrPsDestSrc_t Dest)
125 {
126  OnBoardConnectRep_t* t;
127  t = (OnBoardConnectRep_t*)p;
128  t->Dest = __builtin_bswap16(Dest);
129 }
130 
131 
132 /*----------------------------------------------------------------------------*/
133 #endif /* CRPSPKTSERVTEST_H */
static void setOnBoardConnectRepDest(void *p, CrPsDestSrc_t Dest)
Set "Dest" in "OnBoardConnectRep" packet.
static void setOnBoardConnectCmdAppId(void *p, CrPsApid_t AppId)
Set "AppId" in "OnBoardConnectCmd" packet.
Header file to define all user-configurable constants and types for the IASW Application.
uint16_t CrPsApid_t
Type used for the Application ID of a packet.
uint16_t CrPsDestSrc_t
Type used for the Destination or Source of a packet.
Packet header definitions.
struct __attribute__((packed)) _AreYouAliveCmd_t
Structure for AreYouAliveCmd.
static CrPsDestSrc_t getOnBoardConnectRepDest(void *p)
Get "Dest" from "OnBoardConnectRep" packet.
static CrPsApid_t getOnBoardConnectCmdAppId(void *p)
Get "AppId" from "OnBoardConnectCmd" packet.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved