1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
| #pragma once
| enum TypeInfo
| {
| AD_REQ,//Ìí¼ÓÉ豸ÇëÇó
| AD_RES,//Ìí¼ÓÉ豸ÏìÓ¦
| MD_REQ,//ÐÞ¸ÄÉ豸ÇëÇó
| MD_RES,//ÐÞ¸ÄÉ豸ÏìÓ¦
| QD_REQ,//²éѯÉ豸ÇëÇó
| QD_RES,//²éѯÉ豸ÏìÓ¦
| };
| struct Head
| {
| int type;
| int len;
| };
| struct DevicesInfo
| {
| int deviceID;
| char deviceName[32];//É豸Ãû³Æ
| char deviceStatus[32];//É豸״̬
| char manufacturer[100];//³§¼Ò
| char devicesType[32];//É豸ÀàÐÍ
| double longitude;//¾¶È
| double latitude;//γ¶È
| char purchasingTime[15];//¹ºÂòʱ¼ä
| char installTime[15];//°²×°Ê±¼ä
| char devicesSerialNumber[32];//É豸±àÂë
| };
| //Ìí¼ÓÉ豸
| struct ADReq//Ìí¼ÓÇëÇó
| {
| Head head;
| char deviceName[32];
| ADReq() {
| head.type = AD_REQ;
| head.len = sizeof(ADReq);
| }
|
| };
|
| struct ADRes//Ìí¼ÓÏìÓ¦
| {
| Head head;
| int type;
| ADRes() {
| head.type = AD_RES;
| head.len = sizeof(ADRes);
| }
|
| };
| //ÐÞ¸ÄÉ豸
| struct MDRes//ÐÞ¸ÄÇëÇó
| {
| Head head;
| DevicesInfo info;
| MDRes() {
| head.type = MD_RES;
| head.len = sizeof(MDRes);
| }
| };
| struct MDReq//ÐÞ¸ÄÏìÓ¦
| {
| Head head;
| int type;
| MDReq() {
| head.type = MD_REQ;
| head.len = sizeof(MDReq);
| }
| };
| //²éѯÉ豸
| struct QDReq//²éѯÇëÇó
| {
| Head head;
| DevicesInfo info;
| QDReq() {
| head.type = QD_REQ;
| head.len = sizeof(QDReq);
| }
| };
| struct QDRes//²éѯÏìÓ¦
| {
| Head head;
| int type;
| QDRes() {
| head.type = QD_RES;
| head.len = sizeof(QDRes);
| }
| };
|
|