Speak protocol 3.0 and fall back to 2.0 only when that is the reflector's maximum.

A reflector that has moved to 3.0 will not accept a station that always announces 2.0, and a 2.x reflector still needs one explicit plaintext session.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-07 14:24:00 +02:00
co-authored by Cursor
parent 0930d4b727
commit 3d1a2a1669
24 changed files with 3180 additions and 244 deletions
+19 -1
View File
@@ -24,6 +24,7 @@ type State struct {
Detail string `json:"detail"`
Callsign string `json:"callsign"`
TalkGroup int `json:"talkGroup"`
Protocol string `json:"protocol"`
Talker string `json:"talker"`
Transmitting bool `json:"transmitting"`
}
@@ -39,13 +40,27 @@ type Station struct {
buttonHeld bool
spaceHeld bool
fatal string
retryReason string
protocol string
remoteTalker string
roomBusy bool
audioHeard bool
lastAudio time.Time
flushWaiting bool
flushAt time.Time
rxSeq uint16
secure bool
udpWait bool
ivPrefix []byte
udpKey []byte
rxCounter uint32
txCounter uint32
mic []int16
play []int16
clientID uint16
seq uint16
udp *net.UDPConn
udpPeer *net.UDPAddr
lastUDPSend time.Time
enc *opus.Encoder
dec *opus.Decoder
@@ -73,7 +88,9 @@ func New(opt Options) (*Station, error) {
clock = wallClock{}
}
detail := "Idle"
if cfg.logNotice != "" {
if cfg.certFatal != "" {
detail = cfg.certFatal
} else if cfg.logNotice != "" {
detail = cfg.logNotice
}
s := &Station{
@@ -82,6 +99,7 @@ func New(opt Options) (*Station, error) {
wake: make(chan struct{}, 1),
logPath: cfg.logPath,
logNotice: cfg.logNotice,
fatal: cfg.certFatal,
state: State{
Connection: "Disconnected",
Detail: detail,