9 SerialStream::SerialStream(std::shared_ptr<Data> d,
const uint8_t& header,
bool install_signal_handler) :
Serial(d, install_signal_handler), readState(READ_HEADER), headerByte(header) {
14 const uint8_t numPackets =
data->getNumPackets();
15 std::vector<uint8_t> packetIDs =
data->getPacketIDs();
16 packetIDs.insert(packetIDs.begin(), numPackets);
17 packetIDs.insert(packetIDs.begin(),
OC_STREAM);
20 send(packetIDs.data(), packetIDs.size());
uint8_t expectedNumDataBytes
std::shared_ptr< Data > data
void processByte(uint8_t byteRead)
bool send(const uint8_t *bytes, const uint32_t numBytes)
SerialStream(std::shared_ptr< Data > data, const uint8_t &header=create::util::STREAM_HEADER, bool install_signal_handler=true)