- Lock-protect `get_state` and `_set_state` to prevent data race
between Flask and asyncio daemon threads
- Atomically check-and-set CONNECTING guard in `connect()` to close
TOCTOU window between concurrent Flask threads
- Push status events outside the lock in both `_set_state` and
`connect()` to avoid potential deadlock
- Add TestMeshcoreContact, TestMeshcoreClientStateMachine tests
covering to_dict keys, queue push on state change, message append
and 500-item cap (9 -> 13 tests)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements utils/meshcore.py with all dataclasses (MeshcoreMessage,
MeshcoreNode, MeshcoreContact, MeshcoreTelemetry, MeshcoreTraceroute),
connection configs (SerialConfig, TCPConfig, BLEConfig), ConnectionState
enum, serial port discovery, and the MeshcoreClient singleton skeleton.
Adds tests/test_meshcore_client.py covering all dataclasses, availability
check, and state enum (8/8 tests passing).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>