fix(udp): send the structured QSO Logged too, not only the ADIF one

The ADIF datagram reached Logger32's socket and still nothing appeared in its
log. WSJT-X sends TWO messages for every contact — QSO Logged (type 5), the
structured one, and Logged ADIF (type 12) — and receivers differ on which they
read: MacLoggerDX takes the structured one by default and offers the ADIF as
an option. We were sending only the half Logger32 does not use.

Both now go out on that row, in WSJT-X's own order. Nothing double-logs: any
receiver built for WSJT-X already sees both from the real thing.

Type 5 is read positionally, so the field order is pinned by a test against
NetworkMessage.hpp — one field out of place shifts every one after it and the
receiver files nonsense without complaining. QDateTime is Qt's own encoding:
Julian day, milliseconds since midnight, then the time spec, which is sent as
UTC (1) because a spec of 0 would have the receiver re-read the contact in its
own zone. The Julian arithmetic is checked against known values; a day out
there files every QSO on the wrong date.
This commit is contained in:
2026-08-15 00:55:24 +02:00
parent d95c998081
commit dc14990b44
5 changed files with 252 additions and 11 deletions
+24 -7
View File
@@ -103,15 +103,32 @@ func (m *Manager) EmitLoggedADIF(adif string) {
}
}
// EmitLoggedADIFWSJT sends the same record wrapped as a WSJT-X "Logged ADIF"
// datagram, for receivers that speak that interface rather than plain text —
// Logger32's additional UDP sockets among them.
func (m *Manager) EmitLoggedADIFWSJT(adifRec string) {
if strings.TrimSpace(adifRec) == "" {
// EmitLoggedQSOWSJT announces a logged contact on the WSJT-X interface, for
// receivers that speak it rather than plain text — Logger32's additional UDP
// sockets among them.
//
// BOTH messages go out, "QSO Logged" (5) then "Logged ADIF" (12), because that
// is exactly what WSJT-X does for every contact. Which one a receiver takes is
// its own business: MacLoggerDX reads the structured one by default and offers
// the ADIF as an option, and sending only the ADIF is why a QSO reached
// Logger32's socket and never reached its log. Anything built for WSJT-X
// already sees both from the real thing, so neither is a surprise and nothing
// logs the contact twice.
func (m *Manager) EmitLoggedQSOWSJT(q LoggedQSO, adifRec string) {
rows := m.Outbound(ServiceWSJTLog)
if len(rows) == 0 {
return
}
for _, c := range m.Outbound(ServiceWSJTLog) {
m.sendTo(c, BuildWSJTLoggedADIF("OpsLog", adifRec))
qsoPkt := BuildWSJTQSOLogged("OpsLog", q)
var adifPkt []byte
if strings.TrimSpace(adifRec) != "" {
adifPkt = BuildWSJTLoggedADIF("OpsLog", adifRec)
}
for _, c := range rows {
m.sendTo(c, qsoPkt)
if adifPkt != nil {
m.sendTo(c, adifPkt)
}
}
}