spicetools/reader/structuredmessage.cpp

15 lines
575 B
C++
Raw Normal View History

2024-08-28 15:10:34 +00:00
#include "structuredmessage.h"
StructuredMessage::StructuredMessage(uint8_t node, uint8_t param, uint8_t cmd,
uint8_t packet_id, std::vector<uint8_t> request_data)
: Message(std::vector<uint8_t>()) {
this->data.clear();
this->data.push_back(node);
this->data.push_back(param);
this->data.push_back(cmd);
this->data.push_back(packet_id);
this->data.push_back((uint8_t) request_data.size());
this->data.insert(this->data.end(), std::begin(request_data), std::end(request_data));
this->reencode();
}