how to read mavlink package .. is it ok to do it on my way ?

Joined
Apr 27, 2016
Messages
27
Reaction score
0
Age
47
i reading about MAVlink and i try to read packages from pixhawk fly controller.

I thought of another way to make the call and i want to know from this discussions readers if its ok and what are you think



On my reader .. i read the two first byte from the pixhawk.

The second byte need to be the PAYLOAD length --> so new i know that i need to read the 4 bytes of the header + PAYLOAD length bytes + 2 chcksub bytes.



So after reading the PAYLOAD length i define a byte array -> size is ( PAYLOAD.length + 4 + 2 ) and read from the serial to this buffer.



Is it ok to do it ?
 
Yeah sure. You're not obliged to use the library if you don't want to you. It's your world!
I would however bother to check that the first byte = 0xFE, especially since you're reading from serial.
 
  • Like
Reactions: speatuk

Members online

No members online now.

Forum statistics

Threads
13,093
Messages
147,741
Members
16,048
Latest member
ihatethatihavetomakeanacc