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 */
| 404 | * void |
| 405 | */ |
| 406 | void 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 | /* |
nothing calls this directly
no outgoing calls
no test coverage detected