Skip to content

Commit

Permalink
Add pypackage retransmit last frame
Browse files Browse the repository at this point in the history
Mentioned in #30 by @stefan123t
  • Loading branch information
Sprinterfreak committed May 21, 2022
1 parent 8238e90 commit 93b3f02
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/rpi/hoymiles/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ def get_payload(self, src=None):
self.time_rx = end_frame.time_rx
tr_len = end_frame.seq - 0x80
except StopIteration:
seq_last = max(frames, key=lambda frame:frame.seq).seq
self.__retransmit_frame(seq_last + 1)
raise BufferError(f'Missing packet: Last packet {len(self.scratch)}')

# Rebuild payload from unordered frames
Expand Down

0 comments on commit 93b3f02

Please sign in to comment.