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

Method calcOverhead

src/Packet.cpp:321–333  ·  view source on GitHub ↗

void Packet::calcOverhead(uint8_t arr[], const uint8_t &len) Description: ------------ * Calculates the COBS (Consistent Overhead Stuffing) Overhead byte and stores it in the class's overheadByte variable. This variable holds the byte position (within the payload) of the first payload byte equal to that of START_BYTE Inputs: ------- * uint8_t arr[] - Array of values the over

Source from the content-addressed store, hash-verified

319 * void
320*/
321void Packet::calcOverhead(uint8_t arr[], const uint8_t& len)
322{
323 overheadByte = 0xFF;
324
325 for (uint8_t i = 0; i < len; i++)
326 {
327 if (arr[i] == START_BYTE)
328 {
329 overheadByte = i;
330 break;
331 }
332 }
333}
334
335
336/*

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected