In firmware, you often need to assemble a communication packet as a byte array before sending it over UART/SPI.
You are given the following fields:
Your task is to:
Example-1
Input: Command = 0x01 Value = 0x1234 Status = 1 Checksum = 0xAABBCCDD Output: 165 1 52 18 1 221 204 187 170 90
Example-2
Input: Command = 0xFF Value = 0x00FF Status = 0 Checksum = 0x01020304 Output: 165 255 255 0 0 4 3 2 1 90
Test Cases
Test Results
Input
1 4660 1 2864434397
Expected Output
165 1 52 18 1 221 204 187 170 90