Skip to content

read_packet needs to check for leftover data in self._buffer #9

Open
@kevinjwalters

Description

@kevinjwalters

I've noticed a strange buffering phenomena documented in https://forums.adafruit.com/viewtopic.php?f=60&t=144694

I've had a quick glance at the code but my first guess is this is because read_packet() returns None if there's no data coming back from a presumably non-blocking self.uart_rx(). I think the lack of checking for data leftover in self._buffer from a previous call to read_packet() is the problem. That previous call could have picked up two (or more) commands and read_packet() only returns first by design. I've not executed/single-stepped the code here, i'm just guessing from inspection but it seems to match observed behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions