dart_mavlink
dart_mavlink copied to clipboard
Issue with persistent data in statustext lists
Hi, I came across this issue with data persisting in the text list of statustext messages that come quickly together.
I setup code based on your 'parser' example, but that looks for statustext messages and prints the results. I then connected Ardupilot SITL and tested by issuing "arm throttle" command in mavproxy.
This results in three statustext messages being sent, the first two in close succession, the last one a few seconds later, three messages shown in wireshark
Timing is as shown:
Using the following code in dart to parse the messages:
parser.stream.listen((MavlinkFrame frm) {
if (frm.message is Statustext) {
var st = frm.message as Statustext;
String toprint = ascii.decode(st.text, allowInvalid: true);
print('$toprint');
}
});
This gives the output:
So it seems like there is some data persistence issue in the lists? Unless I've done something wrong.
The third message can be cleaned up by detecting the null termination in the list, but the second one has no null termination at the end of the message text