Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit 6f6dbb4

Browse files
author
Catalin Ioana
committed
[Pymesh] Commented-out Child forcing
1 parent 16d5c89 commit 6f6dbb4

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

pymesh/pymesh_frozen/main.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ def new_message_cb(rcv_ip, rcv_port, rcv_data):
1818
print(rcv_data)
1919

2020
# user code to be inserted, to send packet to the designated Mesh-external interface
21-
# ...
21+
for _ in range(3):
22+
pycom.rgbled(0x888888)
23+
time.sleep(.2)
24+
pycom.rgbled(0)
25+
time.sleep(.1)
2226
return
2327

2428

@@ -30,11 +34,11 @@ def new_message_cb(rcv_ip, rcv_port, rcv_data):
3034
#initialize Pymesh
3135
pymesh = Pymesh(pymesh_config, new_message_cb)
3236

33-
mac = pymesh.mac()
34-
if mac > 10:
35-
pymesh.end_device(True)
36-
elif mac == 5:
37-
pymesh.leader_priority(255)
37+
# mac = pymesh.mac()
38+
# if mac > 10:
39+
# pymesh.end_device(True)
40+
# elif mac == 5:
41+
# pymesh.leader_priority(255)
3842

3943
while not pymesh.is_connected():
4044
print(pymesh.status_str())
@@ -58,7 +62,7 @@ def new_message_cb(rcv_ip, rcv_port, rcv_data):
5862
# pymesh.br_set(PymeshConfig.BR_PRIORITY_NORM, new_br_message_cb)
5963

6064
# remove Border Router function from current node
61-
#pymesh.br_remove()
65+
# pymesh.br_remove()
6266

6367
# send data for Mesh-external, basically to the BR
6468
# ip = "1:2:3::4"

0 commit comments

Comments
 (0)