CARMA C++
carma::loberotator::LoberotatorMaster Class Reference

Carma Loberotator CAN Master class. More...

#include <carma/loberotator/LoberotatorMaster.h>

Inheritance diagram for carma::loberotator::LoberotatorMaster:
carma::loberotator::Chassis carma::canbus::Master carma::canbus::CanDio carma::canbus::CanIo carma::canbus::CanOutput

Public Member Functions

carma::loberotator::LoberotatorgetGlobalLoberotator ()
 Get 'global' (node 0 control device) loberotator. More...
 
carma::switchyard::Switchyard & getLlSwitchyard ()
 Retrieve reference to LL Switchyard instance. More...
 
carma::switchyard::Switchyard & getLoSwitchyard ()
 Retrieve reference to LO Switchyard instance. More...
 
bool isDone ()
 Query to see if the System::quit() method has been invoked. More...
 
 LoberotatorMaster (int holdoff, double autoWriteDelayInS, double syautoWriteDelayInS)
 Constructor for emulation mode Runs without accessing any hardware, directing all canbus writes to dev/null. More...
 
 LoberotatorMaster (int board, int bus, int holdoff, bool simulate, double autoWriteDelayInS, double syautoWriteDelayInS)
 LoberotatorMaster constructor. More...
 
- Public Member Functions inherited from carma::loberotator::Chassis
 Chassis ()
 Constructor. More...
 
void insert (Loberotator *)
 Insert a Loberotator into the system. More...
 
Loberotatorloberotator (int chan) const
 Get a loberotator. More...
 
virtual ~Chassis ()
 Destructor. More...
 
- Public Member Functions inherited from carma::canbus::Master
 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...
 
- Public Member Functions inherited from carma::canbus::CanDio
 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...
 
- Public Member Functions inherited from carma::canbus::CanIo
virtual BusStatusMap getBusStatus () const
 Retrieve bus statistics. More...
 
virtual ~CanIo ()
 Virtual destructor. More...
 

Protected Member Functions

void updateStatus ()
 Update the status of the Loberotator CAN Master. More...
 
virtual ~LoberotatorMaster ()
 Destructor. More...
 
- Protected Member Functions inherited from carma::canbus::Master
void addDevice (Device *device)
 Add a device to the master. More...
 
virtual std::map< msgType,
std::string > 
getControls () const
 Get controls. More...
 
DevicegetDevice (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 &)
 
Masteroperator= (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...
 
- Protected Member Functions inherited from carma::canbus::CanDio
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...
 

Additional Inherited Members

- Public Types inherited from carma::canbus::CanDio
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...
 
- Static Public Attributes inherited from carma::loberotator::Chassis
static const int N_CHAN = 24
 Maximum number of loberotator channels. More...
 
- Static Protected Member Functions inherited from carma::canbus::Master
static void * readThreadEntry (void *arg)
 Entry point for main thread. More...
 
static void * timerThreadEntry (void *arg)
 Entry point for timer thread. More...
 
- Protected Attributes inherited from carma::loberotator::Chassis
carma::loberotator::Loberotatorloberotator_ [N_CHAN]
 
- Protected Attributes inherited from carma::canbus::Master
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_
 
- Protected Attributes inherited from carma::canbus::CanDio
std::auto_ptr
< carma::canbus::CanIo
cio_
 
std::auto_ptr< carma::canbus::Diodio_
 
const long pulseWidth_
 Reset pulsewidth. More...
 
const bool terminate_
 

Detailed Description

Carma Loberotator CAN Master class.

Definition at line 42 of file LoberotatorMaster.h.

Constructor & Destructor Documentation

carma::loberotator::LoberotatorMaster::LoberotatorMaster ( int  holdoff,
double  autoWriteDelayInS,
double  syautoWriteDelayInS 
)

Constructor for emulation mode Runs without accessing any hardware, directing all canbus writes to dev/null.

Automatically does simulation.

Parameters
holdoffdelay (msec) to send commands to the XAC after halfsec tick
autoWriteDelayInSMonitor system autowrite delay in seconds.
syautoWriteDelayInSSwitchyeard monitor system autowrite delay in seconds.
carma::loberotator::LoberotatorMaster::LoberotatorMaster ( int  board,
int  bus,
int  holdoff,
bool  simulate,
double  autoWriteDelayInS,
double  syautoWriteDelayInS 
)

LoberotatorMaster constructor.

Parameters
boardJanz modulBus board designator (0 - 15).
busJanz modulBus slot # of CAN card to use (0 or 1).
simulateProduce simulated monitor packets
holdoffdelay (msec) to send commands to the XAC after halfsec tick
autoWriteDelayInSMonitor system autowrite delay in seconds.
syautoWriteDelayInSSwitchyeard monitor system autowrite delay in seconds.
virtual carma::loberotator::LoberotatorMaster::~LoberotatorMaster ( )
protectedvirtual

Destructor.

By declaring the LoberotatorMaster destructor as protected we force a user to only allocate it on the heap. This is done in order for proper use with CORBA reference counting.

Member Function Documentation

carma::loberotator::Loberotator& carma::loberotator::LoberotatorMaster::getGlobalLoberotator ( )

Get 'global' (node 0 control device) loberotator.

carma::switchyard::Switchyard& carma::loberotator::LoberotatorMaster::getLlSwitchyard ( )

Retrieve reference to LL Switchyard instance.

carma::switchyard::Switchyard& carma::loberotator::LoberotatorMaster::getLoSwitchyard ( )

Retrieve reference to LO Switchyard instance.

bool carma::loberotator::LoberotatorMaster::isDone ( )

Query to see if the System::quit() method has been invoked.

This routine is for debug use to explicitly determine if a user has invoked the carma::loberotator::System::quit() method

void carma::loberotator::LoberotatorMaster::updateStatus ( )
protectedvirtual

Update the status of the Loberotator CAN Master.

This routine is responsible for retrieving values specific to the state of the CanMaster object and the CANbus(ses) themselves such as number of online nodes, CANbus errors, etc. It retrieves these values and places them into the monitor stream. The method is called internally my the canbus::Master base class every half second as described in carma::canbus::Master.

Implements carma::canbus::Master.


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