meshcore 2.3.1__tar.gz → 2.3.2__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.3.1 → meshcore-2.3.2}/PKG-INFO +1 -1
- {meshcore-2.3.1 → meshcore-2.3.2}/pyproject.toml +1 -1
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/serial_cx.py +4 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/tcp_cx.py +4 -0
- meshcore-2.3.2/tests/unit/test_serial_connection.py +31 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/.github/python-test.yml +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/.gitignore +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/LICENSE +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/README.md +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/.pubsub_example.py.swp +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/ble_chat.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/ble_pin_pairing_example.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/ble_private_key_export.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/ble_sign_example.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/ble_stats.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/ble_t1000_chan_msg.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/ble_t1000_custom_vars.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/ble_t1000_infos.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/ble_t1000_msg.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/ble_t1000_msg_retries.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/ble_t1000_set_cv.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/chan_recv_with_path.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/connection_events_example.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/mepo_mc_gps.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/pubsub_example.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/rf_packet_monitor.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/serial_battery_monitor.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/serial_channel_manager.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/serial_chat.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/serial_contacts.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/serial_infos.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/serial_meshcore_ollama.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/serial_msg.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/serial_pingbot.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/serial_repeater_status.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/serial_repeater_telemetry.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/serial_rss_bot.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/serial_trace.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/tcp_chat.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/tcp_login_status.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/tcp_mchome_contacts.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/tcp_mchome_infos.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/tcp_mchome_msg.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/examples/tcp_mchome_readmsgs.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/pytest.ini +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/__init__.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/ble_cx.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/commands/__init__.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/commands/base.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/commands/binary.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/commands/contact.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/commands/control_data.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/commands/device.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/commands/messaging.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/connection_manager.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/events.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/lpp_json_encoder.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/meshcore.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/meshcore_parser.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/packets.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/parsing.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/src/meshcore/reader.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/tests/README.md +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/tests/test_ble_connection.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/tests/test_ble_pin_pairing.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/tests/test_meshcore_ble_pin.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/tests/unit/test_commands.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/tests/unit/test_events.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/tests/unit/test_path_discovery_response.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/tests/unit/test_private_key_export.py +0 -0
- {meshcore-2.3.1 → meshcore-2.3.2}/tests/unit/test_reader.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meshcore
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.2
|
|
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
|
|
@@ -79,6 +79,10 @@ class SerialConnection:
|
|
|
79
79
|
idx = data.find(b"\x3e")
|
|
80
80
|
if idx < 0: # no start of frame
|
|
81
81
|
return
|
|
82
|
+
# Discard any leading junk bytes before the actual frame marker.
|
|
83
|
+
# Some radios interleave console/debug text on the same UART, so
|
|
84
|
+
# valid companion frames may begin at an offset inside the chunk.
|
|
85
|
+
data = data[idx:]
|
|
82
86
|
self.header = data[0:1]
|
|
83
87
|
data = data[1:]
|
|
84
88
|
|
|
@@ -73,6 +73,10 @@ class TCPConnection:
|
|
|
73
73
|
idx = data.find(b"\x3e")
|
|
74
74
|
if idx < 0: # no start of frame
|
|
75
75
|
return
|
|
76
|
+
# Discard any leading junk bytes before the actual frame marker.
|
|
77
|
+
# Some radios interleave console/debug text on the same UART, so
|
|
78
|
+
# valid companion frames may begin at an offset inside the chunk.
|
|
79
|
+
data = data[idx:]
|
|
76
80
|
self.header = data[0:1]
|
|
77
81
|
data = data[1:]
|
|
78
82
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from meshcore.serial_cx import SerialConnection
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RecordingReader:
|
|
9
|
+
def __init__(self):
|
|
10
|
+
self.frames = []
|
|
11
|
+
|
|
12
|
+
async def handle_rx(self, data):
|
|
13
|
+
self.frames.append(bytes(data))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@pytest.mark.asyncio
|
|
17
|
+
async def test_handle_rx_discards_leading_junk_before_frame_start():
|
|
18
|
+
conn = SerialConnection("/dev/null", 115200)
|
|
19
|
+
reader = RecordingReader()
|
|
20
|
+
conn.set_reader(reader)
|
|
21
|
+
|
|
22
|
+
payload = b"\x00\x01\x02\x53"
|
|
23
|
+
frame = b"\x3e" + len(payload).to_bytes(2, "little") + payload
|
|
24
|
+
|
|
25
|
+
conn.handle_rx(b"junk bytes\r\n" + frame)
|
|
26
|
+
await asyncio.sleep(0)
|
|
27
|
+
|
|
28
|
+
assert reader.frames == [payload]
|
|
29
|
+
assert conn.header == b""
|
|
30
|
+
assert conn.inframe == b""
|
|
31
|
+
assert conn.frame_expected_size == 0
|
|
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
|
|
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
|