From 1e8fa54a05326494c9101068df23f9c39f147c1a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 3 Jun 2024 14:57:21 -0500 Subject: [PATCH] Chunked payload for PoC binary transfer --- meshtastic/mesh.options | 4 ++++ meshtastic/mesh.proto | 48 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/meshtastic/mesh.options b/meshtastic/mesh.options index aedfe99..6dcd248 100644 --- a/meshtastic/mesh.options +++ b/meshtastic/mesh.options @@ -59,3 +59,7 @@ *MqttClientProxyMessage.topic max_size:60 *MqttClientProxyMessage.data max_size:435 *MqttClientProxyMessage.text max_size:435 + +*ChunkedPayload.chunk_count int_size:16 +*ChunkedPayload.chunk_index int_size:16 +*ChunkedPayload.payload_chunk max_size:228 diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 279f222..214eb57 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -1626,3 +1626,51 @@ message NodeRemoteHardwarePin { */ RemoteHardwarePin pin = 2; } + +message ChunkedPayload { + /* + * The ID of the entire payload + */ + uint32 payload_id = 1; + + /* + * The total number of chunks in the payload + */ + uint32 chunk_count = 2; + + /* + * The current chunk index in the total + */ + uint32 chunk_index = 3; + + /* + * The binary data of the current chunk + */ + bytes payload_chunk = 4; +} + +/* + * Responses to a ChunkedPayload request + */ +message ChunkedPayloadResponse { + /* + * The ID of the entire payload + */ + uint32 payload_id = 1; + + oneof payload_variant { + /* + * Request to transfer chunked payload + */ + bool request_transfer = 2; + + /* + * Accept the transfer chunked payload + */ + bool accept_transfer = 3; + /* + * Request missing indexes in the chunked payload + */ + repeated uint32 resend_chunks = 4; + } +} \ No newline at end of file