1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-12 16:38:54 +02:00

Negative route Ids

This commit is contained in:
Asbelos 2025-07-09 14:11:43 +01:00 committed by Harald Barth
parent 7b1e396d96
commit eabc3eaef0
4 changed files with 8 additions and 8 deletions

View File

@ -323,11 +323,11 @@ void CommandDistributor::broadcastTrackState(const FSH* format, byte trackLetter
broadcastReply(COMMAND_TYPE, format, trackLetter, modename, dcAddr); broadcastReply(COMMAND_TYPE, format, trackLetter, modename, dcAddr);
} }
void CommandDistributor::broadcastRouteState(uint16_t routeId, byte state ) { void CommandDistributor::broadcastRouteState(int16_t routeId, byte state ) {
broadcastReply(COMMAND_TYPE, F("<jB %d %d>\n"),routeId,state); broadcastReply(COMMAND_TYPE, F("<jB %d %d>\n"),routeId,state);
} }
void CommandDistributor::broadcastRouteCaption(uint16_t routeId, const FSH* caption ) { void CommandDistributor::broadcastRouteCaption(int16_t routeId, const FSH* caption ) {
broadcastReply(COMMAND_TYPE, F("<jB %d \"%S\">\n"),routeId,caption); broadcastReply(COMMAND_TYPE, F("<jB %d \"%S\">\n"),routeId,caption);
} }

View File

@ -59,8 +59,8 @@ public :
static void broadcastTrackState(const FSH* format,byte trackLetter, const FSH* modename, int16_t dcAddr); static void broadcastTrackState(const FSH* format,byte trackLetter, const FSH* modename, int16_t dcAddr);
template<typename... Targs> static void broadcastReply(clientType type, Targs... msg); template<typename... Targs> static void broadcastReply(clientType type, Targs... msg);
static void forget(byte clientId); static void forget(byte clientId);
static void broadcastRouteState(uint16_t routeId,byte state); static void broadcastRouteState(int16_t routeId,byte state);
static void broadcastRouteCaption(uint16_t routeId,const FSH * caption); static void broadcastRouteCaption(int16_t routeId,const FSH * caption);
static void broadcastMessage(char * message); static void broadcastMessage(char * message);
// Handling code for virtual LCD receiver. // Handling code for virtual LCD receiver.

View File

@ -1513,7 +1513,7 @@ void RMFT2::thrungeString(uint32_t strfar, thrunger mode, byte id) {
} }
} }
void RMFT2::manageRouteState(uint16_t id, byte state) { void RMFT2::manageRouteState(int16_t id, byte state) {
if (compileFeatures && FEATURE_ROUTESTATE) { if (compileFeatures && FEATURE_ROUTESTATE) {
// Route state must be maintained for when new throttles connect. // Route state must be maintained for when new throttles connect.
// locate route id in the Routes lookup // locate route id in the Routes lookup
@ -1525,7 +1525,7 @@ void RMFT2::manageRouteState(uint16_t id, byte state) {
CommandDistributor::broadcastRouteState(id,state); CommandDistributor::broadcastRouteState(id,state);
} }
} }
void RMFT2::manageRouteCaption(uint16_t id,const FSH* caption) { void RMFT2::manageRouteCaption(int16_t id,const FSH* caption) {
if (compileFeatures && FEATURE_ROUTESTATE) { if (compileFeatures && FEATURE_ROUTESTATE) {
// Route state must be maintained for when new throttles connect. // Route state must be maintained for when new throttles connect.
// locate route id in the Routes lookup // locate route id in the Routes lookup

View File

@ -266,8 +266,8 @@ private:
static const int countLCCLookup; static const int countLCCLookup;
static int onLCCLookup[]; static int onLCCLookup[];
static const byte compileFeatures; static const byte compileFeatures;
static void manageRouteState(uint16_t id, byte state); static void manageRouteState(int16_t id, byte state);
static void manageRouteCaption(uint16_t id, const FSH* caption); static void manageRouteCaption(int16_t id, const FSH* caption);
static byte * routeStateArray; static byte * routeStateArray;
static const FSH ** routeCaptionArray; static const FSH ** routeCaptionArray;
static int16_t * stashArray; static int16_t * stashArray;