Skip to content

Commit 65ca5e7

Browse files
committed
Add R3AKT capability announce info
1 parent b5e2b81 commit 65ca5e7

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

reticulum_telemetry_hub/reticulum_server/__main__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,6 +2388,11 @@ def _derive_announce_capabilities(self) -> list[str]:
23882388
):
23892389
caps.append("topic_broker")
23902390
caps.append("group_chat")
2391+
if (
2392+
getattr(self, "mission_sync_router", None) is not None
2393+
and getattr(self, "checklist_sync_router", None) is not None
2394+
):
2395+
caps.append("r3akt")
23912396
if getattr(self, "tel_controller", None) is not None:
23922397
caps.append("telemetry_relay")
23932398
if getattr(self, "api", None) is not None:

reticulum_telemetry_hub/reticulum_server/announce_capabilities.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
CAPABILITY_PRIORITY = [
2323
"topic_broker",
2424
"group_chat",
25+
"r3akt",
2526
"telemetry_relay",
2627
"attachments",
2728
"tak_bridge",

tests/reticulum_server/test_announce_capabilities.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,29 @@ def _announce(*, app_data=None, **_kwargs):
164164
decoded_caps = encoder.decode(capability_payload)
165165
assert decoded_caps["app"] == "rch"
166166
assert decoded_caps["schema"] == 1
167+
assert "r3akt" in decoded_caps["caps"]
167168
finally:
168169
hub.shutdown()
169170

170171

172+
173+
174+
def test_derive_announce_capabilities_only_advertises_r3akt_with_both_routers() -> None:
175+
hub = ReticulumTelemetryHub.__new__(ReticulumTelemetryHub)
176+
hub.command_manager = object()
177+
hub.api = object()
178+
hub.tel_controller = object()
179+
hub.tak_connector = None
180+
hub.mission_sync_router = object()
181+
hub.checklist_sync_router = object()
182+
183+
assert "r3akt" in hub._derive_announce_capabilities()
184+
185+
hub.checklist_sync_router = None
186+
187+
assert "r3akt" not in hub._derive_announce_capabilities()
188+
189+
171190
def test_send_announce_emits_propagation_aspect_when_enabled(tmp_path):
172191
hub = ReticulumTelemetryHub("Announcer", str(tmp_path), tmp_path / "identity")
173192
propagation_calls: list[bool] = []

0 commit comments

Comments
 (0)