fix(tci server): announce transmit permission, and log what the client sends

MSHV's PTT test does nothing against the TCI sharing server.

The initialisation block never carried TX_ENABLE. The document files it under
unidirectional control rather than initialisation, so it was missed when the
block was written from §4.1 — but its own note says it is "sent to the client
when connected", and that is the point: a client that models transmit
permission starts out assuming it may NOT transmit. Without it MSHV never even
tries, so nothing arrives to relay and there is nothing to see at either end.

Sent as true always. OpsLog is not what decides — the radio behind whichever
backend is connected does, and its refusal already travels back through SetPTT
into the log.

TX_FREQUENCY goes with it, at connect and whenever the transmit frequency
moves. It is the command a client showing "TX 14.200" reads; channel B alone
left that stale.

And every command a client sends is now logged. This is the only evidence there
will ever be about a program on someone else's machine: "the PTT test does
nothing" cannot be answered without knowing whether MSHV sent trx at all, and
in what form. Cheap — TCI is event-driven, a client speaks when the operator
does something — and capped at 200 lines per connection so one that does poll
cannot quietly fill the log.

If this was not the cause, the next report answers it in one line rather than
another round of guessing.
This commit is contained in:
2026-08-17 09:39:02 +02:00
parent 4095455e66
commit d5e25244ee
3 changed files with 59 additions and 8 deletions
+12 -4
View File
@@ -68,6 +68,10 @@ func TestInitBlockCarriesTheDocumentedInitialisationSet(t *testing.T) {
"protocol:ExpertSDR3,", "device:", "receive_only:false;", "trx_count:1;",
"channel_count:2;", "vfo_limits:", "if_limits:", "modulations_list:",
"ready;", "start;",
// Transmit permission. A client that models it starts out assuming it
// may NOT transmit, and without this never even tries — PTT does
// nothing and the server never sees a trx command at all.
"tx_enable:0,true;",
} {
if !strings.Contains(block, want) {
t.Errorf("the initialisation block is missing %q — a client would not proceed past connect", want)
@@ -183,10 +187,14 @@ func TestOnlyChangesAreSent(t *testing.T) {
}
r.freq, r.rxFreq = 14200000, 14200000
got := s.publish()
if len(got) != 2 || !strings.Contains(strings.Join(got, ""), "14200000") {
// Both channels move together on a simplex rig, and both are reported.
t.Errorf("after a QSY: %v", got)
got := strings.Join(s.publish(), "")
// Both channels move together on a simplex rig, and the transmit frequency
// has its own command besides — a client showing "TX 14.200" reads that one,
// and channel B alone leaves it stale.
for _, want := range []string{"vfo:0,0,14200000;", "vfo:0,1,14200000;", "tx_frequency:14200000;"} {
if !strings.Contains(got, want) {
t.Errorf("after a QSY the clients were not told %q — got %q", want, got)
}
}
if got := s.publish(); len(got) != 0 {
t.Errorf("the QSY was re-sent: %v", got)