-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathHubConfig.fbs
More file actions
175 lines (127 loc) · 4.19 KB
/
HubConfig.fbs
File metadata and controls
175 lines (127 loc) · 4.19 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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
include "Types/WifiAuthMode.fbs";
namespace OpenShock.Serialization.Configuration;
table RFConfig {
/// The GPIO pin connected to the RF modulator's data pin for transmitting (TX)
tx_pin:int8 = -1;
/// Whether to transmit keepalive messages to keep the shockers from entering sleep mode
keepalive_enabled:bool = true;
}
table EStopConfig {
enabled:bool;
/// The GPIO pin connected to the E-Stop button
gpio_pin:int8 = -1;
/// Persistent state of the E-Stop button
active:bool = false;
/// Set When EmergencyStop is a latching switch
latching:bool = false;
}
/// 6-byte MAC address (BSSID)
struct MacAddress {
bytes:[uint8:6];
}
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;
/// Auth mode of the network when credentials were saved. Used to reject evil twins with weaker security.
auth_mode:OpenShock.Serialization.Types.WifiAuthMode = UNKNOWN;
/// Pinned BSSID of the last successfully connected AP. All zeros means no pin.
bssid:MacAddress;
}
table WiFiConfig {
/// Access point SSID
ap_ssid:string;
/// Hub hostname
hostname:string;
/// WiFi network credentials
credentials:[WiFiCredentials];
/// Access point password (empty = open network)
ap_password:string;
/// Disable WiFi Access Point mode completely
ap_disabled:bool = false;
/// Disable WiFi Station mode completely
sta_disabled:bool = false;
/// Don't connect to any cloud services
offline_mode:bool = false;
}
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 = false;
}
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 (deprecated);
}
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 = true;
/// 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 = false;
/// Indicates whether to check for updates periodically.
check_periodically:bool = false;
/// 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 = true;
/// Indicates if manual approval via serial input or captive portal is required before installing updates.
require_manual_approval:bool = false;
/// 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 LanConfig {
/// Whether an API key is required for LAN endpoints
api_key_enabled:bool = false;
/// API key for authenticating LAN requests (generated or user-set)
api_key:string;
}
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;
/// LAN API configuration
lan:LanConfig;
}
root_type HubConfig;