File transfer example

This commit is contained in:
Mark Qvist 2018-04-25 22:46:05 +02:00
parent 4d48a50f7e
commit 8aa2f8613a
3 changed files with 13 additions and 5 deletions

View file

@ -86,8 +86,10 @@ def client_connected(link):
# We pack a list of files for sending in a packet
data = umsgpack.packb(list_files())
RNS.log(str(len(data)))
# Check the size of the packed data
if len(data) <= RNS.Resource.SDU:
if len(data) <= RNS.Reticulum.LINK_MDU:
# If it fits in one packet, we will just
# send it as a single packet over the link.
list_packet = RNS.Packet(link, data)