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.
You could base it on the widely-used AT Command protocol
www.itu.int/.../en
eg,
AT*PWM=100
AT Commands are a bit cumbersome for machine use, but are great if you also want human users to be able to use the interface; eg, at a terminal...