meshcore 2.1.15__tar.gz → 2.1.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {meshcore-2.1.15 → meshcore-2.1.16}/PKG-INFO +1 -1
- {meshcore-2.1.15 → meshcore-2.1.16}/pyproject.toml +1 -1
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/commands/contact.py +12 -26
- {meshcore-2.1.15 → meshcore-2.1.16}/.github/python-test.yml +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/.gitignore +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/LICENSE +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/README.md +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/ble_chat.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/ble_pin_pairing_example.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/ble_private_key_export.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/ble_t1000_chan_msg.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/ble_t1000_custom_vars.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/ble_t1000_infos.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/ble_t1000_msg.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/ble_t1000_msg_retries.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/ble_t1000_set_cv.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/connection_events_example.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/mepo_mc_gps.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/pubsub_example.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/rf_packet_monitor.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/serial_battery_monitor.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/serial_channel_manager.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/serial_chat.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/serial_contacts.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/serial_infos.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/serial_msg.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/serial_repeater_status.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/serial_repeater_telemetry.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/serial_trace.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/tcp_chat.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/tcp_login_status.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/tcp_mchome_contacts.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/tcp_mchome_infos.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/tcp_mchome_msg.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/examples/tcp_mchome_readmsgs.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/pytest.ini +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/__init__.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/ble_cx.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/commands/__init__.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/commands/base.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/commands/binary.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/commands/device.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/commands/messaging.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/connection_manager.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/events.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/lpp_json_encoder.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/meshcore.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/packets.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/parsing.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/reader.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/serial_cx.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/src/meshcore/tcp_cx.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/tests/README.md +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/tests/test_ble_connection.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/tests/test_ble_pin_pairing.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/tests/test_meshcore_ble_pin.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/tests/unit/test_commands.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/tests/unit/test_events.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/tests/unit/test_private_key_export.py +0 -0
- {meshcore-2.1.15 → meshcore-2.1.16}/tests/unit/test_reader.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meshcore
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.16
|
|
4
4
|
Summary: Base classes for communicating with meshcore companion radios
|
|
5
5
|
Project-URL: Homepage, https://github.com/fdlamotte/meshcore_py
|
|
6
6
|
Project-URL: Issues, https://github.com/fdlamotte/meshcore_py/issues
|
|
@@ -9,17 +9,17 @@ logger = logging.getLogger("meshcore")
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class ContactCommands(CommandHandlerBase):
|
|
12
|
-
async def
|
|
12
|
+
async def get_contacts_async(self, lastmod=0) :
|
|
13
13
|
logger.debug("Getting contacts")
|
|
14
14
|
data = b"\x04"
|
|
15
15
|
if lastmod > 0:
|
|
16
16
|
data = data + lastmod.to_bytes(4, "little")
|
|
17
|
-
if anim:
|
|
18
|
-
print("Fetching contacts ", end="", flush=True)
|
|
19
17
|
# wait first event
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
await self.send(data)
|
|
19
|
+
|
|
20
|
+
async def get_contacts(self, lastmod=0, timeout=5) -> Event:
|
|
21
|
+
await self.get_contacts_async(lastmod)
|
|
22
|
+
|
|
23
23
|
# Inline wait for events to continue waiting for CONTACTS event
|
|
24
24
|
# while receiving NEXT_CONTACTs (or it might be missed over serial)
|
|
25
25
|
try:
|
|
@@ -40,30 +40,20 @@ class ContactCommands(CommandHandlerBase):
|
|
|
40
40
|
|
|
41
41
|
# Check if any future completed successfully
|
|
42
42
|
if len(done) == 0:
|
|
43
|
-
|
|
43
|
+
logger.debug("Timeout while getting contacts")
|
|
44
44
|
for future in pending: # cancel all futures
|
|
45
45
|
future.cancel()
|
|
46
46
|
return None
|
|
47
47
|
|
|
48
48
|
for future in done:
|
|
49
49
|
event = await future
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
contact_nb = contact_nb+1
|
|
55
|
-
print(".", end="", flush=True)
|
|
56
|
-
else: # Done or Error ... cancel pending and return
|
|
57
|
-
if anim:
|
|
58
|
-
if event.type == EventType.CONTACTS:
|
|
59
|
-
print ((len(event.payload)-contact_nb)*"." + " Done")
|
|
60
|
-
else :
|
|
61
|
-
print(" Error")
|
|
62
|
-
for future in pending:
|
|
63
|
-
future.cancel()
|
|
64
|
-
return event
|
|
50
|
+
if event is None or event.type != EventType.NEXT_CONTACT:
|
|
51
|
+
for future in pending:
|
|
52
|
+
future.cancel()
|
|
53
|
+
return event
|
|
65
54
|
|
|
66
55
|
futures = []
|
|
56
|
+
|
|
67
57
|
for future in pending: # put back pending
|
|
68
58
|
futures.append(future)
|
|
69
59
|
|
|
@@ -74,13 +64,9 @@ class ContactCommands(CommandHandlerBase):
|
|
|
74
64
|
|
|
75
65
|
except asyncio.TimeoutError:
|
|
76
66
|
logger.debug(f"Timeout receiving contacts")
|
|
77
|
-
if anim:
|
|
78
|
-
print(" Timeout")
|
|
79
67
|
return None
|
|
80
68
|
except Exception as e:
|
|
81
69
|
logger.debug(f"Command error: {e}")
|
|
82
|
-
if anim:
|
|
83
|
-
print(" Error")
|
|
84
70
|
return Event(EventType.ERROR, {"error": str(e)})
|
|
85
71
|
|
|
86
72
|
async def reset_path(self, key: DestinationType) -> Event:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|