This commit is contained in:
2026-01-12 22:34:14 +01:00
parent 6b5508802a
commit 4f484b0091
3 changed files with 20 additions and 8 deletions

View File

@@ -7,7 +7,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
<script type="module" crossorigin src="/assets/index-ghAyyhf_.js"></script>
<script type="module" crossorigin src="/assets/index-DfHlyr4L.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-oYZfaWiS.css">
</head>
<body>

View File

@@ -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()
}
}

View File

@@ -201,7 +201,7 @@
<div class="auto-track-controls">
<label class="toggle-label">
<input type="checkbox" bind:checked={autoTrackEnabled} on:change={updateAutoTrack} />
<span>Enable Auto-Track from Radio</span>
<span>Enable Auto-Track from Tuner</span>
</label>
<div class="threshold-group">