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

Method unpackPacket

src/Packet.cpp:406–421  ·  view source on GitHub ↗

void Packet::unpackPacket(uint8_t arr[], const uint8_t &len) Description: ------------ * Unpacks all COBS-stuffed bytes within the array Inputs: ------- * uint8_t arr[] - Array of values to unpack * const uint8_t &len - Number of elements in arr[] Return: ------- * void */

Source from the content-addressed store, hash-verified

404 * void
405*/
406void Packet::unpackPacket(uint8_t arr[])
407{
408 uint8_t testIndex = recOverheadByte;
409 uint8_t delta = 0;
410
411 if (testIndex <= MAX_PACKET_SIZE)
412 {
413 while (arr[testIndex])
414 {
415 delta = arr[testIndex];
416 arr[testIndex] = START_BYTE;
417 testIndex += delta;
418 }
419 arr[testIndex] = START_BYTE;
420 }
421}
422
423
424/*

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected