CARMA C++
XacDevice.h
Go to the documentation of this file.
1 
9 #ifndef CARMA_CANBUS_DEVICES_XACDEVICE_H
10 #define CARMA_CANBUS_DEVICES_XACDEVICE_H
11 
12 // Carma includes
13 #include "carma/canbus/Device.h"
14 
15 #include "carma/util/types.h"
16 
17 namespace carma {
18 
19 namespace monitor {
20  // Forward dec
21  class Xac;
22 } // End namespace monitor
23 
24 namespace canbus {
25 namespace devices {
26 
38  public:
39 
51  carma::canbus::CanOutput &canOutput);
52 
56  virtual ~XacDevice();
57 
68  virtual std::map<msgType, std::string> getSlowMonitors() const;
69 
75  virtual void setState(deviceStateType state);
76 
77  // Standard System Monitor Packets supported in this class
78  static const carma::canbus::msgType SYSTEM_MONITOR_PACKET_1 = 0x120;
79  static const carma::canbus::msgType SYSTEM_MONITOR_PACKET_2 = 0x121;
80  static const carma::canbus::msgType SYSTEM_MONITOR_PACKET_3 = 0x122;
81  static const carma::canbus::msgType SYSTEM_MONITOR_PACKET_4 = 0x123;
82  static const carma::canbus::msgType SYSTEM_MONITOR_PACKET_5 = 0x124;
83 
84  protected:
85 
91  virtual void initialize( );
92 
97 
104  carma::monitor::Xac & xac );
105 
117  carma::monitor::Xac& xac);
118 
126  carma::monitor::Xac& xac);
127 
135  carma::monitor::Xac& xac);
136 
144  carma::monitor::Xac& xac);
145 
153  carma::monitor::Xac& xac);
154 
161 
166 
171 
176 
181 
186 
187  public:
188 
192  void reset();
193 
198 
203 
207  void startChannelOneFastSampling(unsigned short fastItem);
208 
212  void startChannelTwoFastSampling(unsigned short fastItem);
213 
217  bool isOnline();
218 
219  private:
220 
221  // Prevent assignment and copy construction
222  XacDevice(const XacDevice &);
223  XacDevice &operator=(const XacDevice &);
224 
225  const carma::util::frameType startFrame_;
226 
227  }; // End XacDevice
228 } // End devices
229 } // End canbus
230 } // End carma
231 #endif
carma::canbus::Message simSystemMonitorPacket4()
Simulate System Monitor Packet 4.
void processSystemMonitorPacket3(carma::canbus::DataVector &data, carma::monitor::Xac &xac)
Process System Monitor Packet 3.
void processSystemMonitorPacket4(carma::canbus::DataVector &data, carma::monitor::Xac &xac)
Process System Monitor Packet 4.
void processSystemMonitorPacket(carma::canbus::msgType mid, carma::canbus::DataVector &data, carma::monitor::Xac &xac)
Process a system monitor packet.
void processSystemMonitorPacket1(carma::canbus::DataVector &data, carma::monitor::Xac &xac)
Process System Monitor Packet 1 This routine processes standard system monitor packet 1 and places th...
Class to encapsulate a CAN message.
Definition: Message.h:21
XacDevice(carma::canbus::apiType api, carma::canbus::nodeType node, carma::canbus::CanOutput &canOutput)
Constructor.
unsigned int frameType
Half second frames since Jan 1, 2000.
Definition: types.h:29
carma::canbus::Message simSystemMonitorPacket3()
Simulate System Monitor Packet 3.
carma::canbus::Message simSystemMonitorPacket(carma::canbus::msgType mid)
Simulate system monitor packet.
void startChannelTwoFastSampling(unsigned short fastItem)
Start fast sampling on channel two with the requested data item.
carma::canbus::Message simSystemMonitorPacket5()
Simulate System Monitor Packet 5.
void stopChannelOneFastSampling()
Stop fast sampling on channel one.
XacDevice canbus::device class implementation.
Definition: XacDevice.h:37
unsigned short apiType
Carma API id type.
Definition: Types.h:64
carma::canbus::Message simSystemMonitorPacket2()
Simulate System Monitor Packet 2.
virtual std::map< msgType, std::string > getSlowMonitors() const
Return a map of slow monitor points supported by this class The XacDevice class supports processing o...
void reset()
Reset the can module via CORBA using Device::softReset() method.
unsigned short nodeType
Carma Node Type id type.
Definition: Types.h:66
virtual void initialize()
Initialization hook.
void processSystemMonitorPacket2(carma::canbus::DataVector &data, carma::monitor::Xac &xac)
Process System Monitor Packet 2.
void processSystemMonitorPacket5(carma::canbus::DataVector &data, carma::monitor::Xac &xac)
Process System Monitor Packet 5.
::std::vector< ::carma::canbus::byteType > DataVector
Alias for CAN data.
Definition: Types.h:72
Abstract base class for all CAN Bus devices.
Definition: Device.h:92
void startChannelOneFastSampling(unsigned short fastItem)
Start fast sampling on channel one with the requested data item.
Declaration of carma::canbus::Device class.
virtual ~XacDevice()
Destructor.
static bool isSystemMonitorPacket(carma::canbus::msgType)
Check that input message type is a system monitor packet.
void stopChannelTwoFastSampling()
Stop fast sampling on channel two.
virtual void setState(deviceStateType state)
Set the state of the device.
unsigned short msgType
Carma Message id type.
Definition: Types.h:69
Various type definitions for util classes.
CanOutput interface.
Definition: CanOutput.h:26
bool isOnline()
Is Device ONLINE?
carma::canbus::Message simSystemMonitorPacket1()
Simulate System Monitor Packet 1.