firmware: harden XIAO RS485 telemetry

This commit is contained in:
2026-07-26 18:01:58 -06:00
parent 8c2375d402
commit 35c0721b47
6 changed files with 50 additions and 6 deletions
+5
View File
@@ -19,6 +19,9 @@ def test_transport_contract():
assert "serializeJson(doc, Serial)" in text
assert 'createNestedObject("nmea")' in text
assert 'nmea["sentences_passed"]' in text
assert 'doc["boot_id"]' in text
assert 'doc["frame_sequence"]' in text
assert "measureJson(doc)" in text
for field in ["linear_acceleration_mps2", "angular_velocity_rads", "gravity_mps2", "stability", "hdop", "location_age_ms"]:
assert field in text
@@ -67,6 +70,8 @@ def test_rs485_echo_cannot_starve_sensor_loop():
assert "discardCommandUntilNewline" in transport
assert 'type == "sensor_status"' in transport
assert 'publishCalibrationResult(serial, "invalid_json")' not in transport
assert "drainTransmitEcho(serial)" in transport
assert transport.index("drainTransmitEcho(serial)") < transport.index("digitalWrite(RS485_DE_PIN, LOW);", transport.index("void sendJson"))
def test_node_does_not_take_cargo_or_ble_authority():
combined = "\n".join(p.read_text() for p in NODE.glob("*.*"))