make it possible to request OTA fragments
This commit is contained in:
parent
1f59e53d15
commit
0af7c4801f
1 changed files with 7 additions and 0 deletions
|
@ -235,6 +235,13 @@ class MeshConsumer(AsyncWebsocketConsumer):
|
||||||
print('queue chunk sending')
|
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.highest_chunk+1)
|
||||||
|
|
||||||
|
if isinstance(msg, messages.OTARequestFragmentsMessage):
|
||||||
|
print('got OTA fragment request', msg)
|
||||||
|
desired_update_id = node_status.ota_recipient.update_id if node_status.ota_recipient else 0
|
||||||
|
if desired_update_id and msg.update_id == desired_update_id:
|
||||||
|
print('queue requested chunk sending')
|
||||||
|
await self.ota_set_chunks(node_status.ota_recipient.update, chunks=set(msg.chunks))
|
||||||
|
|
||||||
@database_sync_to_async
|
@database_sync_to_async
|
||||||
def create_uplink_in_database(self, address):
|
def create_uplink_in_database(self, address):
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue