DCC-EX Simple Throttle
Simple throttle for a DCC-EX CommandStation
Loading...
Searching...
No Matches
/home/runner/work/DCCEXSimpleThrottle/DCCEXSimpleThrottle/CommandStationListener.h
Go to the documentation of this file.
1/*
2 * © 2024 Peter Cole
3 * © 2023 Peter Cole
4 *
5 * This is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * It is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this code. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19#ifndef COMMANDSTATIONLISTENER_H
20#define COMMANDSTATIONLISTENER_H
21
22#include "Defines.h"
23#include "EventManager.h"
24#include <DCCEXProtocol.h>
25
27class CommandStationListener : public DCCEXProtocolDelegate {
28public:
32
34 void receivedRosterList() override;
35
38 void receivedLocoUpdate(Loco *loco) override;
39
45 void receivedLocoBroadcast(int address, int speed, Direction direction, int functionMap) override;
46
49 void receivedTrackPower(TrackPower powerState) override;
50
54 void receivedReadLoco(int address) override;
55
56private:
58};
59
60#endif // COMMANDSTATIONLISTENER_H
Class to manage broadcasts and responses from the CommandStation.
Definition CommandStationListener.h:27
void receivedReadLoco(int address) override
Respond to receiving the loco address read from the programming track If valid (not -1),...
Definition CommandStationListener.cpp:43
void receivedTrackPower(TrackPower powerState) override
Respond to receiving a track power state broadcast to update the throttle screen.
Definition CommandStationListener.cpp:38
void receivedLocoUpdate(Loco *loco) override
Respond to receiving an update for a loco to update the throttle screen.
Definition CommandStationListener.cpp:28
void receivedRosterList() override
Respond to receiving the roster list which updates the roster menu.
Definition CommandStationListener.cpp:23
void receivedLocoBroadcast(int address, int speed, Direction direction, int functionMap) override
Respond to receiving a loco broadcast to update throttle screen for non-roster locos.
Definition CommandStationListener.cpp:33
EventManager * _eventManager
Definition CommandStationListener.h:57
Class to centrally manage all events for the application Exposes methods to register subscribers that...
Definition EventManager.h:28