MCPcopy Create free account
hub / github.com/PowerBroker2/SerialTransfer / sendData

Method sendData

src/SerialTransfer.cpp:61–71  ·  view source on GitHub ↗

uint8_t SerialTransfer::sendData(const uint16_t &messageLen, const uint8_t packetID) Description: ------------ * Send a specified number of bytes in packetized form Inputs: ------- * const uint16_t &messageLen - Number of values in txBuff to send as the payload in the next packet * const uint8_t packetID - The packet 8-bit identifier Return: ------- * uint8_t numBytesInc

Source from the content-addressed store, hash-verified

59 * uint8_t numBytesIncl - Number of payload bytes included in packet
60*/
61uint8_t SerialTransfer::sendData(const uint16_t& messageLen, const uint8_t packetID)
62{
63 uint8_t numBytesIncl;
64
65 numBytesIncl = packet.constructPacket(messageLen, packetID);
66 port->write(packet.preamble, sizeof(packet.preamble));
67 port->write(packet.txBuff, numBytesIncl);
68 port->write(packet.postamble, sizeof(packet.postamble));
69
70 return numBytesIncl;
71}
72
73
74/*

Callers

nothing calls this directly

Calls 1

constructPacketMethod · 0.80

Tested by

no test coverage detected