You receive a 6-byte data packet from a peripheral interface (e.g., UART or I2C). The byte stream format is:
You are given the packet as an array: uint8_t buffer[6]. Your task is to extract and print each field as integer values
Example-1
Input: 165 1 52 18 119 90 Output: Start: 165 Command: 1 Data: 4660 CRC: 119 End: 90
Example-2
Input: 170 255 255 0 254 85 Output: Start: 170 Command: 255 Data: 255 CRC: 254 End: 85
Test Cases
Test Results
Input
165 1 52 18 119 90
Expected Output
Start: 165 Command: 1 Data: 4660 CRC: 119 End: 90