diff --git a/library.properties b/library.properties index 36f9eee..4a118c0 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=DCCEXProtocol -version=0.0.15 +version=0.0.16 author=Peter Cole, Peter Akers maintainer=Peter Cole, Peter Akers sentence=DCC-EX Native Protocol implementation diff --git a/src/DCCEXProtocol.cpp b/src/DCCEXProtocol.cpp index ff63025..48cec3b 100644 --- a/src/DCCEXProtocol.cpp +++ b/src/DCCEXProtocol.cpp @@ -117,6 +117,11 @@ void DCCEXProtocol::check() { } } +void DCCEXProtocol::sendCommand(char *cmd) { + sprintf(_outboundCommand, "<%s>", cmd); + _sendCommand(); +} + // sequentially request and get the required lists. To avoid overloading the buffer void DCCEXProtocol::getLists(bool rosterRequired, bool turnoutListRequired, bool routeListRequired, bool turntableListRequired) { diff --git a/src/DCCEXProtocol.h b/src/DCCEXProtocol.h index 3187783..a364c3a 100644 --- a/src/DCCEXProtocol.h +++ b/src/DCCEXProtocol.h @@ -34,6 +34,7 @@ /* Version information: +0.0.16 - add public sendCommand method 0.0.15 - any acquired loco is now retained in the roster 0.0.14 - add getNumberSupportedLocos() used for the fake heartbeat 0.0.13 - Fix bug to allow compilation on AVR platforms, change ssize_t to int @@ -220,6 +221,10 @@ class DCCEXProtocol { /// @brief Check for incoming DCC-EX broadcasts/responses and parse them void check(); + /// @brief allows sending of an arbitray command + /// @param cmd Command to send + void sendCommand(char *cmd); + /// @brief Request DCC-EX object lists (Roster, Turnouts, Routes, Turntables) /// @param rosterRequired Request the roster list (true|false) /// @param turnoutListRequired Request the turnout list (true|false)