HeatPump
HeatPump copied to clipboard
Read all packets in buffer during sync and before update
Currently we strictly read one packet each time sync()
is called.
This means that if writePacket()
is ever called twice in a row
before reading, a packet will be permanently buffered.
In cases where you expect to write a packet and receive a response
in the next packet, such as during update()
, having buffered packets
guarantees you won't receive the correct packet next.
Changing sync()
and update()
to flush the serial buffer makes the
behavior much more robust and in my testing has always given me the
0x41 0x61 pair successfully when I call update()
.
Closes #181