wsjtxudp

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2025 License: MIT Imports: 5 Imported by: 0

README

wsjtx-udp

Simple Golang library to parse (for now) WSJT-X UDP packets.

Documentation

Documentation for the WSJT-X UDP format can be found here.

This library contains a parser to ease the parsing of WSJT-X UDP packets for Golang. An example UDP server is provided under the example/ directory.

TODO

  • Add support for outgoing messages (commands sent to WSJT-X)
  • Add tests
  • Make official build

WSJT-X

WSJT-X is a software radio for amateur radio operators. For more information, see WSJT-X.

Documentation

Index

Constants

View Source
const (
	WSJTX_MAGIC_NUMBER uint32 = 0xadbccbda
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClearPayload

type ClearPayload struct {
	ID     string `json:"id"`
	Window uint8  `json:"window"`
}

type ClosePayload

type ClosePayload struct {
	ID string `json:"id"`
}

type DecodePayload

type DecodePayload struct {
	ID             string  `json:"id"`
	New            bool    `json:"new"`
	Time           uint32  `json:"time"`
	SNR            int32   `json:"snr"`
	DeltaTime      float64 `json:"deltaTime"`
	DeltaFrequency uint32  `json:"deltaFrequency"`
	Mode           string  `json:"mode"`
	Message        string  `json:"message"`
	LowConfidence  bool    `json:"lowConfidence"`
	OffAir         bool    `json:"offAir"`
}

type HeartbeatPayload

type HeartbeatPayload struct {
	ID              string `json:"id"`
	MaxSchemaNumber uint32 `json:"maxSchemaNumber"`
	Version         string `json:"version"`
	Revision        string `json:"revision"`
}

type LoggedADIFPayload

type LoggedADIFPayload struct {
	ID   string `json:"id"`
	ADIF string `json:"adif"`
}

type QSOLoggedPayload

type QSOLoggedPayload struct {
	ID                  string    `json:"id"`
	DateTimeOff         time.Time `json:"dateTimeOff"`
	DXCall              string    `json:"dxCall"`
	DXGrid              string    `json:"dxGrid"`
	TxFrequency         uint64    `json:"txFrequency"`
	Mode                string    `json:"mode"`
	ReportSent          string    `json:"reportSent"`
	ReportReceived      string    `json:"reportReceived"`
	TxPower             string    `json:"txPower"`
	Comments            string    `json:"comments"`
	Name                string    `json:"name"`
	DateTimeOn          time.Time `json:"dateTimeOn"`
	OperatorCall        string    `json:"operatorCall"`
	MyCall              string    `json:"myCall"`
	MyGrid              string    `json:"myGrid"`
	ExchangeSent        string    `json:"exchangeSent"`
	ExchangeReceived    string    `json:"exchangeReceived"`
	ADIFPropagationMode string    `json:"ADIFPropagationMode"`
}

type StatusPayload

type StatusPayload struct {
	ID                   string `json:"id"`
	DialFrequency        uint64 `json:"dialFrequency"`
	Mode                 string `json:"mode"`
	DxCall               string `json:"dxCall"`
	Report               string `json:"report"`
	TxMode               string `json:"txMode"`
	TxEnabled            bool   `json:"txEnabled"`
	Transmitting         bool   `json:"transmitting"`
	Decoding             bool   `json:"decoding"`
	RxDF                 uint32 `json:"rxDF"`
	TxDF                 uint32 `json:"txDF"`
	DECall               string `json:"deCall"`
	DEGrid               string `json:"deGrid"`
	DXGrid               string `json:"dxGrid"`
	TxWatchdog           bool   `json:"txWatchdog"`
	SubMode              string `json:"subMode"`
	FastMode             bool   `json:"fastMode"`
	SpecialOperationMode uint8  `json:"specialOperationMode"`
	FrequencyTolerance   uint32 `json:"frequencyTolerance"`
	TRPeriod             uint32 `json:"trPeriod"`
	ConfigurationName    string `json:"configurationName"`
	TxMessage            string `json:"txMessage"`
}

type WSJTXMessage

type WSJTXMessage struct {
	Header  WSJTXMessageHeader `json:"header"`
	Payload interface{}        `json:"payload"`
}

type WSJTXMessageHeader

type WSJTXMessageHeader struct {
	Magic   uint32       `json:"magic"`
	Schema  uint32       `json:"schema"`
	MsgType WSJTXMsgType `json:"msgType"`
}

type WSJTXMsgType

type WSJTXMsgType uint32
const (
	Heartbeat WSJTXMsgType = iota
	Status
	Decode
	Clear
	Reply
	QSOLogged
	Close
	Replay
	HaltTx
	FreeText
	WSPRDecode
	Location
	LoggedADIF
	HighlightCallsign
	SwitchConfiguration
	Configure
	AnnotationInfo
)

func (WSJTXMsgType) String

func (mt WSJTXMsgType) String() string

type WSJTXParser

type WSJTXParser struct {
	// contains filtered or unexported fields
}

func (*WSJTXParser) Parse

func (p *WSJTXParser) Parse(raw []byte) (WSJTXMessage, error)

type WSPRDecodePayload

type WSPRDecodePayload struct {
	ID        string  `json:"id"`
	New       bool    `json:"new"`
	Time      uint32  `json:"time"`
	SNR       int32   `json:"snr"`
	DeltaTime float64 `json:"deltaTime"`
	Frequency uint64  `json:"frequency"`
	Drift     int32   `json:"drift"`
	Callsign  string  `json:"callsign"`
	Grid      string  `json:"grid"`
	Power     int32   `json:"power"`
	OffAir    bool    `json:"offAir"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL