Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adb22c2 commit 60f2592Copy full SHA for 60f2592
lib/lora_mesh/main.py
@@ -39,12 +39,14 @@
39
break
40
41
# create UDP socket
42
+sockets = []
43
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
44
myport = 1234
45
s.bind(myport)
46
+sockets.append(s)
47
48
# handler responisble for receiving packets on UDP Pymesh socket
-def receive_pack():
49
+def receive_pack(sockets):
50
# listen for incomming packets
51
while True:
52
rcv_data, rcv_addr = s.recvfrom(128)
@@ -65,7 +67,7 @@ def receive_pack():
65
67
pack_num = 1
66
68
msg = "Hello World! MAC: " + MAC + ", pack: "
69
ip = mesh.ip()
-mesh.mesh.rx_cb(receive_pack)
70
+mesh.mesh.rx_cb(receive_pack,sockets)
71
72
# infinite main loop
73
0 commit comments