I need to use STX, ETX, Length, Data, Checksum , CMD(Command) bytes in my protocol structure. Data and Length will be variable fields where length refers to length of data. I am new to Embedded c and just need an idea, where i can start as I am confused that, what kind of data(structure of data) user should sent over uart to initiate communication with micro controller. The protocol structure I am trying to develop is as follows:
STX|CMD|LENGTH|DATA|CHECKSUM|ETX.
Thanks in advance.
When it comes to serial protocols (such as used over RS-485), it is extremely wise to seriously consider implementation when creating the design. Hence my comment regarding kludges and fudges.
Most importantly for many serial implementations is consideration of error detection and recovery. That consideration is frequently not present when protocols are first conceived.