mirror of
https://github.com/misadeks/tetra-bluestation.git
synced 2026-09-01 16:48:32 +00:00
Implements the standalone MS-initiated group attach/detach procedure so a UI can change talkgroups at runtime instead of only using the config set, strictly per ETSI TS 100 392-2 V3.10.1. G2 (TX): on a TNMM-ATTACH DETACH GROUP IDENTITY request (Table 15.1), once registered, build and send a U-ATTACH/DETACH GROUP IDENTITY PDU (cl. 16.9.3.1) over the acknowledged basic link: report = not-report-request, amendment vs detach-all mode, one Group identity uplink per GSSI (class of usage per cl. 16.10.6 Table 16.32, or detachment reason per cl. 16.10.21). Start T353 (cl. 16.11.1.3, 10 s). Single operation outstanding; rejected if not registered. G3 (RX): on D-ATTACH/DETACH GROUP IDENTITY ACKNOWLEDGEMENT (cl. 16.9.2.2), stop T353, reconcile the attached-group set from the SwMI-confirmed downlink elements (detach-all replaces; amendment adds/removes), and push it to the MLE via MLE-IDENTITIES so the MAC downlink filter matches (cl. 23.4.1.2.1). On T353 expiry the op is treated as failed (cl. 16.8.5). G4 (confirm + UI): emit a TNMM-ATTACH DETACH GROUP IDENTITY confirm (Table 15.1, GTSIs only per cl. 16.8.2) to the user application; document the request/confirm JSON shapes and add a live talkgroup-switch example to the MS interface README + reference client. Tests: +7 mm_ms unit tests (unregistered reject, TX PDU round-trips through the BS parser + T353 armed, ACK reconcile + MLE-IDENTITIES + confirm, amendment detach, detach-all replace, second-op-while-pending reject, T353 expiry failure). 196 lib + all integration suites green; no BS air-interface change. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>