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

namespace SmartLink{

#pragma  pack (push,1)

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

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

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

	//Host Log request
	//SMARTLINK_MSG_APP::MsgType =  0x1001
	typedef struct tag_stMsg_HostLogonReq{
		__UINT32_TYPE__ ID;
29
		char HostSerialNum[1];//max 64
丁劲犇's avatar
丁劲犇 已提交
30 31 32 33 34 35 36 37 38 39 40 41
	} stMsg_HostLogonReq;

	//Host Log response
	//SMARTLINK_MSG_APP::MsgType =  0x1801
	typedef struct tag_stMsg_HostLogonRsp{
		__UINT8_TYPE__ DoneCode;
	} stMsg_HostLogonRsp;

	//User Login request
	//SMARTLINK_MSG_APP::MsgType =  0x3000
	typedef struct tag_stMsg_ClientLoginReq{
		__UINT16_TYPE__ ClientVersion;
42
		char UserNameAndPasswd[1];
丁劲犇's avatar
丁劲犇 已提交
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
	}stMsg_ClientLoginReq;

	//User Log response
	//SMARTLINK_MSG_APP::MsgType =  0x3800
	typedef struct tag_stMsg_ClientLoginRsp{
		__UINT8_TYPE__ DoneCode;
		__UINT32_TYPE__ UserID;
	} stMsg_ClientLoginRsp;

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

	} stMsg_HostTimeCorrectReq;

	//Time Correct
	typedef struct tag_stMsg_HostTimeCorrectRsp{
		__UINT8_TYPE__ DoneCode;
		struct tag_stDateTime{
			__UINT16_TYPE__ Year;
			__UINT8_TYPE__ Month;
			__UINT8_TYPE__ Day;
			__UINT8_TYPE__ Hour;
			__UINT8_TYPE__ Minute;
			__UINT8_TYPE__ Second;
		} DateTime;
	}stMsg_HostTimeCorrectRsp;

	//UploadUserListReq,0x1003
	typedef struct tag_stMsg_UploadUserListReq{
		__UINT16_TYPE__ UserNum;
		__UINT32_TYPE__ pUserIDList[1];
	}stMsg_UploadUserListReq;

	//User Log response
	//SMARTLINK_MSG_APP::MsgType =  0x1803
	typedef struct tag_stMsg_UploadUserListRsp{
		__UINT8_TYPE__ DoneCode;
	} stMsg_UploadUserListRsp;

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

	} stMsg_DownloadUserListReq;

	//SMARTLINK_MSG_APP::MsgType =  0x1804
	typedef struct tag_stMsg_DownloadUserListRsp{
		__UINT8_TYPE__ DoneCode;
		__UINT16_TYPE__ UserNum;
		__UINT32_TYPE__ pUserIDList[1];
	} stMsg_DownloadUserListRsp;


	//0x3001
	typedef struct tag_stMsg_ClientLogoutReq{
98
		char UserName[1];//max 32
丁劲犇's avatar
丁劲犇 已提交
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
	}stMsg_ClientLogoutReq;

	//0x3801
	typedef struct tag_stMsg_ClientLogoutRsp{
		__UINT8_TYPE__ DoneCode;
	}stMsg_ClientLogoutRsp;

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

	} stMsg_GetHostListReq;
	//SMARTLINK_MSG_APP::MsgType =  0x3802
	typedef struct  tag_stMsg_GetHostListRsp{
		__UINT32_TYPE__ HostNum;
		__UINT32_TYPE__ pHostIDList[1];
	}stMsg_GetHostListRsp;

	typedef struct tag_smartlink_app_layer{
		struct tag_app_layer_header{
			__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;
	} SMARTLINK_MSG_APP;
140 141 142 143 144

#endif

#if defined(_MSC_VER)

丁劲犇's avatar
丁劲犇 已提交
145 146 147
	//Host Reg request, send 64 byte Serial Num to Server
	//SMARTLINK_MSG_APP::MsgType =  0x1000
	typedef struct tag_stMsg_HostRegistReq{
148
		char HostSerialNum[1];//max 64
丁劲犇's avatar
丁劲犇 已提交
149 150 151 152 153 154 155 156 157 158 159 160 161 162
	}stMsg_HostRegistReq;


	//Host Reg replay, send back 4 byte ID
	//SMARTLINK_MSG_APP::MsgType =  0x1800
	typedef struct tag_stMsg_HostRegistRsp{
		unsigned __int8 DoneCode;
		unsigned __int32 ID;
	}stMsg_HostRegistRsp;

	//Host Log request
	//SMARTLINK_MSG_APP::MsgType =  0x1001
	typedef struct tag_stMsg_HostLogonReq{
		unsigned __int32 ID;
163
		char HostSerialNum[1];//max 64
丁劲犇's avatar
丁劲犇 已提交
164 165 166 167 168 169 170 171 172 173 174 175
	} stMsg_HostLogonReq;

	//Host Log response
	//SMARTLINK_MSG_APP::MsgType =  0x1801
	typedef struct tag_stMsg_HostLogonRsp{
		unsigned __int8 DoneCode;
	} stMsg_HostLogonRsp;

	//User Login request
	//SMARTLINK_MSG_APP::MsgType =  0x3000
	typedef struct tag_stMsg_ClientLoginReq{
		unsigned __int16 ClientVersion;
176
		char UserNameAndPasswd[1];//max 65
丁劲犇's avatar
丁劲犇 已提交
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
	}stMsg_ClientLoginReq;

	//User Log response
	//SMARTLINK_MSG_APP::MsgType =  0x3800
	typedef struct tag_stMsg_ClientLoginRsp{
		unsigned __int8 DoneCode;
		unsigned __int32 UserID;
	} stMsg_ClientLoginRsp;


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

	} stMsg_HostTimeCorrectReq;

	//Time Correct
	typedef struct tag_stMsg_HostTimeCorrectRsp{
		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;
	}stMsg_HostTimeCorrectRsp;

	//UploadUserListReq,0x1003
	typedef struct tag_stMsg_UploadUserListReq{
		unsigned __int16 UserNum;
		unsigned __int32 pUserIDList[1];
	}stMsg_UploadUserListReq;

	//User Log response
	//SMARTLINK_MSG_APP::MsgType =  0x1803
	typedef struct tag_stMsg_UploadUserListRsp{
		unsigned __int8 DoneCode;
		//char TextInfo[64];
	} stMsg_UploadUserListRsp;


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

	} stMsg_DownloadUserListReq;

	//SMARTLINK_MSG_APP::MsgType =  0x1804
	typedef struct tag_stMsg_DownloadUserListRsp{
		unsigned __int8 DoneCode;
		unsigned __int16 UserNum;
		unsigned __int32 pUserIDList[1];
	} stMsg_DownloadUserListRsp;

	//0x3001
	typedef struct tag_stMsg_ClientLogoutReq{
235
		char UserName[1];//max 32
丁劲犇's avatar
丁劲犇 已提交
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
	}stMsg_ClientLogoutReq;

	//0x3801
	typedef struct tag_stMsg_ClientLogoutRsp{
		unsigned __int8 DoneCode;
	}stMsg_ClientLogoutRsp;

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

	} stMsg_GetHostListReq;
	//SMARTLINK_MSG_APP::MsgType =  0x3802
	typedef struct  tag_stMsg_GetHostListRsp{
		quint32 HostNum;
		quint32 pHostIDList[1];
	}stMsg_GetHostListRsp;

	typedef struct tag_smartlink_app_layer{
		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;

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

282 283 284 285 286 287
#endif



#pragma pack(pop)

丁劲犇's avatar
丁劲犇 已提交
288
}
289
#endif // ST_MSG_APPLAYER_H