|
CHAILink SDK
Version 1.3
|
Go to the documentation of this file.
28 #ifndef __CLCM_MESSAGE_H__
29 #define __CLCM_MESSAGE_H__
61 #define CLMSG_HEADER_OBJECTHANDLE_SIZE (4)
62 #define CLMSG_HEADER_METHODID_SIZE (2)
63 #define CLMSG_HEADER_STATUS_SIZE (2)
64 #define CLMSG_HEADER_SIZE (CLMSG_HEADER_OBJECTHANDLE_SIZE + CLMSG_HEADER_METHODID_SIZE + CLMSG_HEADER_STATUS_SIZE)
66 #define CLMSG_HEADER_POS (0)
67 #define CLMSG_HEADER_OBJECTHANDLE_POS (CLMSG_HEADER_POS)
68 #define CLMSG_HEADER_METHODID_POS (CLMSG_HEADER_OBJECTHANDLE_POS + CLMSG_HEADER_OBJECTHANDLE_SIZE)
69 #define CLMSG_HEADER_STATUS_POS (CLMSG_HEADER_METHODID_POS + CLMSG_HEADER_METHODID_SIZE)
70 #define CLMSG_DATA_POS (CLMSG_HEADER_STATUS_POS + CLMSG_HEADER_STATUS_SIZE)
72 #define CLMSG_ETHERNETFRAMEMAXSIZE (1500 + 18) // This size correspond to a valid Ethernet 2 frame :
76 #define CLMSG_ETHERNETMSGMAXSIZE (CLMSG_HEADER_SIZE + 2 + CLMSG_ETHERNETFRAMEMAXSIZE)
79 #define CLMSG_MESSAGEMINSIZE 400
80 #define CLMSG_MESSAGEMAXSIZE CLMSG_ETHERNETMSGMAXSIZE
84 #if !defined(CLMSG_MESSAGESIZE)
85 #define CLMSG_MESSAGESIZE CLMSG_MESSAGEMINSIZE
87 #if CLMSG_MESSAGESIZE < CLMSG_MESSAGEMINSIZE
88 #error CLMSG_MESSAGESIZE MUST be at least 400 bytes long.
89 #elif CLMSG_MESSAGESIZE > CLMSG_MESSAGEMAXSIZE
90 #error CLMSG_MESSAGESIZE MUST be less than CLMSG_MESSAGEMAXSIZE bytes long.
94 #define CLMSG_PAYLOADMAXSIZE (CLMSG_MESSAGESIZE - CLMSG_HEADER_SIZE)
96 #define DESERIALIZE_MSGHEADER(hObject, wMethodID, wStatus, ptr) \
97 DESERIALIZE_UINT32(hObject, ptr); \
98 DESERIALIZE_UINT16(wMethodID, ptr); \
99 DESERIALIZE_UINT16(wStatus, ptr); \
101 #define SERIALIZE_MSGHEADER(ptr, hObject, wMethodID, wStatus) \
102 SERIALIZE_UINT32(ptr, hObject); \
103 SERIALIZE_UINT16(ptr, wMethodID); \
104 SERIALIZE_UINT16(ptr, wStatus); \
112 #endif // __CLCM_MESSAGE_H__