Skip to content

Commit

Permalink
Stub out Clear
Browse files Browse the repository at this point in the history
  • Loading branch information
xylo04 committed Oct 31, 2020
1 parent df807b4 commit 77079f5
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions wsjtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package wsjtx

import (
"encoding/binary"
"fmt"
"github.com/leemcloughlin/jdn"
"log"
"math"
Expand Down Expand Up @@ -187,6 +188,7 @@ const BufLen = 1024

type Server struct {
conn *net.UDPConn
id string
}

func MakeServer() Server {
Expand All @@ -197,12 +199,30 @@ func MakeServer() Server {
check(err)
conn, err := net.ListenMulticastUDP("udp", nil, addr)
check(err)
return Server{conn}
return Server{conn, "WSJT-X"}
}

func (s *Server) Clear() {
func (s *Server) Clear(bandActivity bool, rxFrequency bool) error {
if !bandActivity && !rxFrequency {
return nil
}
var window uint8
if bandActivity && rxFrequency {
window = 2
} else if bandActivity {
window = 0
} else if rxFrequency {
window = 1
}

msg := ClearMessage{
Id: s.id,
Window: window,
}
fmt.Printf("Pretend I'm sending Clear:%v", msg)
// TODO
//s.conn.Write();
return nil
}

// Goroutine which will listen on a UDP port for messages from WSJT-X. When heard, the messages are
Expand Down

0 comments on commit 77079f5

Please sign in to comment.