jorticus / pymate

Outback MATE python interface
https://jared.geek.nz/pymate
GNU General Public License v2.0
28 stars 9 forks source link

Workaround issue when recevied serial packets are too large #25

Closed jorticus closed 3 years ago

jorticus commented 3 years ago

Adds a workaround to trim the front off any packets that are larger than expected. This should help in the case the start of the packet was not correctly found.

To turn off the workaround, specify ser.TRIM_LARGE_PACKETS = False where ser is MateNETSerial.

This does not apply when using the PJON transport.

Also adds packet length checking for known packet types, for robustness.

Resolves #22