Documentation
ยถ
Overview ยถ
Package fanet generates and parses FANET sentences.
See https://github.com/3s1d/fanet-stm32. See https://github.com/3s1d/fanet-stm32/blob/master/fanet_module.pdf. See https://github.com/3s1d/fanet-stm32/blob/master/Src/fanet/radio/protocol.txt.
Index ยถ
- Variables
- type Command
- type DBGCommand
- type DBRResponse
- type DGJCommand
- type DGLCommand
- type DGPCommand
- type DGPResponse
- type DGRResponse
- type DGVCommand
- type DGVResponse
- type FAOResponse
- type FAPCommand
- type FARResponse
- type FATCommand
- type FAXCommand
- type FAXResponse
- type FNACommand
- type FNAResponse
- type FNCCommand
- type FNFAck
- type FNFGroundTracking
- type FNFHardwareInfo
- type FNFMessage
- type FNFName
- type FNFResponse
- type FNFTracking
- type FNMCommand
- type FNRResponse
- type FNSCommand
- type FNTCommand
- type FNZResponse
- type ID
- type Optional
- type Response
- type SyntaxError
Constants ยถ
This section is empty.
Variables ยถ
var AircraftTypes = map[int]string{
0: "Other",
1: "Paraglider",
2: "Hangglider",
3: "Balloon",
4: "Glider",
5: "Powered Aircraft",
6: "Helicopter",
7: "UAV",
}
var GroundTrackingTypes = map[int]string{
0: "Other",
1: "Walking",
2: "Vehicle",
3: "Bike",
4: "Boot",
8: "Need a ride",
9: "Landed well",
12: "Need technical support",
13: "Need medical help",
14: "Distress call",
15: "Distress call automatically",
}
var ManufacturerNames = map[int]string{
0x00: "[reserved]",
0x01: "Skytraxx",
0x03: "BitBroker.eu",
0x04: "AirWhere",
0x05: "Windline",
0x06: "Burnair.ch",
0x07: "SoftRF",
0x08: "GXAircom",
0x09: "Airtribune",
0x10: "alfapilot",
0x0A: "FLARM",
0x11: "FANET+",
0x20: "XC Tracer",
0xBA: "Burnair",
0xCB: "CloudBuddy",
0xE0: "OGN Tracker",
0xE4: "4aviation",
0xFA: "Various",
0xFB: "Expressif",
0xFC: "Unregistered",
0xFD: "Unregistered",
0xFE: "[Multicast]",
0xFF: "[reserved]",
}
Functions ยถ
This section is empty.
Types ยถ
type Command ยถ
type Command interface {
Sentence() string
}
func ParseCommand ยถ
ParseCommand parses a response from data.
func ParseCommandString ยถ
ParseCommandString parses a response from s.
type DBGCommand ยถ
A DBGCommand is a DBG command.
func (*DBGCommand) Sentence ยถ
func (c *DBGCommand) Sentence() string
type DBRResponse ยถ
An DBRResponse is an DBR response.
func (*DBRResponse) Address ยถ
func (r *DBRResponse) Address() string
func (*DBRResponse) Err ยถ
func (r *DBRResponse) Err() error
type DGJCommand ยถ
type DGJCommand struct {
Bootloader string
}
A DGJCommand is a DGJ command.
func (*DGJCommand) Sentence ยถ
func (c *DGJCommand) Sentence() string
type DGLCommand ยถ
A DGLCommand is a DGL command.
func (*DGLCommand) Sentence ยถ
func (c *DGLCommand) Sentence() string
type DGPCommand ยถ
type DGPCommand struct {
PowerMode bool
}
func (*DGPCommand) Sentence ยถ
func (c *DGPCommand) Sentence() string
type DGPResponse ยถ
type DGPResponse struct {
PowerMode bool
}
func (*DGPResponse) Address ยถ
func (r *DGPResponse) Address() string
type DGRResponse ยถ
A DGRResponse is a DGR response.
func (*DGRResponse) Address ยถ
func (r *DGRResponse) Address() string
func (*DGRResponse) Err ยถ
func (r *DGRResponse) Err() error
type DGVCommand ยถ
type DGVCommand struct{}
A DGVCommand is a DGV command.
func (DGVCommand) Sentence ยถ
func (DGVCommand) Sentence() string
type DGVResponse ยถ
type DGVResponse struct {
BuildDateCode string
}
A DGVResponse is a DGV response.
func (*DGVResponse) Address ยถ
func (r *DGVResponse) Address() string
type FAOResponse ยถ
type FAOResponse struct {
Source int
ID ID
IDType int
AircraftType int
Latitude float64
Longitude float64
Altitude float64
GroundSpeed float64
ClimbRate float64
Track float64
}
An FAOResponse is an FAO response.
func (*FAOResponse) Address ยถ
func (r *FAOResponse) Address() string
type FAPCommand ยถ
type FAPCommand struct {
PowerMode bool
}
func (*FAPCommand) Sentence ยถ
func (c *FAPCommand) Sentence() string
type FARResponse ยถ
A FARResponse is a FAR response.
func (*FARResponse) Address ยถ
func (r *FARResponse) Address() string
func (*FARResponse) Err ยถ
func (r *FARResponse) Err() error
type FATCommand ยถ
A FATCommand is a FAT command.
func (*FATCommand) Sentence ยถ
func (c *FATCommand) Sentence() string
type FAXCommand ยถ
type FAXCommand struct{}
A FAXCommand is a FAX command.
func (FAXCommand) Sentence ยถ
func (FAXCommand) Sentence() string
type FAXResponse ยถ
A FAXResponse is a FAX response.
func (*FAXResponse) Address ยถ
func (r *FAXResponse) Address() string
type FNACommand ยถ
type FNACommand struct{}
An FNACommand is an FNA command.
func (FNACommand) Sentence ยถ
func (FNACommand) Sentence() string
type FNAResponse ยถ
type FNAResponse struct {
ID ID
}
An FNAResponse is an FNA response.
func (*FNAResponse) Address ยถ
func (r *FNAResponse) Address() string
type FNCCommand ยถ
func (*FNCCommand) Sentence ยถ
func (c *FNCCommand) Sentence() string
type FNFGroundTracking ยถ
An FNFGroundTracking is an FNF ground tracking payload.
type FNFHardwareInfo ยถ
type FNFHardwareInfo struct {
IsPingPongRequest bool
HardwareSubtype Optional[int]
ReleaseVersion Optional[bool]
BuildDate Optional[time.Time]
ICAOAddress Optional[[3]byte]
Uptime Optional[time.Duration]
RSSI Optional[int]
FANETAddress Optional[[3]byte]
}
An FNFHardwareInfo is an FNF hardware info payload.
type FNFMessage ยถ
An FNFMessage is an FNF message payload.
type FNFResponse ยถ
type FNFResponse struct {
Source ID
Broadcast bool
Signature Optional[int]
Type int
Payload []byte
}
An FNFResponse is an FNF response.
func (*FNFResponse) Address ยถ
func (r *FNFResponse) Address() string
func (*FNFResponse) ParsePayload ยถ
func (r *FNFResponse) ParsePayload() (any, error)
type FNFTracking ยถ
type FNFTracking struct {
Latitude float64
Longitude float64
OnlineTracking bool
Type int
Altitude int
SpeedKPH float64
Climb float64
Heading float64
TurnRate Optional[float64]
QNEOffset Optional[int]
}
An FNFTracking is an FNF tracking payload.
type FNMCommand ยถ
type FNMCommand struct {
Mode int
}
func (*FNMCommand) Sentence ยถ
func (c *FNMCommand) Sentence() string
type FNRResponse ยถ
An FNRResponse is an FNR response.
func (*FNRResponse) Address ยถ
func (r *FNRResponse) Address() string
func (*FNRResponse) Err ยถ
func (r *FNRResponse) Err() error
type FNSCommand ยถ
type FNSCommand struct {
Latitude float64
Longitude float64
Altitude float64
SpeedKPH float64
Climb float64
Heading float64
Time time.Time
GeoidSeparation Optional[float64]
TurnRate Optional[float64]
QNEOffset Optional[float64]
}
An FNSCommand is an FNS command.
func (*FNSCommand) Sentence ยถ
func (c *FNSCommand) Sentence() string
type FNTCommand ยถ
type FNTCommand struct {
Type int
Destination ID
Forward bool
AckRequired bool
Payload []byte
Signature Optional[int]
}
An FNTCommand is an FNT request.
func (*FNTCommand) Sentence ยถ
func (c *FNTCommand) Sentence() string
type FNZResponse ยถ
An FNZResponse is an FNZ response.
func (*FNZResponse) Address ยถ
func (r *FNZResponse) Address() string
type ID ยถ
func (ID) MarshalText ยถ
type Optional ยถ
func NewOptional ยถ
func (Optional[T]) MarshalJSON ยถ
func (*Optional[T]) UnmarshalJSON ยถ
type Response ยถ
type Response interface {
Address() string
}
func ParseResponse ยถ
ParseResponse parses a response from data.
func ParseResponseString ยถ
ParseResponseString parses a response from s.
type SyntaxError ยถ
func (*SyntaxError) Error ยถ
func (e *SyntaxError) Error() string
func (*SyntaxError) Unwrap ยถ
func (e *SyntaxError) Unwrap() error