Documentation
¶
Overview ¶
Package deviceid identifies APRS transmitter devices from parsed packets. It uses the community-maintained tocalls.yaml database to determine the vendor, model, and class of the transmitting device.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoMatch = errors.New("no device match")
ErrNoMatch is returned when no device match is found for a packet.
Functions ¶
This section is empty.
Types ¶
type DeviceDB ¶
type DeviceDB struct {
// contains filtered or unexported fields
}
DeviceDB is a concurrency-safe device identification database that supports hot-reloading. Use Open to create one, then call Identify from any number of goroutines. Call CheckReload periodically to pick up changes to the underlying YAML file.
func Open ¶
Open loads a tocalls.yaml file and returns a DeviceDB ready for concurrent use. Call Identify to look up devices, and CheckReload to pick up file changes.
func (*DeviceDB) CheckReload ¶
CheckReload checks whether the database file has changed (by comparing inode and mtime) and reloads it if so. An optional path argument switches the database to a different YAML file. Returns true if the database was reloaded. It is safe to call from a single goroutine while other goroutines call Identify concurrently.
func (*DeviceDB) Identify ¶
Identify determines the device that transmitted the given packet. It is safe to call concurrently from multiple goroutines. Returns (deviceID, updatedComment, error). updatedComment has Mic-E device codes stripped from the comment. Returns nil DeviceID and ErrNoMatch if no match is found.
type DeviceID ¶
type DeviceID struct {
Vendor string // Manufacturer/author
Model string // Device/software model
Class string // Device class: wx, tracker, rig, ht, app, software, digi, dstar, satellite
OS string // Operating system (optional)
Features []string // Feature flags: "messaging", "item-in-msg"
Messaging bool // Device supports APRS messaging
}
DeviceID holds the identified device information.