telemetry

package
v0.0.0-...-03c8f45 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LowLevelProtocol        = "XtraLib.Stream"
	LowLevelProtocolVersion = "0"
)
View Source
const (
	HighLevelProtocol        = "Tacview.RealTimeTelemetry"
	HighLevelProtocolVersion = "0"
)

Variables

This section is empty.

Functions

func IsAircraft

func IsAircraft(taglist []string) bool

func IsBullseye

func IsBullseye(taglist []string) bool

func IsRelevantObject

func IsRelevantObject(taglist []string) bool

func NewClient

func NewClient(
	updateInterval time.Duration,
) *client

Types

type Client

type Client interface {
	Run(context.Context, *sync.WaitGroup) error
	Stream(context.Context, *sync.WaitGroup, chan<- sim.Started, chan<- sim.Updated, chan<- sim.Faded)
	Bullseye(coalitions.Coalition) (orb.Point, error)
	Time() time.Time
}

type ClientHandshake

type ClientHandshake struct {
	LowLevelProtocolVersion  string
	HighLevelProtocolVersion string
	Hostname                 string
	PasswordHash             string
}

func DecodeClientHandshake

func DecodeClientHandshake(packet string) (*ClientHandshake, error)

func NewClientHandshake

func NewClientHandshake(hostname string, password string) (handshake *ClientHandshake)

func (*ClientHandshake) Encode

func (h *ClientHandshake) Encode() (packet string)

type FileReader

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

func NewFileClient

func NewFileClient(
	filePath string,
	updateInterval time.Duration,
) *FileReader

func (*FileReader) Bullseye

func (c *FileReader) Bullseye(coalition coalitions.Coalition) (orb.Point, error)

func (*FileReader) Run

func (r *FileReader) Run(ctx context.Context, wg *sync.WaitGroup) error

func (*FileReader) Stream

func (c *FileReader) Stream(ctx context.Context, wg *sync.WaitGroup, starts chan<- sim.Started, updates chan<- sim.Updated, fades chan<- sim.Faded)

func (*FileReader) Time

func (c *FileReader) Time() time.Time

type HostHandshake

type HostHandshake struct {
	LowLevelProtocolVersion  string
	HighLevelProtocolVersion string
	Hostname                 string
}

func DecodeHostHandshake

func DecodeHostHandshake(packet string) (HostHandshake, error)

func (*HostHandshake) Encode

func (h *HostHandshake) Encode() (packet string)

type TelemetryClient

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

func NewTelemetryClient

func NewTelemetryClient(
	address,
	clientHostname,
	password string,
	connectionTimeout time.Duration,
	updateInterval time.Duration,
) *TelemetryClient

func (*TelemetryClient) Bullseye

func (c *TelemetryClient) Bullseye(coalition coalitions.Coalition) (orb.Point, error)

func (*TelemetryClient) Run

func (*TelemetryClient) Stream

func (c *TelemetryClient) Stream(ctx context.Context, wg *sync.WaitGroup, starts chan<- sim.Started, updates chan<- sim.Updated, fades chan<- sim.Faded)

func (*TelemetryClient) Time

func (c *TelemetryClient) Time() time.Time

Jump to

Keyboard shortcuts

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