Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Version 1.5.1 Release Notes

Hotfix release addressing a safety-critical E-Stop bypass.

### Bug Fixes

- **E-Stop** - Fixed shocker commands being transmitted while E-Stop was active. Commands are now rejected at the entry point (`CommandHandler::HandleCommand`) and discarded in the RF transmit task's receive loop when E-Stop is engaged.

**Full Changelog: [1.5.0 -> 1.5.1](https://github.com/OpenShock/Firmware/compare/1.5.0...1.5.1)**




# Version 1.5.0 Release Notes

This release is a major firmware update bringing a fully reworked RF transmitter pipeline for more reliable shocker communication, a new T330 shocker protocol, an RFC 8908-compliant captive portal, a rebuilt frontend (Svelte 5 + shadcn), and significant improvements to E-Stop handling and rate limiting.
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "1.5.0",
"version": "1.5.1",
"private": true,
"type": "module",
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions src/CommandHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ gpio_num_t CommandHandler::GetRfTxPin()

bool CommandHandler::HandleCommand(ShockerModelType model, uint16_t shockerId, ShockerCommandType type, uint8_t intensity, uint16_t durationMs)
{
if (EStopManager::IsEStopped()) {
OS_LOGD(TAG, "Ignoring shocker command due to EmergencyStop being activated");
return false;
}

ScopedReadLock lock__rf(&s_rfTransmitterMutex);

if (s_rfTransmitter == nullptr) {
Expand Down
12 changes: 12 additions & 0 deletions src/radio/RFTransmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,17 @@ void RFTransmitter::TransmitTask()
return;
}

// Discard any command received while estopped
if (OpenShock::EStopManager::IsEStopped()) {
// Immediately break out to stop sequences; we can empty the queue later
if (!wasEstopped) {
break;
}

// Discard next item in queue
continue;
}

if ((cmd.flags & kFlagOverwrite) != 0) {
// Replace the sequence if it already exists
if (modifySequence(sequences, cmd.modelType, cmd.shockerId, cmd.type, cmd.intensity, cmd.transmitEnd)) {
Expand All @@ -231,6 +242,7 @@ void RFTransmitter::TransmitTask()
}
}

// Terminate all remaining sequences
bool isEstopped = OpenShock::EStopManager::IsEStopped();
if (isEstopped != wasEstopped) {
wasEstopped = isEstopped;
Expand Down
Loading