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
| 59 | * uint8_t numBytesIncl - Number of payload bytes included in packet |
| 60 | */ |
| 61 | uint8_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 | /* |
nothing calls this directly
no test coverage detected