28 #ifndef VESC_DRIVER_VESC_PACKET_H_ 29 #define VESC_DRIVER_VESC_PACKET_H_ 37 #define CRCPP_USE_CPP11 44 typedef std::pair<Buffer::iterator, Buffer::iterator>
BufferRange;
54 virtual const Buffer&
frame()
const 79 VescFrame(
const BufferRangeConst&
frame,
const BufferRangeConst& payload);
93 virtual const std::string&
name()
const 99 VescPacket(
const std::string& name,
int payload_size,
int payload_id);
100 VescPacket(
const std::string& name, std::shared_ptr<VescFrame> raw);
134 double temp_mos1()
const;
135 double temp_mos2()
const;
136 double temp_mos3()
const;
137 double temp_mos4()
const;
138 double temp_mos5()
const;
139 double temp_mos6()
const;
140 double temp_pcb()
const;
141 double current_motor()
const;
142 double current_in()
const;
144 double duty_now()
const;
145 double amp_hours()
const;
146 double amp_hours_charged()
const;
147 double watt_hours()
const;
148 double watt_hours_charged()
const;
149 double tachometer()
const;
150 double tachometer_abs()
const;
151 int fault_code()
const;
222 #endif // VESC_DRIVER_VESC_PACKET_H_ std::pair< Buffer::iterator, Buffer::iterator > BufferRange
static constexpr CRC::Parameters< crcpp_uint16, 16 > CRC_TYPE
std::vector< uint8_t > Buffer
std::pair< Buffer::const_iterator, Buffer::const_iterator > BufferRangeConst
VescFrame(int payload_size)
std::shared_ptr< Buffer > frame_
Stores frame data, shared_ptr for shallow copy.
virtual const Buffer & frame() const
static const int VESC_MIN_FRAME_SIZE
Smallest VESC frame size, in bytes.
virtual const std::string & name() const
static const int VESC_MAX_FRAME_SIZE
Largest VESC frame size, in bytes.
static const int VESC_MAX_PAYLOAD_SIZE
Maximum VESC payload size, in bytes.
static const unsigned int VESC_EOF_VAL
VESC end-of-frame value.
std::shared_ptr< VescPacket > VescPacketPtr
std::shared_ptr< VescPacket const > VescPacketConstPtr
static const unsigned int VESC_SOF_VAL_LARGE_FRAME
VESC start of "large" frame value.
static const unsigned int VESC_SOF_VAL_SMALL_FRAME
VESC start of "small" frame value.
BufferRange payload_
View into frame's payload section.