-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommon.h
137 lines (87 loc) · 2.93 KB
/
Common.h
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
89
90
91
92
93
94
95
96
97
98
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
/*
2020 © Copyright (c) BiDaE Technology Inc.
Provided under BiDaE SHAREWARE LICENSE-1.0 in the LICENSE.
Project Name:
BeDIS
File Name:
Common.h
File Description:
This file contains the definitions and declarations of constants,
structures, and functions used in server, gateway and Lbeacon.
Version:
2.0, 20191227
Abstract:
BeDIS uses LBeacons to deliver 3D coordinates and textual descriptions of
their locations to users' devices. Basically, a LBeacon is an inexpensive,
Bluetooth Smart Ready device. The 3D coordinates and location description
of every LBeacon are retrieved from BeDIS (Building/environment Data and
Information System) and stored locally during deployment and maintenance
times. Once initialized, each LBeacon broadcasts its coordinates and
location description to Bluetooth enabled user devices within its coverage
area.
Authors:
Chun Yu Lai , [email protected]
*/
#ifndef COMMON_H
#define COMMON_H
/* Server API protocol version for communications between server and
gateway.*/
/* BOT_SERVER_API_VERSION_20 is compatible with BOT_GATEWAY_API_VERSION_10 */
/* BOT_SERVER_API_VERSION_LATEST=2.1 is compatible with both
BOT_GATEWAY_API_VERSION_10 and BOT_GATEWAY_API_VERSION_LATEST=1.1 */
#define BOT_SERVER_API_VERSION_20 "2.0"
#define BOT_SERVER_API_VERSION_21 "2.1"
#define BOT_SERVER_API_VERSION_22 "2.2"
#define BOT_SERVER_API_VERSION_23 "2.3"
#define BOT_SERVER_API_VERSION_LATEST "2.4"
/* The size of message to be sent over WiFi in bytes */
#define WIFI_MESSAGE_LENGTH 8192
/* Length of the IP address in byte */
#define NETWORK_ADDR_LENGTH 16
typedef enum pkt_types {
/* Unknown type of pkt type */
undefined = 0,
/* Request join from LBeacon */
request_to_join = 1,
/* Join response */
join_response = 2,
/* A pkt containing time critical tracked object data */
time_critical_tracked_object_data = 3,
/* A pkt containing tracked object data */
tracked_object_data = 4,
/* A pkt containing health report */
gateway_health_report = 5,
/* A pkt containing health report */
beacon_health_report = 6,
/* A pkt containing notification alarm */
notification_alarm = 7,
/* A pkt containing IPC command */
ipc_command = 8,
} PktType;
typedef enum pkt_direction {
/* pkt from server */
from_server = 2,
/* pkt from GUI */
from_gui = 3,
/* pkt from gateway */
from_gateway = 6,
/* pkt from beacon */
from_beacon = 8,
/* pkt from agent */
from_agent = 9,
} PktDirection;
typedef enum IPCCommand {
CMD_NONE = 0,
CMD_RELOAD_GEO_FENCE_SETTING = 1,
CMD_STOP_LIGHT_ALARM = 2,
CMD_RELOAD_LBEACON_SETTING = 3,
CMD_MAX,
} IPCCommand;
/* Type of coverage of areas. */
typedef enum AreaScope {
AREA_NONE = 0,
AREA_ALL = 1,
AREA_ONE = 2,
AREA_MAX,
} AreaScope;
#endif