st_msg_applayer.h 7.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
#ifndef ST_MSG_APPLAYER_H
#define ST_MSG_APPLAYER_H

namespace SmartLink{

#pragma  pack (push,1)

#if defined(__GNUC__)
#include <stdint.h>

//Host Reg request, send 64 byte Serial Num to Server
//SMARTLINK_MSG_APP::MsgType =  0x1000
typedef struct tag_stMsg_HostRegistReq{
丁劲犇's avatar
丁劲犇 已提交
14
	char HostSerialNum[64];
15 16 17 18 19
}stMsg_HostRegistReq;

//Host Reg replay, send back 4 byte ID
//SMARTLINK_MSG_APP::MsgType =  0x1800
typedef struct tag_stMsg_HostRegistRsp{
丁劲犇's avatar
丁劲犇 已提交
20 21 22
	__UINT8_TYPE__ DoneCode;//0 first ok, 1 ok 2 failed
	char TextInfo[64];
	__UINT32_TYPE__ ID;
23 24
}stMsg_HostRegistRsp;

丁劲犇's avatar
丁劲犇 已提交
25 26 27
//Host Log request
//SMARTLINK_MSG_APP::MsgType =  0x1001
typedef struct tag_stMsg_HostLogonReq{
丁劲犇's avatar
丁劲犇 已提交
28 29
	__UINT32_TYPE__ ID;
	char HostSerialNum[64];
丁劲犇's avatar
丁劲犇 已提交
30
} stMsg_HostLogonReq;
31

丁劲犇's avatar
丁劲犇 已提交
32 33 34
//Host Log response
//SMARTLINK_MSG_APP::MsgType =  0x1801
typedef struct tag_stMsg_HostLogonRsp{
丁劲犇's avatar
丁劲犇 已提交
35 36
	__UINT8_TYPE__ DoneCode;
	char TextInfo[64];
丁劲犇's avatar
丁劲犇 已提交
37 38
} stMsg_HostLogonRsp;

丁劲犇's avatar
丁劲犇 已提交
39 40 41
//User Login request
//SMARTLINK_MSG_APP::MsgType =  0x3000
typedef struct tag_stMsg_ClientLoginReq{
丁劲犇's avatar
丁劲犇 已提交
42 43 44
	__UINT16_TYPE__ ClientVersion;
	char UserName[32];
	char Password[32];
丁劲犇's avatar
丁劲犇 已提交
45 46 47 48 49
}stMsg_ClientLoginReq;

//User Log response
//SMARTLINK_MSG_APP::MsgType =  0x3800
typedef struct tag_stMsg_ClientLoginRsp{
丁劲犇's avatar
丁劲犇 已提交
50 51 52
	__UINT8_TYPE__ DoneCode;
	__UINT32_TYPE__ UserID;
	char TextInfo[64];
丁劲犇's avatar
丁劲犇 已提交
53
} stMsg_ClientLoginRsp;
丁劲犇's avatar
丁劲犇 已提交
54

丁劲犇's avatar
丁劲犇 已提交
55 56 57 58 59 60 61 62
//User Log response
//SMARTLINK_MSG_APP::MsgType =  0x1002
typedef struct tag_stMsg_HostTimeCorrectReq{

} stMsg_HostTimeCorrectReq;

//Time Correct
typedef struct tag_stMsg_HostTimeCorrectRsp{
丁劲犇's avatar
丁劲犇 已提交
63 64 65 66 67 68 69 70 71 72
	__UINT8_TYPE__ DoneCode;
	char TextInfo[64];
	struct tag_stDateTime{
	  __UINT16_TYPE__ Year;
	  __UINT8_TYPE__ Month;
	  __UINT8_TYPE__ Day;
	  __UINT8_TYPE__ Hour;
	  __UINT8_TYPE__ Minute;
	  __UINT8_TYPE__ Second;
	} DateTime;
丁劲犇's avatar
丁劲犇 已提交
73 74
}stMsg_HostTimeCorrectRsp;

75 76
//UploadUserListReq,0x1003
typedef struct tag_stMsg_UploadUserListReq{
丁劲犇's avatar
丁劲犇 已提交
77 78
	__UINT16_TYPE__ UserNum;
	__UINT32_TYPE__ pUserIDList[1];
79 80 81 82 83
}stMsg_UploadUserListReq;

//User Log response
//SMARTLINK_MSG_APP::MsgType =  0x1803
typedef struct tag_stMsg_UploadUserListRsp{
丁劲犇's avatar
丁劲犇 已提交
84 85
	__UINT8_TYPE__ DoneCode;
	char TextInfo[64];
86 87 88 89 90 91 92 93 94
} stMsg_UploadUserListRsp;

//SMARTLINK_MSG_APP::MsgType =  0x1004
typedef struct tag_stMsg_DownloadUserListReq{

} stMsg_DownloadUserListReq;

//SMARTLINK_MSG_APP::MsgType =  0x1804
typedef struct tag_stMsg_DownloadUserListRsp{
丁劲犇's avatar
丁劲犇 已提交
95 96 97 98
	__UINT8_TYPE__ DoneCode;
	char TextInfo[64];
	__UINT16_TYPE__ UserNum;
	__UINT32_TYPE__ pUserIDList[1];
99 100 101
} stMsg_DownloadUserListRsp;


丁劲犇's avatar
丁劲犇 已提交
102 103
//0x3001
typedef struct tag_stMsg_ClientLogoutReq{
丁劲犇's avatar
丁劲犇 已提交
104
	char UserName[32];
丁劲犇's avatar
丁劲犇 已提交
105 106 107 108
}stMsg_ClientLogoutReq;

//0x3801
typedef struct tag_stMsg_ClientLogoutRsp{
丁劲犇's avatar
丁劲犇 已提交
109 110
	__UINT8_TYPE__ DoneCode;
	char TextInfo[64];
丁劲犇's avatar
丁劲犇 已提交
111 112 113 114 115 116 117 118
}stMsg_ClientLogoutRsp;

//SMARTLINK_MSG_APP::MsgType =  0x3002
typedef struct tag_stMsg_GetHostListReq{

} stMsg_GetHostListReq;
//SMARTLINK_MSG_APP::MsgType =  0x3802
typedef struct  tag_stMsg_GetHostListRsp{
丁劲犇's avatar
丁劲犇 已提交
119 120
	__UINT32_TYPE__ HostNum;
	__UINT32_TYPE__ pHostIDList[1];
丁劲犇's avatar
丁劲犇 已提交
121 122
}stMsg_GetHostListRsp;

123
typedef struct tag_smartlink_app_layer{
丁劲犇's avatar
丁劲犇 已提交
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
	struct tag_app_layer_header{
		__UINT16_TYPE__ MsgFmtVersion;
		__UINT8_TYPE__ AskID;
		__UINT16_TYPE__ MsgType;
	} header;
	union  union_MsgUnion
	{
		 stMsg_HostRegistReq msg_HostRegistReq;
		 stMsg_HostRegistRsp msg_HostRegistRsp;
		 stMsg_HostLogonReq msg_HostLogonReq;
		 stMsg_HostLogonRsp msg_HostLogonRsp;
		 stMsg_ClientLoginReq msg_ClientLoginReq;
		 stMsg_ClientLoginRsp msg_ClientLoginRsp;
		 stMsg_HostTimeCorrectReq msg_HostTimeCorrectReq;
		 stMsg_HostTimeCorrectRsp msg_HostTimeCorrectRsp;
		 stMsg_UploadUserListReq  msg_UploadUserListReq;
		 stMsg_UploadUserListRsp  msg_UploadUserListRsp;
		 stMsg_DownloadUserListReq msg_DownloadUserListReq;
		 stMsg_DownloadUserListRsp msg_DownloadUserListRsp;
		 stMsg_ClientLogoutReq msg_ClientLogoutReq;
		 stMsg_ClientLogoutRsp msg_ClientLogoutRsp;
		 stMsg_GetHostListReq msg_GetHostListReq;
		 stMsg_GetHostListRsp msg_GetHostListRsp;
	}MsgUnion;
148 149 150 151 152 153 154 155 156
} SMARTLINK_MSG_APP;

#endif

#if defined(_MSC_VER)

//Host Reg request, send 64 byte Serial Num to Server
//SMARTLINK_MSG_APP::MsgType =  0x1000
typedef struct tag_stMsg_HostRegistReq{
丁劲犇's avatar
丁劲犇 已提交
157
	char HostSerialNum[64];
158 159 160 161 162 163
}stMsg_HostRegistReq;


//Host Reg replay, send back 4 byte ID
//SMARTLINK_MSG_APP::MsgType =  0x1800
typedef struct tag_stMsg_HostRegistRsp{
丁劲犇's avatar
丁劲犇 已提交
164 165 166
	unsigned __int8 DoneCode;
	//char TextInfo[64];
	unsigned __int32 ID;
167 168
}stMsg_HostRegistRsp;

丁劲犇's avatar
丁劲犇 已提交
169 170 171
//Host Log request
//SMARTLINK_MSG_APP::MsgType =  0x1001
typedef struct tag_stMsg_HostLogonReq{
丁劲犇's avatar
丁劲犇 已提交
172 173
	unsigned __int32 ID;
	char HostSerialNum[64];
丁劲犇's avatar
丁劲犇 已提交
174 175 176 177 178
} stMsg_HostLogonReq;

//Host Log response
//SMARTLINK_MSG_APP::MsgType =  0x1801
typedef struct tag_stMsg_HostLogonRsp{
丁劲犇's avatar
丁劲犇 已提交
179 180
	unsigned __int8 DoneCode;
	//char TextInfo[64];
丁劲犇's avatar
丁劲犇 已提交
181 182
} stMsg_HostLogonRsp;

丁劲犇's avatar
丁劲犇 已提交
183 184 185
//User Login request
//SMARTLINK_MSG_APP::MsgType =  0x3000
typedef struct tag_stMsg_ClientLoginReq{
丁劲犇's avatar
丁劲犇 已提交
186 187 188
	unsigned __int16 ClientVersion;
	char UserName[32];
	char Password[32];
丁劲犇's avatar
丁劲犇 已提交
189 190 191 192 193
}stMsg_ClientLoginReq;

//User Log response
//SMARTLINK_MSG_APP::MsgType =  0x3800
typedef struct tag_stMsg_ClientLoginRsp{
丁劲犇's avatar
丁劲犇 已提交
194 195 196
	unsigned __int8 DoneCode;
	unsigned __int32 UserID;
	//char TextInfo[64];
丁劲犇's avatar
丁劲犇 已提交
197
} stMsg_ClientLoginRsp;
198

丁劲犇's avatar
丁劲犇 已提交
199 200 201 202 203 204 205 206 207

//User Log response
//SMARTLINK_MSG_APP::MsgType =  0x1002
typedef struct tag_stMsg_HostTimeCorrectReq{

} stMsg_HostTimeCorrectReq;

//Time Correct
typedef struct tag_stMsg_HostTimeCorrectRsp{
丁劲犇's avatar
丁劲犇 已提交
208 209 210 211 212 213 214 215 216 217
	unsigned __int8 DoneCode;
	//char TextInfo[64];
	struct tag_stDateTime{
	  unsigned __int16 Year;
	  unsigned __int8 Month;
	  unsigned __int8 Day;
	  unsigned __int8 Hour;
	  unsigned __int8 Minute;
	  unsigned __int8 Second;
	} DateTime;
丁劲犇's avatar
丁劲犇 已提交
218 219
}stMsg_HostTimeCorrectRsp;

丁劲犇's avatar
丁劲犇 已提交
220 221
//UploadUserListReq,0x1003
typedef struct tag_stMsg_UploadUserListReq{
丁劲犇's avatar
丁劲犇 已提交
222 223
	unsigned __int16 UserNum;
	unsigned __int32 pUserIDList[1];
丁劲犇's avatar
丁劲犇 已提交
224 225 226 227 228
}stMsg_UploadUserListReq;

//User Log response
//SMARTLINK_MSG_APP::MsgType =  0x1803
typedef struct tag_stMsg_UploadUserListRsp{
丁劲犇's avatar
丁劲犇 已提交
229 230
	unsigned __int8 DoneCode;
	//char TextInfo[64];
丁劲犇's avatar
丁劲犇 已提交
231 232 233
} stMsg_UploadUserListRsp;


234 235 236 237 238 239 240
//SMARTLINK_MSG_APP::MsgType =  0x1004
typedef struct tag_stMsg_DownloadUserListReq{

} stMsg_DownloadUserListReq;

//SMARTLINK_MSG_APP::MsgType =  0x1804
typedef struct tag_stMsg_DownloadUserListRsp{
丁劲犇's avatar
丁劲犇 已提交
241 242 243 244
	unsigned __int8 DoneCode;
	//char TextInfo[64];
	unsigned __int16 UserNum;
	unsigned __int32 pUserIDList[1];
245 246
} stMsg_DownloadUserListRsp;

丁劲犇's avatar
丁劲犇 已提交
247 248
//0x3001
typedef struct tag_stMsg_ClientLogoutReq{
丁劲犇's avatar
丁劲犇 已提交
249
	char UserName[32];
丁劲犇's avatar
丁劲犇 已提交
250 251 252 253
}stMsg_ClientLogoutReq;

//0x3801
typedef struct tag_stMsg_ClientLogoutRsp{
丁劲犇's avatar
丁劲犇 已提交
254 255
	unsigned __int8 DoneCode;
	//char TextInfo[64];
丁劲犇's avatar
丁劲犇 已提交
256 257 258 259
}stMsg_ClientLogoutRsp;

//SMARTLINK_MSG_APP::MsgType =  0x3002
typedef struct tag_stMsg_GetHostListReq{
丁劲犇's avatar
丁劲犇 已提交
260

丁劲犇's avatar
丁劲犇 已提交
261 262 263
} stMsg_GetHostListReq;
//SMARTLINK_MSG_APP::MsgType =  0x3802
typedef struct  tag_stMsg_GetHostListRsp{
丁劲犇's avatar
丁劲犇 已提交
264 265
	quint32 HostNum;
	quint32 pHostIDList[1];
丁劲犇's avatar
丁劲犇 已提交
266
}stMsg_GetHostListRsp;
丁劲犇's avatar
丁劲犇 已提交
267

268
typedef struct tag_smartlink_app_layer{
丁劲犇's avatar
丁劲犇 已提交
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
	struct tag_app_layer_header{
		unsigned __int16 MsgFmtVersion;
		unsigned __int8 AskID;
		unsigned __int16 MsgType;
	} header;
	union  union_MsgUnion
	{
		stMsg_HostRegistReq msg_HostRegistReq;
		stMsg_HostRegistRsp msg_HostRegistRsp;
		stMsg_HostLogonReq msg_HostLogonReq;
		stMsg_HostLogonRsp msg_HostLogonRsp;
		stMsg_ClientLoginReq msg_ClientLoginReq;
		stMsg_ClientLoginRsp msg_ClientLoginRsp;
		stMsg_HostTimeCorrectReq msg_HostTimeCorrectReq;
		stMsg_HostTimeCorrectRsp msg_HostTimeCorrectRsp;
		stMsg_UploadUserListReq  msg_UploadUserListReq;
		stMsg_UploadUserListRsp  msg_UploadUserListRsp;
		stMsg_DownloadUserListReq msg_DownloadUserListReq;
		stMsg_DownloadUserListRsp msg_DownloadUserListRsp;
		stMsg_ClientLogoutReq msg_ClientLogoutReq;
		stMsg_ClientLogoutRsp msg_ClientLogoutRsp;
		stMsg_GetHostListReq msg_GetHostListReq;
		stMsg_GetHostListRsp msg_GetHostListRsp;

	}MsgUnion;
294 295

} SMARTLINK_MSG_APP;
丁劲犇's avatar
丁劲犇 已提交
296

297 298 299 300 301 302
#endif



#pragma pack(pop)

丁劲犇's avatar
丁劲犇 已提交
303
}
304
#endif // ST_MSG_APPLAYER_H