diff --git a/cmd/server/web/dist/index.html b/cmd/server/web/dist/index.html index f30ef49..a4a477c 100644 --- a/cmd/server/web/dist/index.html +++ b/cmd/server/web/dist/index.html @@ -7,7 +7,7 @@ - +
diff --git a/internal/devices/flexradio/flexradio.go b/internal/devices/flexradio/flexradio.go index 10da023..5a8f959 100644 --- a/internal/devices/flexradio/flexradio.go +++ b/internal/devices/flexradio/flexradio.go @@ -335,7 +335,11 @@ func (c *Client) handleStatus(msg string) { // Format: S0|interlock ... state=PTT_REQUESTED ... if strings.Contains(msg, "interlock") { if state, ok := statusMap["state"]; ok { - log.Printf("FlexRadio: Interlock state changed to: %s", state) + + // Update status for UI + c.statusMu.Lock() + c.lastStatus.InterlockState = state + c.statusMu.Unlock() if state == "PTT_REQUESTED" { // PTT requested - we MUST respond within 500ms! @@ -384,14 +388,13 @@ func (c *Client) createInterlock() error { // handlePTTRequest is called when FlexRadio sends PTT_REQUESTED // We MUST respond within 500ms with ready or not_ready func (c *Client) handlePTTRequest() { - log.Println("FlexRadio: 🔴 PTT REQUESTED - checking if transmit allowed...") c.interlockMu.RLock() interlockID := c.interlockID c.interlockMu.RUnlock() if interlockID == "" { - log.Println("FlexRadio: ⚠️ No interlock ID, cannot respond to PTT request!") + log.Println("FlexRadio: No interlock ID, cannot respond to PTT request!") return } @@ -402,12 +405,21 @@ func (c *Client) handlePTTRequest() { } if allowed { - log.Println("FlexRadio: ✅ Transmit ALLOWED - sending 'ready'") cmd := fmt.Sprintf("interlock ready %s", interlockID) c.sendCommand(cmd) + + // Update status immediately for UI + c.statusMu.Lock() + c.lastStatus.InterlockState = InterlockStateReady + c.statusMu.Unlock() } else { - log.Println("FlexRadio: ❌ Transmit BLOCKED - sending 'not_ready'") + log.Println("FlexRadio: Transmit BLOCKED - sending 'not_ready'") cmd := fmt.Sprintf("interlock not_ready %s", interlockID) c.sendCommand(cmd) + + // Update status immediately for UI + c.statusMu.Lock() + c.lastStatus.InterlockState = InterlockStateNotReady + c.statusMu.Unlock() } } diff --git a/web/src/components/Ultrabeam.svelte b/web/src/components/Ultrabeam.svelte index c110cea..518b5a5 100644 --- a/web/src/components/Ultrabeam.svelte +++ b/web/src/components/Ultrabeam.svelte @@ -201,7 +201,7 @@