43template <
typename SensorType>
53 const uint32_t length);
82 virtual void Parse(
const uint8_t *bytes, int32_t length,
83 SensorType *sensor_data)
const;
103 template <
typename T>
110template <
typename SensorType>
126template <
typename SensorType>
128 const uint32_t length) {
129 return static_cast<uint8_t
>(std::accumulate(input, input + length, 0) ^ 0xFF);
132template <
typename SensorType>
134 const uint32_t CONST_PERIOD = 100 * 1000;
138template <
typename SensorType>
143template <
typename SensorType>
145 SensorType *sensor_data)
const {}
147template <
typename SensorType>
150template <
typename SensorType>
153template <
typename SensorType>
This is the base class of protocol data.
virtual void UpdateData_Heartbeat(uint8_t *data)
ProtocolData()=default
construct protocol data.
static T BoundedValue(T lower, T upper, T val)
virtual void Parse(const uint8_t *bytes, int32_t length, SensorType *sensor_data) const
virtual void UpdateData(uint8_t *data)
static std::uint8_t CalculateCheckSum(const uint8_t *input, const uint32_t length)
static function, used to calculate the checksum of input array.
virtual int32_t GetLength() const
virtual ~ProtocolData()=default
destruct protocol data.
virtual uint32_t GetPeriod() const
const int32_t CANBUS_MESSAGE_LENGTH