diff --git a/CommandDistributor.cpp b/CommandDistributor.cpp index f838fd2..67bcc54 100644 --- a/CommandDistributor.cpp +++ b/CommandDistributor.cpp @@ -312,6 +312,11 @@ void CommandDistributor::broadcastRaw(clientType type, char * msg) { broadcastReply(type, F("%s"),msg); } +void CommandDistributor::broadcastMessage(char * message) { + broadcastReply(COMMAND_TYPE, F("\n"),message); + broadcastReply(WITHROTTLE_TYPE, F("Hm%s\n"),message); +} + void CommandDistributor::broadcastTrackState(const FSH* format, byte trackLetter, const FSH *modename, int16_t dcAddr) { broadcastReply(COMMAND_TYPE, format, trackLetter, modename, dcAddr); } diff --git a/CommandDistributor.h b/CommandDistributor.h index e4dff5d..f68a5e2 100644 --- a/CommandDistributor.h +++ b/CommandDistributor.h @@ -60,6 +60,7 @@ public : static void forget(byte clientId); static void broadcastRouteState(uint16_t routeId,byte state); static void broadcastRouteCaption(uint16_t routeId,const FSH * caption); + static void broadcastMessage(char * message); // Handling code for virtual LCD receiver. static Print * getVirtualLCDSerial(byte screen, byte row); diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index 9f1075c..c9c6716 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -1334,6 +1334,7 @@ void RMFT2::thrungeString(uint32_t strfar, thrunger mode, byte id) { break; case thrunge_parse: case thrunge_broadcast: + case thrunge_message: case thrunge_lcd: default: // thrunge_lcd+1, ... if (!buffer) buffer=new StringBuffer(); @@ -1371,6 +1372,9 @@ void RMFT2::thrungeString(uint32_t strfar, thrunger mode, byte id) { case thrunge_withrottle: CommandDistributor::broadcastRaw(CommandDistributor::WITHROTTLE_TYPE,buffer->getString()); break; + case thrunge_message: + CommandDistributor::broadcastMessage(buffer->getString()); + break; case thrunge_lcd: LCD(id,F("%s"),buffer->getString()); break; diff --git a/EXRAIL2.h b/EXRAIL2.h index b4a06da..f4cf320 100644 --- a/EXRAIL2.h +++ b/EXRAIL2.h @@ -94,7 +94,7 @@ enum thrunger: byte { thrunge_serial,thrunge_parse, thrunge_serial1, thrunge_serial2, thrunge_serial3, thrunge_serial4, thrunge_serial5, thrunge_serial6, - thrunge_lcn, + thrunge_lcn,thrunge_message, thrunge_lcd, // Must be last!! }; diff --git a/EXRAIL2MacroReset.h b/EXRAIL2MacroReset.h index 2428a09..e94c657 100644 --- a/EXRAIL2MacroReset.h +++ b/EXRAIL2MacroReset.h @@ -97,6 +97,7 @@ #undef LCCX #undef LCN #undef MOVETT +#undef MESSAGE #undef ONACTIVATE #undef ONACTIVATEL #undef ONAMBER @@ -253,6 +254,7 @@ #define LCD(row,msg) #define SCREEN(display,row,msg) #define LCN(msg) +#define MESSAGE(msg) #define MOVETT(id,steps,activity) #define ONACTIVATE(addr,subaddr) #define ONACTIVATEL(linear) diff --git a/EXRAILMacros.h b/EXRAILMacros.h index ca12e23..5588811 100644 --- a/EXRAILMacros.h +++ b/EXRAILMacros.h @@ -253,6 +253,9 @@ const int StringMacroTracker1=__COUNTER__; #define PRINT(msg) THRUNGE(msg,thrunge_print) #undef LCN #define LCN(msg) THRUNGE(msg,thrunge_lcn) +#undef MESSAGE +#define MESSAGE(msg) THRUNGE(msg,thrunge_message) + #undef ROUTE_CAPTION #define ROUTE_CAPTION(id,caption) \ case (__COUNTER__ - StringMacroTracker1) : {\ @@ -516,6 +519,7 @@ int RMFT2::onLCCLookup[RMFT2::countLCCLookup]; #define SCREEN(display,id,msg) PRINT(msg) #define STEALTH(code...) PRINT(dummy) #define LCN(msg) PRINT(msg) +#define MESSAGE(msg) PRINT(msg) #define MOVETT(id,steps,activity) OPCODE_SERVO,V(id),OPCODE_PAD,V(steps),OPCODE_PAD,V(EXTurntable::activity),OPCODE_PAD,V(0), #define ONACTIVATE(addr,subaddr) OPCODE_ONACTIVATE,V(addr<<2|subaddr), #define ONACTIVATEL(linear) OPCODE_ONACTIVATE,V(linear+3), diff --git a/version.h b/version.h index ee8c827..97b0a70 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,9 @@ #include "StringFormatter.h" -#define VERSION "5.2.37" +#define VERSION "5.2.38" +// 5.2.38 - Exrail MESSAGE("text") to send a user message to all +// connected throttles (uses and withrottle Hmtext. // 5.2.37 - Bugfix ESP32: Use BOOSTER_INPUT define // 5.2.36 - Variable frequency for DC mode // 5.2.35 - Bugfix: Make DCC Extended Accessories follow RCN-213