-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGatewayToHubMessage.fbs
65 lines (48 loc) · 1.22 KB
/
GatewayToHubMessage.fbs
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
include "./Types/ShockerCommandType.fbs";
include "./Types/ShockerModelType.fbs";
include "./Types/SemVer.fbs";
attribute "fs_serializer";
namespace OpenShock.Serialization.Gateway;
table Ping {
unix_utc_time:ulong;
}
enum TriggerType : uint8 {
/// Restart the hub
Restart,
/// Trigger the emergency stop on the hub, this does however not allow for resetting it
EmergencyStop,
/// Enable the captive portal
CaptivePortalEnable,
/// Disable the captive portal
CaptivePortalDisable,
}
table Trigger {
type:TriggerType;
}
table ShockerCommand {
model:Types.ShockerModelType;
id:uint16;
type:Types.ShockerCommandType;
intensity:uint8;
duration:uint16;
}
table ShockerCommandList {
commands:[ShockerCommand] (required);
}
table OtaUpdateRequest {
version:Types.SemVer (required);
}
union GatewayToHubMessagePayload {
/// Ping message, should immediately be responded to with a pong
Ping,
/// Trigger a specific action on the hub
Trigger,
/// Send a list of shocker commands to the hub
ShockerCommandList,
/// Request an OTA update to be performed
OtaUpdateRequest
}
table GatewayToHubMessage (fs_serializer) {
payload:GatewayToHubMessagePayload (required);
}
root_type GatewayToHubMessage;