Let us say I am receiving a packet with variable length data payload.
**byte_num** **size** **type**
0 1 Length
1 1 SrcArsDev
2 4 Src_ID
6 1 DstArsDev
7 4 Dst_ID
11 4 Session
15 1 CMD
16 N N bytes payload N<=96
16+N 2 CRC
The data will be received over SPI communication. What is the general method for parsing the packets so I can later manipulate the distinct elements?
Can you please show me a simple function/routine that fills the structure elements?