CARMA C++
|
Carma CAN MasterOfNone class. More...
#include <carma/canbus/MasterOfNone.h>
Public Member Functions | |
MasterOfNone (int boardId, int canbus) | |
Constructor for single CANbus. More... | |
MasterOfNone (int boardId) | |
Constructor for two CAN busses. More... | |
~MasterOfNone () | |
Destructor. More... | |
![]() | |
Master (bool simOfflineNodes=true) | |
Default constructor for emulation. More... | |
Master (int boardId, bool simOfflineNodes=false, bool reset=false, bool terminate=true) | |
Master constructor. More... | |
Master (int boardId, int modulbusId, bool simOfflineNodes=false, bool reset=false, bool terminate=true) | |
Master constructor. More... | |
Master (const ::std::vector< DevTermPair > &devTermPairs, bool simOfflineNodes=false, bool reset=false) | |
Constructor for arbitrary number of CanDio ports. More... | |
void | run () |
Run the Master. More... | |
void | stop () |
Stop running internal Master threads. More... | |
virtual | ~Master () |
Master destructor. More... | |
![]() | |
CanDio () | |
Default constructor. More... | |
CanDio (int boardId, bool reset=true, bool terminate=true) | |
Constructor to control both CAN busses on a single board. More... | |
CanDio (int boardId, int slotId, bool reset=true, bool terminate=true) | |
Constructor to control a single CAN bus. More... | |
CanDio (const std::vector< DevTermPair > &devTermPairs, bool reset=true) | |
Constructor to control arbitrary number of CAN busses. More... | |
void | echoAll (bool enable) |
Enable or disable echoing sent messages back through the read interface. More... | |
std::map< busIdType, carma::canbus::busStatusType > | getBusStatus () |
carma::canbus::Message | getMessage () |
Retrieve a CAN message. More... | |
bool | isTerminated () |
Return termination state. More... | |
void | postMessage (const carma::canbus::Message &msg, carma::canbus::txPriorityType prio=carma::canbus::NORMAL) |
Post a CAN message. More... | |
void | reset () |
Reset. More... | |
![]() | |
virtual BusStatusMap | getBusStatus () const |
Retrieve bus statistics. More... | |
virtual | ~CanIo () |
Virtual destructor. More... | |
Additional Inherited Members | |
![]() | |
typedef ::std::pair< int, int > | BoardSlotPair |
Pair containing boardId (first) and slotId (second). More... | |
typedef ::std::pair < BoardSlotPair, bool > | DevTermPair |
Pair for board & slot (first) and termination setting (second). More... | |
![]() | |
void | addDevice (Device *device) |
Add a device to the master. More... | |
virtual std::map< msgType, std::string > | getControls () const |
Get controls. More... | |
Device * | getDevice (apiType api, nodeType node) |
Get pointer to a device. More... | |
int | getDonglelessPacketCount () const |
Get 'Dongleless node' packet count This routine returns the number of Dongleless node packets detected by Master. More... | |
unsigned int | getLatePacketCount () |
Get combined late packet count from all devices. More... | |
int | getOfflineNodeCount () const |
Get number of offline nodes. More... | |
int | getOnlineNodeCount () const |
Get number of online nodes. More... | |
int | getUnknownPacketCount () const |
Get number of unknown packets This method returns the number of CAN packets that canbus::Master does not recognize. More... | |
Master (const Master &) | |
Master & | operator= (const Master &) |
void | removeDevice (apiType api, nodeType node) |
Remove a device. More... | |
virtual void | runReadThread () |
Thread to read and process incoming CAN messages. More... | |
void | runTimerThread () |
Timer thread. More... | |
virtual void | setTime () |
Send a time sync message. More... | |
void | softwareReset () |
Send a software reset command to all modules. More... | |
void | updateDevicesStates () |
Update the devices states. More... | |
![]() | |
void | clearReadQueue () |
Clear any underlying read buffers. More... | |
void | queueMessage (const Message &msg) |
Queue CAN message to be read for simulation purposes. More... | |
void | setTimestampEchoLatency (int tsLatency, busIdType busId) |
Set timestamp echo latency. More... | |
![]() | |
static void * | readThreadEntry (void *arg) |
Entry point for main thread. More... | |
static void * | timerThreadEntry (void *arg) |
Entry point for timer thread. More... | |
![]() | |
pthread_mutex_t | deviceMutex_ |
std::map< keyType, Device * > | devices_ |
int | nDonglelessPackets_ |
int | nOfflineNodes_ |
int | nOnlineNodes_ |
int | nUnknownPackets_ |
pthread_t | readThreadId_ |
bool | running_ |
carma::util::PthreadMutex | runningMutex_ |
const int | simOfflineNodes_ |
pthread_t | timerThreadId_ |
![]() | |
std::auto_ptr < carma::canbus::CanIo > | cio_ |
std::auto_ptr< carma::canbus::Dio > | dio_ |
const long | pulseWidth_ |
Reset pulsewidth. More... | |
const bool | terminate_ |
Carma CAN MasterOfNone class.
This class is a dummy implementation of the carma::canbus::Master class. It contains no Device derivatives and contains no control commands or other methods. As such, it is functionally useful only to send timestamps and to pass incoming CAN messages on to the DirectCan queues (and subsequently canOverIp). This is useful if one needs an application which only acts as an intermediary for canOverIp but doesn't need to process messages or expose control commands on the machine hosting the CANbus(ses). One downside of this is that there is no way to control the hardware reset lines (i.e. hard reset all modules), although these lines will always be driven when this class is used.
Definition at line 32 of file MasterOfNone.h.
carma::canbus::MasterOfNone::MasterOfNone | ( | int | boardId, |
int | canbus | ||
) |
Constructor for single CANbus.
For use with only a single CANbus on a multi bus board.
boardId | Modulbus board id [0-15]. |
canbus | Canbus or modulbusNo [0-1]. |
carma::canbus::MasterOfNone::MasterOfNone | ( | int | boardId | ) |
Constructor for two CAN busses.
For use with both busses on a single Janz/Carma CAN/DIO board.
boardId | Modulbus board id [0-15]. |
carma::canbus::MasterOfNone::~MasterOfNone | ( | ) |
Destructor.