switch ota status highest_chunk to next_expected_chunk

This commit is contained in:
Gwendolyn 2023-12-01 19:08:33 +01:00
parent c2170ae741
commit 013a480f6d
2 changed files with 3 additions and 2 deletions

View file

@ -262,7 +262,8 @@ class MeshConsumer(AsyncWebsocketConsumer):
node_status.ota_recipient = None
else:
print('queue chunk sending')
await self.ota_set_chunks(node_status.ota_recipient.update, min_chunk=msg.highest_chunk+1)
await self.ota_set_chunks(node_status.ota_recipient.update,
min_chunk=msg.next_expected_chunk)
if isinstance(msg, messages.OTARequestFragmentsMessage):
print('got OTA fragment request', msg)

View file

@ -296,7 +296,7 @@ class OTAStatusMessage(MeshMessage, msg_type=MeshMessageType.OTA_STATUS):
""" report OTA status """
update_id: int = field(metadata={"format": SimpleFormat('I')})
received_bytes: int = field(metadata={"format": SimpleFormat('I')})
highest_chunk: int = field(metadata={"format": SimpleFormat('H')})
next_expected_chunk: int = field(metadata={"format": SimpleFormat('H')})
auto_apply: bool = field(metadata={"format": BoolFormat()})
auto_reboot: bool = field(metadata={"format": BoolFormat()})
status: OTADeviceStatus = field(metadata={"format": EnumFormat('B')})