Skip to content

Commit

Permalink
Fix for the original 'steal' code
Browse files Browse the repository at this point in the history
  • Loading branch information
flash62au committed Aug 10, 2024
1 parent 1733bcc commit 4744639
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,19 @@ see https://flash62au.github.io/WiThrottleProtocol/library.html
## Todos

- Update the examples
- Add multithrottle examples
- Finish the in-code documentation
- Write Tests
- More complete WiThrottle protocol parsing
- Better Parser (Antlr?)

## Usage Notes

- When I added the multithrottle support I have done my best to maintain backwards compatibility. As a result if you use the non-multithrottle versions of any of the methods, the *default* multithrottle is now defunct 'T' rather than the now standard '0'.<br/>That means that you ***cannot mix*** multithrottle and non-multithrottle versions of the methods in your code.

License
----
----

# License

Creative Commons [CC-BY-SA 4.0][CCBYSA] ![CCBYSA](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)

Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=WiThrottleProtocol
version=1.1.21
version=1.1.22
author=Peter Akers <akersp62@gmail.com>, David Zuhn <zoo@statebeltrailway.org>, Luca Dentella <luca@dentella.it>
maintainer=Peter Akers <akersp62@gmail.com>
sentence=JMRI WiThrottle Protocol implementation for ESP32
Expand Down
9 changes: 4 additions & 5 deletions src/WiThrottleProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1168,11 +1168,10 @@ bool WiThrottleProtocol::stealLocomotive(String address) {
bool WiThrottleProtocol::stealLocomotive(char multiThrottle, String address) {
if (logLevel>0) { console->print("WiT:: stealLocomotive(): "); console->print(multiThrottle); console->print(" : "); console->println(address); }

bool ok = false;

if (releaseLocomotive(multiThrottle, address)) {
ok = addLocomotive(multiThrottle, address);
}
bool ok = true;
// MTSxxxx<;>xxxxx
String cmd = "M" + String(multiThrottle) + "S" +address + PROPERTY_SEPARATOR + address;
sendDelayedCommand(cmd);

return ok;
}
Expand Down
1 change: 1 addition & 0 deletions src/WiThrottleProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/*
Version information:
1.1.22 - Fix for the original 'steal' code
1.1.21 - Add support for setting the Speed Step mode 28/128/14 etc. setSpeedSteps(), getSpeedSteps()
1.1.20 - Corrected the EStop for 'all' throttles
1.1.18/19- Added support for logLevel. Assigned levels to every log message
Expand Down

0 comments on commit 4744639

Please sign in to comment.