-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathHubConfig.fbs
139 lines (102 loc) · 3.19 KB
/
HubConfig.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
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
138
139
namespace OpenShock.Serialization.Configuration;
table RFConfig {
/// The GPIO pin connected to the RF modulator's data pin for transmitting (TX)
tx_pin:int8;
/// Whether to transmit keepalive messages to keep the shockers from entering sleep mode
keepalive_enabled:bool;
}
table EStopConfig {
enabled:bool;
/// The GPIO pin connected to the E-Stop button
gpio_pin:int8;
/// Persistent state of the E-Stop button
active:bool;
/// Set When EmergencyStop is a latching switch
latching:bool;
}
table WiFiCredentials {
/// ID of the WiFi network credentials, used for referencing the credentials with a low memory footprint
id:uint8;
/// SSID of the WiFi network
ssid:string;
/// Password of the WiFi network
password:string;
}
table WiFiConfig {
/// Access point SSID
ap_ssid:string;
/// Hub hostname
hostname:string;
/// WiFi network credentials
credentials:[WiFiCredentials];
}
table CaptivePortalConfig {
/// Whether the captive portal is forced to be enabled
/// The captive portal will otherwise shut down when a gateway connection is established
always_enabled:bool;
}
table BackendConfig {
/// Domain name of the backend server, e.g. "api.shocklink.net"
domain:string;
/// Authentication token for the backend server
auth_token:string;
/// Override the Live-Control-Gateway (LCG) URL
lcg_override:string;
}
table SerialInputConfig {
/// Whether to echo typed characters back to the serial console
echo_enabled:bool = true;
}
enum OtaUpdateChannel:uint8 {
Stable = 0,
Beta = 1,
Develop = 2
}
enum OtaUpdateStep:uint8 {
None = 0,
Updating = 1,
Updated = 2,
Validating = 3,
Validated = 4,
RollingBack = 5,
}
// Represents configuration for Over-The-Air (OTA) updates.
table OtaUpdateConfig {
/// Indicates whether OTA updates are enabled.
is_enabled:bool;
/// The domain name of the OTA Content Delivery Network (CDN).
cdn_domain:string;
/// The update channel to use.
update_channel:OtaUpdateChannel;
/// Indicates whether to check for updates on startup.
check_on_startup:bool;
/// Indicates whether to check for updates periodically.
check_periodically:bool;
/// The interval in minutes between periodic update checks.
check_interval:uint16;
/// Indicates if the backend is authorized to manage the hub's update version on behalf of the user.
allow_backend_management:bool;
/// Indicates if manual approval via serial input or captive portal is required before installing updates.
require_manual_approval:bool;
/// Update process ID, used to track the update process server-side across reboots.
update_id:int32;
/// Indicates what step of the update process the hub is currently in, used to detect failed updates for status reporting.
update_step:OtaUpdateStep;
}
table HubConfig {
/// RF Transmitter configuration
rf:RFConfig;
/// WiFi configuration
wifi:WiFiConfig;
/// Captive portal configuration
captive_portal:CaptivePortalConfig;
/// Backend configuration
backend:BackendConfig;
/// Serial input configuration
serial_input:SerialInputConfig;
/// OTA update configuration
ota_update:OtaUpdateConfig;
/// E-Stop configuration
estop:EStopConfig;
}
root_type HubConfig;