Repository navigation
p25: fix extended-address PDU CRC-32 scope and outbound status bits - #125
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes end-to-end delivery of P25 confirmed extended-address PDU data (TMS and SNDCP/IP over EXT_ADDR). On
r05a06_devthese messages fail two ways: extended-address PDUs fail CRC-32 and get NACK'd, and even once delivered, the sending radio reports send-failed because the delivery ACK relayed back to it is missing the source LLID. Three related changes fix the path end to end.CRC-32 scope (
Assembler.cpp) — the packet-level CRC-32 was computed and checked over the wrong byte range. The correct scope is the entire PDU content stream (second header + payload + padding), everything except its own trailing 4 bytes; the stock code excluded padding from the window. Fixed bothdisassemble()(RX check) andassemble()(TX generate) so the two sides agree, and removed the now-unnecessary "move CRC after padding" step. For non-extended-address PDUssecondHeaderOffsetis 0 and padding handling is unchanged, so ordinary P25 data traffic is unaffected.Outbound status bits (
Data.cpp) —writeRF_PDU()encoded status symbols usingm_inbound, which was still set when emitting the ACK/NACK responses, retries, and local repeats generated in reply to an inbound frame. Outbound bursts therefore went out marked inbound.m_inboundis now cleared before those outbound transmissions are generated (top of the RSP branch and before the SAP switch).ACK source LLID (
Data.cpp) — twowriteRF_PDU_Ack_Response()call sites in the RF response path passed only 5 arguments, so the source LLID bound to theextendedAddressbool parameter andsrcLlIddefaulted to 0. The relayed delivery ACK went back to the originator withsrcLLId = 0, and the originating radio couldn't match it to its outstanding message — reporting send-failed despite successful delivery. Both call sites now pass the source LLID in its own argument, matching the other call sites in the file.Component(s)
Type of change
Related issues
N/A
Build & test notes
Built and tested on real hardware against two Motorola XTS2500 subscribers (RIDs 1139554 / 1139555) through a live repeater.
packetCRCFailed = 0) and the payload round-trips throughassemble().srcLLId = 0and senders reported send-failed; after, responses carry the correct source LLID (srcLLId = 1139555/1139554) and delivery succeeds.Environment
Scope of testing: conventional extended-address PDU data (TMS) only. I have not run a broader regression pass and have not tested trunking; the changes are P25 PDU-path only and by inspection shouldn't affect trunking (TSBK/TSDU and grant handling are separate paths), but I haven't confirmed that on-air.
Logs / output
Before (dev), relayed response — source LLID dropped:
OSP, response, rspClass = $00, rspType = $01, rspStatus = $05, llId = 1139555, srcLLId = 0After (this PR), relayed response — source LLID populated, delivery succeeds:
OSP, response, rspClass = $00, rspType = $01, rspStatus = $00, llId = 1139555, srcLLId = 1139554Checklist
Notes for maintainers
The three fixes all serve one goal — making confirmed extended-address TMS work end to end — but are independent and could be reviewed separately if preferred. The ACK source-LLID issue is a
r05a06_devregression: the older master call sites passed the source LLID correctly (6 args), and the current dev call sites drop it into the bool parameter (5 args); this restores the correct behavior. DMR and NXDN are untouched. Thedisassemble()change includes a diagnostic log block that prints received-vs-computed CRC on failure — happy to trim it if you'd rather keep the path lean.