it continualy scans the data sent. i dont realy understand your question
I suppose my question might be irrevelant, because I really have some difficulty to understand the code.
I understand that Mavlink has message ids that are used to differentiate between messages.
The gcs may scan a message id which is one byte long. Then according to the message id it knows and reads the messageLengths(id) many bytes and translates it.Is that correct?
In the initialization of arduino there are some messages written to the serial. I dont know the length of this messages. (I suppose it ends with READY TO FLY or something like that). Because there were undefined previous messages in the serial buffer, I dont know when is the first byte of heartbeat is coming. If I dont know when is the first byte coming how I can read the message correctly. Thanks.
you look for the packet start byte "U" and parse the packet from there. and you can either reject or continue withing the first 4 bytes
Thanks for the quick reply. I see now you have all the process in Mavlink.cs in your code.
I suppose you do use the same for generating mavlink msgs.
packet = (byte)'U';
packet = (byte)data.Length;
packet = packetcount;
packet = 255; // this is always 255 - MYGCS
Is there a document describes this message format clearly, mavlink code generation and decode. It seems as I am missing to notice an important document here.
Also is there any c/c++ version of this class written somewhere because it looks as I would have to spend serious time rewiriting this in c. Thanks