mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 09:07:27 -05:00
Some radios set the encryption flag in the service options of the LDU1 Group Voice Channel User link control while transmitting clear voice; the HDU and LDU2 encryption sync parameters report ALGID 0x80 (unencrypted) for the same call. Example (CoMIRS Boston, TG 2217, valid LCs from several radios): HDU TALKGROUP:2217 UNENCRYPTED LDU1 GROUP VOICE CHANNEL USER FM:64008 TO:2217 SERVICE OPTIONS:PRI4 ENCRYPTED CIRCUIT LDU2 UNENCRYPTED P25P1DecoderState broadcast State.ENCRYPTED for each such LDU1 and State.CALL for each LDU2, so the channel state flapped between CALL and ENCRYPTED (and on upstream, where ENCRYPTED cannot change back to CALL, the call stays muted). Track the per-call encryption state from the HDU header and LDU2 algorithm ID (reset at TDU/TDULC). When it is known to be unencrypted, clear the encryption flag on the LC service options before using them for the channel state and traffic channel call event. Genuinely encrypted calls are unaffected, and when the algorithm ID is not yet known (late entry before the first LDU2) the LC service options are used as before. Adds VoiceServiceOptions.createUnencrypted(ServiceOptions) to copy service options with only the encryption flag cleared. Verified by driving P25P1DecoderState with HDU/LDU1/LDU2/TDU sequences reproducing the field logs: state events go from C C C E C E C to all CALL; encrypted calls (ALGID 0x84) still report ENCRYPTED throughout. Claude-Session: https://claude.ai/code/session_01FRdfTvgcdBvwkipdfP8qxy (cherry picked from commit 2ef3c9d02176871577d38f8afd0fa3c32fb92a58) Co-authored-by: Claude <noreply@anthropic.com>