Repository navigation
Expand file tree
/
Copy pathHubToLocalMessage.fbs
More file actions
87 lines (69 loc) · 1.58 KB
/
Copy pathHubToLocalMessage.fbs
File metadata and controls
87 lines (69 loc) · 1.58 KB
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
include "./Types/WifiScanStatus.fbs";
include "./Types/WifiNetwork.fbs";
include "./Types/WifiNetworkEventType.fbs";
attribute "fs_serializer";
namespace OpenShock.Serialization.Local;
enum OtaChannel : uint8 {
Stable = 0,
Beta = 1,
Develop = 2
}
/// The OTA settings the portal shows and edits.
table OtaSettings {
enabled:bool;
cdn_domain:string;
channel:OtaChannel;
check_interval:uint16;
allow_backend_management:bool;
require_manual_approval:bool;
}
table ReadyMessage {
poggies:bool;
connected_wifi:Types.WifiNetwork;
account_linked:bool;
gpio_valid_inputs:[int8];
gpio_valid_outputs:[int8];
has_standardized_pins:bool;
rf_tx_pin:int8 = -1;
estop_enabled:bool;
estop_gpio_pin:int8 = -1;
/// SSIDs of the saved networks. Passwords never leave the hub.
saved_ssids:[string];
ota:OtaSettings;
}
table ErrorMessage {
message:string;
}
table WifiScanStatusMessage {
status:Types.WifiScanStatus;
}
table WifiNetworkEvent {
event_type:Types.WifiNetworkEventType;
networks:[Types.WifiNetwork];
}
table WifiGotIpEvent {
ip:string;
}
table WifiLostIpEvent {
ip:string;
}
/// Sent when the auth token status changes (set, cleared, or validated on gateway connect)
table AccountLinkStatusEvent {
linked:bool;
}
union HubToLocalMessagePayload {
// General stuff
ReadyMessage,
ErrorMessage,
// Wifi stuff
WifiScanStatusMessage,
WifiNetworkEvent,
WifiGotIpEvent,
WifiLostIpEvent,
// Account stuff
AccountLinkStatusEvent,
}
table HubToLocalMessage (fs_serializer) {
payload:HubToLocalMessagePayload;
}
root_type HubToLocalMessage;