CHAILink SDK  Version 1.3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CLCm_Utils.h
Go to the documentation of this file.
1 //*********************************************************
2 // File: CLCm_Utils.h
3 // Project: CopperLan CHAILink SDK Common Part
4 // For Client & Server
5 // Version: 1.3
6 // Release Date: 2014/04/15
7 //**********************************************************
8 
9 /********************************************************************
10 Software License Agreement: CHAILink Client source code
11 
12 The software supplied herewith by Klavis Technology (the “Company”) is intended and
13 supplied to you, the Company’s customer, for use solely and exclusively on embedded
14 CopperLan products needing a CHAILink Client.
15  The software is owned by the Company and/or its supplier, and is protected
16  under applicable copyright laws. All rights are reserved. Any use in violation of the
17  foregoing restrictions may subject the user to criminal sanctions under applicable laws,
18 as well as to civil liability for the breach of the terms and conditions of this license.
19 
20 THIS SOFTWARE MUST REMAIN UNMODIFIED. NO WARRANTIES, WHETHER EXPRESS,
21  IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
22  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE
23 IN CASE OF SOURCE CODE CHANGE BY THE CUSTOMER. IN CASE OF SUCH CHANGE, THE
24 COMPANY SHALL NOT BE LIABLE FOR SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
25 OF ANY KIND.
26 ********************************************************************/
27 
28 #ifndef __CLCM_UTILS_H__
29 #define __CLCM_UTILS_H__
30 
31 #include "CLCm_Defines.h"
32 
34 
35 // size for special types
36 #define CLM_DEVICEID_SIZE (sizeof(CPUINT16) * 5)
37 #define CLM_ENDPOINT_SIZE (sizeof(CPUINT16) * 6)
38 #define CLM_SECTIONID_SIZE (sizeof(CPUINT16) * 5)
39 #define CLM_PARAMETERID_SIZE (sizeof(CPUINT16) * 4)
40 #define CLM_CONTROLLERID_SIZE (sizeof(CPUINT16) * 3)
41 #define CLM_CONTROLLERASSIGNMENT_SIZE (CLM_ENDPOINT_SIZE + sizeof(CPUINT16) * 6 + sizeof(CPUINT8) * 2)
42 #define CLM_SMARTCONNECTSECTIONITEM_SIZE (sizeof(CPUINT64) + CLM_DEVICEID_SIZE + sizeof(CPUINT16))
43 #define CLM_SMARTCONNECTCONTROLLERITEM_SIZE (sizeof(CPUINT16) * 5)
44 #define CLM_INTERNAL_VALUE_SIZE (sizeof(CPUINT16) * 2 + sizeof(CPUINT8) * 8)
45 #define CLM_APPMSGHEADER_SIZE (sizeof(CPUINT16) + CLM_ENDPOINT_SIZE + sizeof(CPUINT8) * 2)
46 #define CLM_APPMODIFIERMSG_SIZE (sizeof(CPUINT16) * 10 + CLM_INTERNAL_VALUE_SIZE)
47 #define CLM_APPEVENTMSG_SIZE (sizeof(CPUINT16) * 9)
48 #define CLM_APPSELECTORMSG_SIZE (sizeof(CPUINT16) * 11)
49 #define CLM_APPTEXTMSG_BASESIZE (sizeof(CPUINT16) * 10)
50 #define CLM_APPMIDISYSEXMSG_BASESIZE (sizeof(CPUINT8) * 2)
51 #define CLM_TIMESTAMPINFO_SIZE (sizeof(CPUINT64) + sizeof(CPUINT32) + sizeof(CPUINT16))
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 //=========================================================================
58 // Serialization/Deserialization
59 //=========================================================================
60 CPUINT16 Serialize_String(CPCHAR8 const * const utf8Text, CPUINT16 const wMaxSize, CPBYTE** ppCursor);
61 CPUINT16 Deserialize_String(CPCHAR8 const ** const putf8Text, CPUINT16 const wMaxSize, CPBYTE ** ppCursor);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
68 
69 #endif // __CLCM_UTILS_H__
70 
char CPCHAR8
Character Type (8 bit signed)
Definition: PlatformTypes.h:66
unsigned short CPUINT16
Word Integer (16 bit unsigned)
Definition: PlatformTypes.h:45