10 #ifndef CARMA_CANBUS_MASTER_H
11 #define CARMA_CANBUS_MASTER_H
22 #include "carma/util/PthreadMutex.h"
127 Master(
bool simOfflineNodes =
true );
152 bool simOfflineNodes =
false,
154 bool terminate =
true );
191 bool simOfflineNodes =
false,
193 bool terminate =
true );
206 Master( const ::std::vector< DevTermPair > & devTermPairs,
207 bool simOfflineNodes =
false,
208 bool reset =
false );
351 virtual std::map<msgType, std::string>
getControls()
const;
460 std::map<keyType, Device*> devices_;
461 mutable pthread_mutex_t deviceMutex_;
464 int nUnknownPackets_;
465 int nDonglelessPackets_;
466 pthread_t timerThreadId_;
467 pthread_t readThreadId_;
468 const int simOfflineNodes_;
476 #endif // End #ifndef CARMA_CANBUS_MASTER_H
virtual void setTime()
Send a time sync message.
void runTimerThread()
Timer thread.
Class to control the CARMA specialized Janz CAN/DIO card.
int getOnlineNodeCount() const
Get number of online nodes.
virtual ~Master()
Master destructor.
void run()
Run the Master.
void softwareReset()
Send a software reset command to all modules.
unsigned short apiType
Carma API id type.
unsigned int getLatePacketCount()
Get combined late packet count from all devices.
unsigned short nodeType
Carma Node Type id type.
int getUnknownPacketCount() const
Get number of unknown packets This method returns the number of CAN packets that canbus::Master does ...
int getDonglelessPacketCount() const
Get 'Dongleless node' packet count This routine returns the number of Dongleless node packets detecte...
Master(bool simOfflineNodes=true)
Default constructor for emulation.
static void * readThreadEntry(void *arg)
Entry point for main thread.
static void * timerThreadEntry(void *arg)
Entry point for timer thread.
Abstract base class for all CAN Bus devices.
Carma Canbus Master class.
void stop()
Stop running internal Master threads.
void removeDevice(apiType api, nodeType node)
Remove a device.
virtual void runReadThread()
Thread to read and process incoming CAN messages.
A simple wrapper class that makes use of ::pthread_mutex_t easier in a C++ world. ...
virtual void updateStatus()=0
Update the status of the master.
Device * getDevice(apiType api, nodeType node)
Get pointer to a device.
void addDevice(Device *device)
Add a device to the master.
void updateDevicesStates()
Update the devices states.
int getOfflineNodeCount() const
Get number of offline nodes.
virtual std::map< msgType, std::string > getControls() const
Get controls.
Declaration of carma::canbus::CanDio class.