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

Method sendData

src/I2CTransfer.cpp:63–76  ·  view source on GitHub ↗

uint8_t I2CTransfer::sendData(const uint16_t &messageLen, const uint8_t &packetID, const uint8_t &targetAddress=0) 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 * const ui

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

constructPacketMethod · 0.80

Tested by

no test coverage detected