Commit Graph

120 Commits

Author SHA1 Message Date
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
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
Wouter Bokslag
76075bb720 Updated unit tests, improvements to testing framework 2026-02-26 10:07:32 +01:00
Wouter Bokslag
52fac5d511 Large config file parsing refactor, also ensured all fields actually affect stack 2026-02-26 00:00:37 +01:00
Wouter Bokslag
d52eb57537 Added LLC constants and timers from Appendix A.1 and A.2 2026-02-25 21:34:01 +01:00
Wouter Bokslag
0fe7bb327a Added MS reception acknowledgement support
Llc now uses TxReporter (if present) to signal TxState::Acknowledge,
upon reception of a BL-ACK or BL-ADATA for a known previously send
message. This state change can in turn be picked up by the associated
TxReceipt held by Mm, Cmce or Sndcp.
2026-02-25 20:45:02 +01:00
Wouter Bokslag
c6a141a7b9 Implemented tx acknowledgement in Umac 2026-02-25 20:04:37 +01:00
Wouter Bokslag
f25aa07701 Added foundations for message tx and reception acknowledgements 2026-02-25 17:32:45 +01:00
proxiboi69
5be58a6389 Merge branch 'MidnightBlueLabs:main' into feature/late-entry-dsetup-throttle 2026-02-25 17:52:11 +02:00
Wouter Bokslag
0863985c0d Added support for CMCE DisconnectType enum values 2026-02-25 16:40:34 +01:00
proxiboi69
d41f0c1779 Implement U-DISCONNECT handler, downgrade null PDU warning
- Handle U-DISCONNECT per ETSI 14.5.2.3.1: call owner tears down call, non-call owner rejected with D-RELEASE cause=8
- Set call_ownership=true in D-CONNECT for calling MS (ETSI 14.8.4)
- Pass disconnect_cause through release_call/build_d_release instead of hardcoding cause=13
- Remove unused send_d_connect (superseded by inline D-CONNECT in rx_u_setup)
- Fix misleading null PDU debug message to log actual remaining bits
2026-02-25 13:41:11 +02:00
proxiboi69
0d1f2b56cb Throttle late-entry D-SETUP retransmissions based on MCCH load
- Fix late-entry interval from 20s to 5s (5*18*4 = 360 timeslots)
- Suppress late-entry D-SETUP when MCCH (TS1) has queued signalling
- Expose MCCH queue depth via StackState for cross-entity visibility
- Add dl_queue_depth() to BsChannelScheduler, write it each tick
- Fix return -> continue bug in cc_bs tick_start SendDSetup handling
2026-02-24 17:51:44 +02:00
Wouter Bokslag
54bd6241e9 Merge branch 'pr19' 2026-02-24 15:49:54 +01:00
Wouter Bokslag
9d16d5c300 Improved Stack <-> Brew gating, some refactors 2026-02-24 15:47:35 +01:00
Wouter Bokslag
904878832a Removed brew.blacklist again, simplified brew.whitelist 2026-02-24 14:18:45 +01:00
Wouter Bokslag
6f3f6ca9a2 Added brew call ssi range restrictions
Added checks to restrict brew calls to whitelisted / non-blacklisted ssi ranges
Updated example config
2026-02-24 13:54:25 +01:00
Wouter Bokslag
d0e306cb78 Optimized out redundant BrewConfig struct
Struct contents were nearly identical to CfgBrew from config.
Removed BrewConfig and updating passing config to Brew entity
2026-02-23 17:15:52 +01:00