DCC-EX Simple Throttle
Simple throttle for a DCC-EX CommandStation
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
CommandStationClient Class Reference

#include <CommandStationClient.h>

Collaboration diagram for CommandStationClient:
Collaboration graph
[legend]

Public Member Functions

 CommandStationClient (Stream *logStream, CommandStationListener *commandStationLister)
 Constructor for the CommandStation client.
 
void begin ()
 Setup the CommandStation client with log stream and listener ready to connect.
 
void setConnectionStream (Stream *connectionStream)
 Set the stream object used to connect to the CommandStation, call after begin() Once set, the client is flagged as connected which will initiate communication with the CommandStation.
 
void update ()
 Ensure client is updated regularly.
 
bool isConnected ()
 Check if the CommandStation client is connected.
 
DCCEXProtocol * getClient ()
 Get the actual DCCEXProtocol client to interact with.
 
void joinProgTrack ()
 Join Prog to Main.
 
void setTrackPower (Event event)
 Set track power according to the provided EventType.
 

Private Attributes

Stream * _logStream
 
CommandStationListener_commandStationListener
 
Stream * _connectionStream
 
DCCEXProtocol * _commandStationClient
 
bool _isConnected
 
uint8_t _rosterMaxRetries
 
uint8_t _rosterRetry
 
unsigned long _lastRosterRetry
 
unsigned long _rosterRetryDelay
 

Constructor & Destructor Documentation

◆ CommandStationClient()

CommandStationClient::CommandStationClient ( Stream *  logStream,
CommandStationListener commandStationLister 
)

Constructor for the CommandStation client.

Parameters
consoleStreamPointer to the stream for logging
commandStationListerPointer to the listener to respond to broadcasts/responses

Member Function Documentation

◆ begin()

void CommandStationClient::begin ( )

Setup the CommandStation client with log stream and listener ready to connect.

Here is the caller graph for this function:

◆ getClient()

DCCEXProtocol * CommandStationClient::getClient ( )

Get the actual DCCEXProtocol client to interact with.

Returns
Pointer to the DCCEXProtocol client
Here is the caller graph for this function:

◆ isConnected()

bool CommandStationClient::isConnected ( )

Check if the CommandStation client is connected.

Returns
True|False
Here is the caller graph for this function:

◆ joinProgTrack()

void CommandStationClient::joinProgTrack ( )

Join Prog to Main.

Here is the caller graph for this function:

◆ setConnectionStream()

void CommandStationClient::setConnectionStream ( Stream *  connectionStream)

Set the stream object used to connect to the CommandStation, call after begin() Once set, the client is flagged as connected which will initiate communication with the CommandStation.

Parameters
connectionStreamPointer to the stream object (WiFi client or serial)
Here is the caller graph for this function:

◆ setTrackPower()

void CommandStationClient::setTrackPower ( Event  event)

Set track power according to the provided EventType.

Parameters
eventTypeValid Event type and data
Here is the caller graph for this function:

◆ update()

void CommandStationClient::update ( )

Ensure client is updated regularly.

Here is the caller graph for this function:

Member Data Documentation

◆ _commandStationClient

DCCEXProtocol* CommandStationClient::_commandStationClient
private

◆ _commandStationListener

CommandStationListener* CommandStationClient::_commandStationListener
private

◆ _connectionStream

Stream* CommandStationClient::_connectionStream
private

◆ _isConnected

bool CommandStationClient::_isConnected
private

◆ _lastRosterRetry

unsigned long CommandStationClient::_lastRosterRetry
private

◆ _logStream

Stream* CommandStationClient::_logStream
private

◆ _rosterMaxRetries

uint8_t CommandStationClient::_rosterMaxRetries
private

◆ _rosterRetry

uint8_t CommandStationClient::_rosterRetry
private

◆ _rosterRetryDelay

unsigned long CommandStationClient::_rosterRetryDelay
private

The documentation for this class was generated from the following files: