Bug #506

We drop too many hub frames

Added by Espen Solbu over 5 years ago.

Status:NewStart date:08/29/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:FrSky HubSpent time:-
Target version:3.0 FrSky hub and sensors

Description

Tested in branch 2.0 (r485)

I dont think the addUserBytes() method in FrSkyHub works correctly

We get too many start/stop bytes at wrong position
We need to consider the length of valid bytes in the frame, and discard bytes after. SIZE_HUB_FRAME should not be used
Hub destuffing should only apply to the actual payload, and not the length or the second NA byte

I think better process, is to add bytes to buffer (pre-destuffing), as soon as we have delimiter byte, identify this part as hub frame, destuff then parse,
With rest of bytes, add (in place) until different from delimiter byte.
Alternatively, only read valid bytes, discard any bytes after this from this frame.

This might have been changed in trunk, need to recheck this

Also available in: Atom PDF