ctrl

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AIModesByName = map[string]AIMode{
	"TMO": TMO,
	"DMO": DMO,
}

AIModesByName maps all supported operating modes by their string representation

Functions

func RequestBatteryCharge

func RequestBatteryCharge(ctx context.Context, requester tetra.Requester) (int, error)

RequestBatteryCharge reads the current battery charge status according to [PEI] 6.9

func RequestGPSPosition

func RequestGPSPosition(ctx context.Context, requester tetra.Requester) (float64, float64, int, time.Time, error)

RequestGPSPosition reads the current GPS position, number of satellites, and time in UTC

func RequestSignalStrength

func RequestSignalStrength(ctx context.Context, requester tetra.Requester) (int, error)

RequestSignalStrength reads the current signal strength in dBm according to [PEI] 6.9

func RequestTalkgroup

func RequestTalkgroup(ctx context.Context, requester tetra.Requester) (string, error)

RequestTalkgroup reads the current talkgroup according to [PEI] 6.15.6.4

func SetOperatingMode

func SetOperatingMode(mode AIMode) string

SetOperatingMode according to [PEI] 6.14.7.2

func SetTalkgroup

func SetTalkgroup(gtsi string) string

SetTalkgroup according to [PEI] 6.15.6.2

Types

type AIMode

type AIMode byte

AIMode represents an operating mode according to [PEI] 6.17.4

const (
	TMO AIMode = iota
	DMO
)

All supported operating modes

func AIModeByName

func AIModeByName(name string) (AIMode, error)

AIModeByName returns the AIMode with the given name

func RequestOperatingMode

func RequestOperatingMode(ctx context.Context, requester tetra.Requester) (AIMode, error)

RequestOperatingMode reads the current operating mode according to [PEI] 6.14.7.4

func (AIMode) String

func (m AIMode) String() string

type TalkgroupInfo added in v1.2.0

type TalkgroupInfo struct {
	GTSI string
	Name string
}

func RequestTalkgroups added in v1.2.0

func RequestTalkgroups(ctx context.Context, requester tetra.Requester, kind TalkgroupKind, result []TalkgroupInfo) ([]TalkgroupInfo, error)

RequestTalkgroups reads all available static talkgroups from the device, see [PEI] 6.11.5.2

type TalkgroupKind added in v1.2.0

type TalkgroupKind string
const (
	TalkgroupFixed   TalkgroupKind = "F"
	TalkgroupStatic  TalkgroupKind = "S"
	TalkgroupDynamic TalkgroupKind = "D"
)

type TalkgroupRange added in v1.2.0

type TalkgroupRange struct {
	Min int
	Max int
}

func RequestTalkgroupRange added in v1.2.0

func RequestTalkgroupRange(ctx context.Context, requester tetra.Requester, kind TalkgroupKind) (TalkgroupRange, error)

Jump to

Keyboard shortcuts

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