1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-28 09:53:45 +02:00

Speed broadcast

This commit is contained in:
Asbelos
2021-12-05 18:06:28 +00:00
parent a4fc10d466
commit b8293d07f2
4 changed files with 18 additions and 6 deletions

View File

@@ -24,6 +24,7 @@
#include "DIAG.h"
#include "defines.h"
#include "DCCWaveform.h"
#include "DCC.h"
const byte NO_CLIENT=255;
@@ -93,8 +94,10 @@ void CommandDistributor::broadcastTurnout(int16_t id, bool isClosed ) {
broadcast();
}
void CommandDistributor::broadcastLoco(int16_t cab, int16_t slot, byte speed, uint32_t functions) {
StringFormatter::send(broadcastBufferWriter,F("<l %d %d %d %x>\n"), cab,slot,speed,functions);
void CommandDistributor::broadcastLoco(byte slot) {
DCC::LOCO * sp=&DCC::speedTable[slot];
StringFormatter::send(broadcastBufferWriter,F("<l %d %d %d %l>\n"),
sp->loco,slot,sp->speedCode,sp->functions);
broadcast();
}