dart_mavlink icon indicating copy to clipboard operation
dart_mavlink copied to clipboard

Issue with persistent data in statustext lists

Open JMare opened this issue 11 months ago • 1 comments

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 image image image

Timing is as shown: image

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: image

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

JMare avatar Mar 25 '24 01:03 JMare