Documentation
¶
Index ¶
Constants ¶
const ( // WATCH_ENABLE enable streaming. WATCH_ENABLE = 0x0001 // WATCH_DISABLE disable watching. WATCH_DISABLE = 0x0002 // WATCH_JSON JSON output. WATCH_JSON = 0x0010 // WATCH_NMEA output in NMEA. WATCH_NMEA = 0x0020 // WATCH_RARE output of packets in hex. WATCH_RARE = 0x0040 // WATCH_RAW output of raw packets. WATCH_RAW = 0x0080 // WATCH_SCALED scale output to floats. WATCH_SCALED = 0x0100 // WATCH_TIMING timing information. WATCH_TIMING = 0x0200 // WATCH_DEVICE watch specific device. WATCH_DEVICE = 0x0800 // WATCH_SPLIT24 split AIS Type 24s. WATCH_SPLIT24 = 0x1000 // WATCH_PPS enable PPS JSON. WATCH_PPS = 0x2000 )
const DefaultAddress = ":2947"
DefaultAddress is the default address gpsd listens to.
Variables ¶
var ErrClosed = errors.New("closed")
ErrClosed signalizes that client is closed.
Functions ¶
This section is empty.
Types ¶
type ATT ¶
type ATT struct {
Class string `json:"class"`
Device string `json:"device"`
Time time.Time `json:"time,omitempty"`
Heading float64 `json:"heading,omitempty"`
MagSt string `json:"mag_st,omitempty"`
Pitch float64 `json:"pitch,omitempty"`
PitchSt string `json:"pitch_st,omitempty"`
Yaw float64 `json:"yaw,omitempty"`
YawSt string `json:"yaw_st,omitempty"`
Roll float64 `json:"roll,omitempty"`
RollSt string `json:"roll_st,omitempty"`
Dip float64 `json:"dip,omitempty"`
MagLen float64 `json:"mag_len,omitempty"`
MagX float64 `json:"mag_x,omitempty"`
MagY float64 `json:"mag_y,omitempty"`
MagZ float64 `json:"mag_z,omitempty"`
AccLen float64 `json:"acc_len,omitempty"`
AccX float64 `json:"acc_x,omitempty"`
AccY float64 `json:"acc_y,omitempty"`
AccZ float64 `json:"acc_z,omitempty"`
GyroX float64 `json:"gyro_x,omitempty"`
GyroY float64 `json:"gyro_y,omitempty"`
Depth float64 `json:"depth,omitempty"`
Temp float64 `json:"temp,omitempty"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a gpsd client implementation.
https://gpsd.gitlab.io/gpsd/gpsd_json.html https://gpsd.gitlab.io/gpsd/client-howto.html
func (*Client) Done ¶
func (c *Client) Done() <-chan struct{}
Done reports where the client is stopped.
type DEVICE ¶
type DEVICE struct {
Class string `json:"class"`
// can be string whet it's a member of DEVICES and float64 when used separately
Activated interface{} `json:"activated,omitempty"`
Path string `json:"path,omitempty"`
Flags float64 `json:"flags,omitempty"`
Driver string `json:"driver,omitempty"`
Subtype string `json:"subtype,omitempty"`
Bps float64 `json:"bps,omitempty"`
Parity string `json:"parity,omitempty"`
Stopbits float64 `json:"stopbits"`
Native float64 `json:"native,omitempty"`
Cycle float64 `json:"cycle,omitempty"`
Mincycle float64 `json:"mincycle,omitempty"`
}
type GST ¶
type GST struct {
Class string `json:"class"`
Device string `json:"device,omitempty"`
Time time.Time `json:"time,omitempty"`
Rms float64 `json:"rms,omitempty"`
Major float64 `json:"major,omitempty"`
Minor float64 `json:"minor,omitempty"`
Orient float64 `json:"orient,omitempty"`
Lat float64 `json:"lat,omitempty"`
Lon float64 `json:"lon,omitempty"`
Alt float64 `json:"alt,omitempty"`
}
type Logger ¶
type Logger interface {
Errorf(format string, v ...interface{})
Debugf(format string, v ...interface{})
}
Logger gives ability to use different logger implementations.
type Option ¶
type Option func(c *Client)
Option is a client configuration option.
func WithChannel ¶
WithChannel changes reports channel for adjusting buffer size, default is 10.
type Report ¶
type Report interface {
// contains filtered or unexported methods
}
Report is a grouping interface for all types of reports.
type SKY ¶
type SKY struct {
Class string `json:"class"`
Device string `json:"device,omitempty"`
Time time.Time `json:"time,omitempty"`
Xdop float64 `json:"xdop,omitempty"`
Ydop float64 `json:"ydop,omitempty"`
Vdop float64 `json:"vdop,omitempty"`
Tdop float64 `json:"tdop,omitempty"`
Hdop float64 `json:"hdop,omitempty"`
Pdop float64 `json:"pdop,omitempty"`
Gdop float64 `json:"gdop,omitempty"`
Satellites []Satellite `json:"satellites"`
}
type TPV ¶
type TPV struct {
Class string `json:"class"`
Device string `json:"device,omitempty"`
Status float64 `json:"status,omitempty"`
Mode float64 `json:"mode"`
Time time.Time `json:"time,omitempty"`
Ept float64 `json:"ept,omitempty"`
Lat float64 `json:"lat,omitempty"`
Lon float64 `json:"lon,omitempty"`
Alt float64 `json:"alt,omitempty"`
Eph float64 `json:"eph,omitempty"`
Epx float64 `json:"epx,omitempty"`
Epy float64 `json:"epy,omitempty"`
Epv float64 `json:"epv,omitempty"`
Track float64 `json:"track,omitempty"`
Speed float64 `json:"speed,omitempty"`
Climb float64 `json:"climb,omitempty"`
Epd float64 `json:"epd,omitempty"`
Eps float64 `json:"eps,omitempty"`
Epc float64 `json:"epc,omitempty"`
}
type WATCH ¶
type WATCH struct {
Class string `json:"class"`
Enable bool `json:"enable,omitempty"`
Json bool `json:"json,omitempty"`
Nmea bool `json:"nmea,omitempty"`
Raw float64 `json:"raw,omitempty"`
Scaled bool `json:"scaled,omitempty"`
Split24 bool `json:"split24,omitempty"`
Pps bool `json:"pps,omitempty"`
Device string `json:"device,omitempty"`
Remote string `json:"remote,omitempty"`
}