update working

This commit is contained in:
2025-08-21 18:02:49 +02:00
parent d988e50f0d
commit 2815ea6ea0
2 changed files with 20 additions and 5 deletions

View File

@@ -286,11 +286,14 @@ func (fc *FlexClient) ReadLine() {
Log.Errorf("could not find spot by flex spot number in database: %s", err) Log.Errorf("could not find spot by flex spot number in database: %s", err)
} }
msg := fmt.Sprintf(`To ALL de %s <%s> : Clicked on "%s" at %s`, Cfg.General.Callsign, spot.UTCTime, spot.DX, spot.FrequencyHz) // Sending the callsign to Log4OM
if len(fc.TCPServer.Clients) > 0 { SendUDPMessage("<CALLSIGN>" + spot.DX)
fc.MsgChan <- msg
Log.Infof("%s clicked on spot \"%s\" at %s", Cfg.General.Callsign, spot.DX, spot.FrequencyMhz) // msg := fmt.Sprintf(`To ALL de %s <%s> : Clicked on "%s" at %s`, Cfg.General.Callsign, spot.UTCTime, spot.DX, spot.FrequencyHz)
} // if len(fc.TCPServer.Clients) > 0 {
// fc.MsgChan <- msg
// Log.Infof("%s clicked on spot \"%s\" at %s", Cfg.General.Callsign, spot.DX, spot.FrequencyMhz)
// }
} }
// Status when a spot is deleted // Status when a spot is deleted

View File

@@ -1,7 +1,9 @@
package main package main
import ( import (
"fmt"
"log" "log"
"net"
"os" "os"
"os/signal" "os/signal"
"strconv" "strconv"
@@ -56,3 +58,13 @@ func CheckSignal(TCPClient *TCPClient, TCPServer *TCPServer, FlexClient *FlexCli
os.Exit(0) os.Exit(0)
} }
} }
func SendUDPMessage(message string) {
conn, err := net.Dial("udp", "127.0.0.1:2241")
if err != nil {
fmt.Printf("Some error %v", err)
return
}
conn.Write([]byte(message))
conn.Close()
}