gpsnmea

package module
v0.0.0-...-2994f05 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 9 Imported by: 3

README

gpsnmea

read a nmea port serial

Documentation

Overview

Package implements a binary for read serial port nmea.

Package implements a binary for read serial port nmea.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecimalDegreeToLat

func DecimalDegreeToLat(lat float64) string

func DecimalDegreeToLon

func DecimalDegreeToLon(lon float64) string

func Distance

func Distance(lat1 float64, lng1 float64, lat2 float64, lng2 float64, unit ...string) float64

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::: ::: ::: This routine calculates the distance between two points (given the ::: ::: latitude/longitude of those points). It is being used to calculate ::: ::: the distance between two locations using GeoDataSource (TM) prodducts ::: ::: ::: ::: Definitions: ::: ::: South latitudes are negative, east longitudes are positive ::: ::: ::: ::: Passed to function: ::: ::: lat1, lon1 = Latitude and Longitude of point 1 (in decimal degrees) ::: ::: lat2, lon2 = Latitude and Longitude of point 2 (in decimal degrees) ::: ::: unit = the unit you desire for results ::: ::: where: 'M' is statute miles (default) ::: ::: 'K' is kilometers ::: ::: 'N' is nautical miles ::: ::: ::: ::: Worldwide cities and other features databases with latitude longitude ::: ::: are available at https://www.geodatasource.com ::: ::: ::: ::: For enquiries, please contact sales@geodatasource.com ::: ::: ::: ::: Official Web site: https://www.geodatasource.com ::: ::: ::: ::: GeoDataSource.com (C) All Rights Reserved 2018 ::: ::: ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

func LatLongToDecimalDegree

func LatLongToDecimalDegree(num float64, cord string) float64

func ReadTCP

func ReadTCP(conn net.Conn, filters ...string) chan string

Types

type Device

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

func NewDevice

func NewDevice(portName string, baudRate int, filters ...string) (*Device, error)

func (*Device) Close

func (dev *Device) Close() bool

func (*Device) Open

func (dev *Device) Open() error

func (*Device) Read

func (dev *Device) Read() chan string

type DeviceTCP

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

func NewDeviceTCP

func NewDeviceTCP(socket string) (*DeviceTCP, error)

func (*DeviceTCP) Accept

func (dev *DeviceTCP) Accept() (net.Conn, error)

func (*DeviceTCP) Close

func (dev *DeviceTCP) Close() bool

type Gpgga

type Gpgga struct {
	Raw           string
	Fileds        []string
	TimeStamp     string
	Lat           float64
	LatCord       string
	Long          float64
	LongCord      string
	FixQuality    int
	NumberSat     int
	HDop          float64
	Altitude      float64
	AltCord       string
	Geoidal       float64
	GeoidalUnit   string
	Dgpsupdate    float64
	DrefStationId float64
	Checksum      int64
}

func ParseGGA

func ParseGGA(s string) *Gpgga

type Gprmc

type Gprmc struct {
	Raw             string
	Fields          []string
	TimeStamp       string
	Validity        bool
	Lat             float64
	LatCord         string
	Long            float64
	LongCord        string
	Speed           float64
	TrueCourse      float64
	DateStamp       string
	MagneticVar     float64
	MagneticVarCord string
	Checksum        int64
}

func ParseRMC

func ParseRMC(s string) *Gprmc

Directories

Path Synopsis
Package implements a binary for read serial port nmea.
Package implements a binary for read serial port nmea.

Jump to

Keyboard shortcuts

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