Commit Graph

135 Commits

Author SHA1 Message Date
Wouter Bokslag
1bb79d82fe Merge branch 'main' of github.com:MidnightBlueLabs/tetra-bluestation 2026-03-20 10:10:11 +01:00
Wouter Bokslag
a427fd69fe Better SDR config debug prints
- Now prints detected SDR driver and device
- Also prints the final soapy configuration that's used
- Updated default print level to show Phy info messages
2026-03-20 09:59:17 +01:00
Manoel
7ddcd7a5f9 Pluto/Pluto+ config cleanup (#60) 2026-03-20 09:30:42 +01:00
Wouter Bokslag
9db59a9e97 Version bump to 0.5.3, formatting improvements 2026-03-19 16:00:58 +01:00
Wouter Bokslag
61601612bb Merge branch 'plutosdr' 2026-03-19 15:15:43 +01:00
Wouter Bokslag
728b821ac2 Some improvements and restructuring in time broadcast 2026-03-19 11:48:44 +01:00
wbokslag
1f15c00d85 Merge pull request #59 from wahlm/pluto-timestamp-pr
Support for original Pluto and Pluto+, refactoring of configuration code
2026-03-19 11:25:16 +01:00
Wouter Bokslag
238449af33 Some improvements and restructuring in time broadcast 2026-03-19 10:56:19 +01:00
Wouter Bokslag
a7f598a19a Merge branch 'broadcast', version 0.5.2 2026-03-19 10:26:25 +01:00
Wouter Bokslag
fdeabbbf4c MLE and LLC refactors
- MLE now sends TL-UNITDATA for certain unacknowledged frames
- LLC now implements handling of TL-UNITDATA for sending BL-UDATA
- MLE broadcast functionality to separate file
- Various other fixes, cleanups and improvement
2026-03-19 10:05:29 +01:00
Wouter Bokslag
58a95dd641 Redesigned, improved LLC logic
Now features fully fledged retransmission support.
2026-03-18 22:29:04 +01:00
Mark Wahl
0ec39150ff improve configuration doc 2026-03-16 16:41:16 +01:00
Mark Wahl
35e3f2fb67 cleanup 2026-03-15 21:27:22 +01:00
Mark Wahl
b10805e8c0 configurable pluto settings 2026-03-15 15:16:29 +01:00
Mark Wahl
160d6ce3db set pluto default args 2026-03-14 22:29:58 +01:00
Mark Wahl
7568b612b3 Merge remote-tracking branch 'tejeez/soapysettings' into pluto-timestamp-tejeez 2026-03-14 22:08:40 +01:00
Tatu Peltola
11b3a1dcce Put use_get_hardware_time in SdrSettings, some cleanup 2026-03-14 20:41:59 +02:00
Mark Wahl
95e6cfdba3 add sane defaults 2026-03-14 18:20:11 +01:00
Mark Wahl
affe333532 USB needs timestamp_every 1500 2026-03-14 18:20:11 +01:00
Mark Wahl
fe4826cc7c more doc in example config 2026-03-14 18:20:11 +01:00
Mark Wahl
61dc0cbee0 fix PlutoDto 2026-03-14 18:20:11 +01:00
Mark Wahl
6b04797908 support for pluto+ with timestamp 2026-03-14 18:20:11 +01:00
Wouter Bokslag
b1834fef45 Prevent crash when out-of-spec large SDS comes in over Brew
The stack will now detect an SDS is too long to be transmitted over the air, and instead issue a warning on the console output and drop the offending sds.
2026-03-14 14:29:44 +01:00
Tatu Peltola
7d0e5dd3b1 Refactor SDR settings 2026-03-14 15:22:18 +02:00
proxiboi69
56c8882334 Add D-NWRK-BROADCAST time broadcasting (#38)
* Add D-NWRK-BROADCAST time broadcasting
- Broadcast UTC time and local offset once per hyperframe (~61s)
- Add configurable timezone setting to cell config
- Use GSSI 0xFFFFFF broadcast address per clause 23.4.1.2.1
- Include number_of_ca_neighbour_cells field with value 0
- Skip first broadcast at startup before any radios have registered
- Remove incorrect trailing M-bit from D-NWRK-BROADCAST PDU (MLE PDUs don't use M-bits, per Annex E.2.1)
- Validate timezone at config parse and offset D-NWRK-BROADCAST timing
2026-03-13 16:37:40 +01:00
Wouter Bokslag
75660c1fdc Added config options for enabling/disabling SDS over Brew 2026-03-13 15:52:50 +01:00
proxiboi69
f88824bf3b Fix subscriber Register/Deregister not being sent to Brew when no groups are affiliated (#53) 2026-03-13 15:11:17 +01:00
Wouter Bokslag
82d1c4cc4a Small improved with regards to TS1 transmission of sds data 2026-03-13 11:23:36 +01:00
proxiboi69
9eff98194d SDS fixes and Brew compatibility improvements (#50)
* Fix downlink signaling scheduled on wrong timeslot for Brew SDS
* Forward U-STATUS to Brew when destination is not locally registered
* Zero-fill SHORT_TRANSFER number field instead of duplicating destination ISSI
* Use REREGISTER instead of REGISTER for already-registered subscribers on Brew
* Convert SDS-TL short report to Type4 for Brew and improve SDS_REPORT comment and logging
2026-03-13 09:59:41 +01:00
Wouter Bokslag
2aa2a34d78 Removed obsolete TM report functionality, now implemented using RxReceipts 2026-03-11 11:16:38 +01:00
Wouter Bokslag
b3d13b3bf0 Cleaned up verbose brew logging
Reduced tracing print levels for various messages from info to debug
2026-03-11 10:20:13 +01:00
Wouter Bokslag
1b4dc0421d Added parsing for U-STATUS and D-STATUS pre-coded status field 2026-03-11 10:05:39 +01:00
proxiboi69
d5ec440a46 Add SDS delivery report and fix MAC-END-HU reserved length handling (#49)
* Add SDS_REPORT delivery ack for incoming Brew SDS and fix test_sds_bs compilation

* Downgrade MAC-END-HU reserved length indication 0 from warning to debug
2026-03-11 08:52:34 +01:00
Wouter Bokslag
db9992f8af Refactors in SDS handling code
* SDS user defined data types now enums
* Improved state SubscriberRegistry
* Small printing and formatting fixes
2026-03-10 19:38:01 +01:00
proxiboi69
59c5c28096 SDS reliable delivery with group support and LLC retransmission (#48)
* SDS implementation: bug fixes, group delivery, U-STATUS forwarding, tests

- Fix D-SDS-DATA CPTI extension condition to match ETSI 14.7.1.10
- Add registration check in rx_sds_from_brew to drop SDS for unregistered ISSIs
- Add SubscriberRegistry with has_group_members() for group SDS routing
- Add group-addressed SDS delivery (single GSSI-addressed D-SDS-DATA PDU)
- Route U-STATUS to SDS subentity; forward as D-STATUS to local destination
- Brew→local SDS always uses SDTI=3 (Brew sends SDS Type 4 per protocol spec)
- Never forward group SDS to Brew, only individually-addressed SDS
- Add TetraPack SDS service ISSI whitelist (200999, 262993)
- Add PDU round-trip tests for D-SDS-DATA, U-SDS-DATA (8 tests)
- Add Brew protocol tests for SHORT_TRANSFER/SDS_TRANSFER (3 tests)
- Add SubscriberRegistry unit tests (4 tests)
- Add SDS integration tests: local delivery, Brew forward, group, U-STATUS (7 tests)

* LLC: ETSI-compliant BL-DATA retransmission for reliable SDS delivery

- Register expected ACK for BL-DATA (was missing — only BL-ADATA tracked)
- Store retransmission buffer to allow re-sending the same PDU on timeout
- Retransmit up to 3 times (N.252=3) with 48-timeslot timeout (T.251)
- Fix process_incoming_ack: two-pass scan — exact N(R) match first,
  then mismatch handling per ETSI 22.3.2.3(k)
- Fix process_incoming_ack: match by SSI only (not timeslot) so ACKs
  for retransmitted PDUs are matched correctly
- Clean up stale BL-ADATA entries on timeout (previously leaked forever)
- Fix tick_end return value to reflect retransmission activity
2026-03-10 17:34:34 +01:00
proxiboi69
345d6a68fd Add UL inactivity timeout to detect stuck/disappeared radios mid-TX (#36)
- Add UlInactivityTimeout variant to CallControl SAP enum
- UMAC: track last UL voice frame time per timeslot (last_ul_voice)
- UMAC: check_ul_inactivity fires after ~18s of silence on active UL circuit
- UMAC: manage timer lifecycle on circuit open/close, floor grant/release, call end
- UMAC: refresh timer on DL voice (TmdCircuitDataReq) to avoid false positives on network-originated Brew calls
- CMCE: handle_ul_inactivity_timeout forces TX ceased + hangtime, mirrors rx_u_tx_ceased logic
- Brew: ignore UlInactivityTimeout (UMAC→CMCE only, Brew uses FloorReleased)
- BsChannelScheduler: expose is_hangtime() for inactivity check
2026-03-10 10:26:17 +01:00
proxiboi69
f87c3fee91 Fix FACCH stealing random_access_flag for SSI-addressed MAC-RESOURCE (#41) 2026-03-10 10:13:22 +01:00
Wouter Bokslag
ed74e509c5 Merge branch 'main' of github.com:MidnightBlueLabs/tetra-bluestation 2026-03-10 10:11:50 +01:00
Wouter Bokslag
e79af2dce0 Improvements in scheduler 2026-03-10 10:11:24 +01:00
proxiboi69
e41b86c74c Update Brew default port to 443 and username to SSID (#43) 2026-03-10 08:45:08 +01:00
Wouter Bokslag
f4617ceedc Added read_bits_into_slice() method for BitBuffer 2026-03-10 08:41:51 +01:00
proxiboi69
62594acae4 Per-radio ISSIs with TetraPack safety filtering; MM improvements (#32)
* Per-radio ISSIs with TetraPack safety filtering; MM improvements

- Version to 0.4.9
- Send per-radio REGISTER/DEREGISTER/AFFILIATE/DEAFFILIATE with individual ISSIs
- Add TetraPack ISSI filter: only exactly 7-digit ISSIs sent over WS
- Restrict GSSI <= 90 filter to TetraPack only
- Filter GROUP_TX forwarding for non-routable source ISSIs
- Remove Brew ISSI config field and initial BTS registration
- Rename is_brew_routable to is_brew_gssi_routable
- MM: auto-register unknown MS on group attach
- MM: send D-LOCATION UPDATE COMMAND to returning radios for group report
- MM: fix group_identity_attachment_lifetime to ETSI default
- MM: rename TemporaryRegistration to MigratingLocationUpdating
2026-02-27 13:28:39 +01:00
Wouter Bokslag
0564164693 Added support for Uplink 2nd slot stealing
Co-authored-by: misadeks <mihajlo.krunic@hotmail.com>
2026-02-26 20:38:13 +01:00
Wouter Bokslag
dda4214ccb Removed erroneous config debug print 2026-02-26 15:59:58 +01:00
Wouter Bokslag
9497618dfe Merge branch 'tx_receipts' 2026-02-26 15:02:34 +01:00
proxiboi69
f53a302757 Version bump to 0.4.7, add unit test for receipt-based D-SETUP late-entry throttling 2026-02-26 14:51:51 +01:00
proxiboi69
e026da7498 Remove unused TxReceipt::new() calls from initial D-SETUP sends 2026-02-26 14:15:27 +02:00
proxiboi69
77e0070e38 Fix late-entry D-SETUP interval check by comparing in frames instead of timeslots 2026-02-26 13:12:53 +02:00
proxiboi69
e52ce524f2 Implement receipt-based D-SETUP retransmission throttling
Replace mcch_queue_depth heuristic with per-message TxReceipt tracking.
CMCE checks is_in_final_state() before queuing re-sends, avoiding MCCH
flooding without mutex overhead of polling StackState every tick.

- Store Option<TxReceipt> alongside cached D-SETUPs per call_id
- Initial send stores None receipt to avoid throttling ETSI backup send
- Fresh receipt/reporter pair created for each re-send in tick_start
- Remove mcch_queue_depth from StackState/UMAC, fix interval to 5s

Known limitations (outside CMCE scope):
- mark_discarded() is never called in UMAC, so Discarded state is
  unreachable. A Drop impl for TxReporter would close this gap.
- Reporter dropped without transitioning leaves receipt Pending forever,
  blocking re-sends until circuit expiry. Not practical today since
  circuit close also drops the receipt.
2026-02-26 12:36:55 +02:00
proxiboi69
4ed99b6a38 Merge feature/late-entry-dsetup-throttle into tx_receipts
Bring in the 5s late-entry D-SETUP interval fix and return->continue
bug fix from the feature branch. Drop the mcch_queue_depth heuristic
throttle (StackState field, UMAC publish, CMCE check, dl_queue_depth)
in favor of the tx_receipt-based approach on this branch.
2026-02-26 12:10:03 +02:00