diff --git a/.gitignore b/.gitignore index 3a55f22..2bdf47d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ obj/ .idea .vs .vscode -*.generated.sln \ No newline at end of file +*.sln \ No newline at end of file diff --git a/HubConfig.fbs b/HubConfig.fbs index 2cf7130..856b028 100644 --- a/HubConfig.fbs +++ b/HubConfig.fbs @@ -8,6 +8,13 @@ table RFConfig { keepalive_enabled:bool; } +table EStopConfig { + enabled:bool; + + /// The GPIO pin connected to the E-Stop button + gpio_pin:uint8; +} + table WiFiCredentials { /// ID of the WiFi network credentials, used for referencing the credentials with a low memory footprint id:uint8; @@ -118,4 +125,7 @@ table HubConfig { /// OTA update configuration ota_update:OtaUpdateConfig; + + /// E-Stop configuration + estop:EStopConfig; } diff --git a/HubToLocalMessage.fbs b/HubToLocalMessage.fbs index 7cf7516..b6977bb 100644 --- a/HubToLocalMessage.fbs +++ b/HubToLocalMessage.fbs @@ -46,14 +46,24 @@ struct AccountLinkCommandResult { result:AccountLinkResultCode; } -enum SetRfPinResultCode : uint8 { +enum SetGPIOResultCode : uint8 { Success = 0, InvalidPin = 1, InternalError = 2 } struct SetRfTxPinCommandResult { pin:uint8; - result:SetRfPinResultCode; + result:SetGPIOResultCode; +} + +struct SetEstopEnabledCommandResult { + enabled:bool; + success:bool; +} + +struct SetEstopPinCommandResult { + gpio_pin:uint8; + result:SetGPIOResultCode; } union HubToLocalMessagePayload { @@ -72,7 +82,11 @@ union HubToLocalMessagePayload { AccountLinkCommandResult, // RF transmitter stuff - SetRfTxPinCommandResult + SetRfTxPinCommandResult, + + // E-stop stuff + SetEstopEnabledCommandResult, + SetEstopPinCommandResult } table HubToLocalMessage (fs_serializer) { diff --git a/LocalToHubMessage.fbs b/LocalToHubMessage.fbs index 8361de5..f63ad33 100644 --- a/LocalToHubMessage.fbs +++ b/LocalToHubMessage.fbs @@ -58,6 +58,12 @@ struct AccountUnlinkCommand { struct SetRfTxPinCommand { pin:uint8; } +struct SetEstopEnabledCommand { + enabled:bool; +} +struct SetEstopPinCommand { + pin:uint8; +} union LocalToHubMessagePayload { @@ -84,7 +90,11 @@ union LocalToHubMessagePayload { AccountUnlinkCommand, // RF Transmitter stuff - SetRfTxPinCommand + SetRfTxPinCommand, + + // E-Stop stuff + SetEstopEnabledCommand, + SetEstopPinCommand } table LocalToHubMessage (fs_serializer) {