service

package
v0.0.0-...-b0ef731 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GPSEVENT_SOURCE_TCPSERVER = "TCP_SERVER"
	GPSEVENT_CARRIER_COSU     = "COSU"
)
View Source
const (
	Bit0Mask byte = 0x01 // 0000 0001
	Bit1Mask byte = 0x02 // 0000 0010
	Bit2Mask byte = 0x04 // 0000 0100
	Bit3Mask byte = 0x08 // 0000 1000
	Bit4Mask byte = 0x10 // 0001 0000
	Bit5Mask byte = 0x20 // 0010 0000
	Bit6Mask byte = 0x40 // 0100 0000
	Bit7Mask byte = 0x80 // 1000 0000

	LOW_4_BITS_MASK byte = 0x0F // 0000 1111
)
View Source
const DISTANCE_FROM_CITY = 10
View Source
const EARTH_RADIAS = 6378137

Variables

View Source
var UTC8 *time.Location = getUTC8()

Functions

func AttachLocation

func AttachLocation(gpsevent *entity.GpsEvent) *entity.GpsEvent

func ConvertEventLogToGPSEvent

func ConvertEventLogToGPSEvent(eventLog *entity.EventLog) *entity.GpsEvent

func DecodeReadConfigAck

func DecodeReadConfigAck(original []byte) string

DecodeReadConfigAck for decoding the Read Config Cmd Ack

func GenDeviceErrorsFromSinglePacket

func GenDeviceErrorsFromSinglePacket(singlePacket *entity.SinglePacket, seqNo string, devId string) []string

func GenGpsEventFromSinglePacket

func GenGpsEventFromSinglePacket(singlePacket *entity.SinglePacket, seqNo string, cntrNum string, nowDateStr string, carrier string) *entity.GpsEvent

func GenOpModeChangeFromSinglePacket

func GenOpModeChangeFromSinglePacket(singlePacket *entity.SinglePacket, seqNo string, cntrNum string) *entity.OperationModeChange

func GenSetConfigCommand

func GenSetConfigCommand(cmdVal map[string]string) (setConfigCommand []byte, err error)

GenSetConfigCommand for generating Command for setting config

func ParseToEventLog

func ParseToEventLog(bytes []byte, now time.Time, cntrNum string, seqNo int) *entity.EventLog

func ParseToSinglePacket

func ParseToSinglePacket(data []byte) (*entity.SinglePacket, error)

Types

type GpsEventAddress

type GpsEventAddress struct {
	Distance  float64 `json:"distance"`
	Longitude float64 `json:"longitude"`
	Latitude  float64 `json:"latitude"`

	Code        string `json:"code"`
	Name        string `json:"name"`
	City        string `json:"city"`
	RegionCode  string `json:"region_code"`
	Region      string `json:"region"`
	CountryCode string `json:"country_code"`
	Country     string `json:"country"`
}

GpsEventAddress entity gpsEventAddress

Jump to

Keyboard shortcuts

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