Documentation ¶
Index ¶
- Constants
- Variables
- func AttachLocation(gpsevent *entity.GpsEvent) *entity.GpsEvent
- func ConvertEventLogToGPSEvent(eventLog *entity.EventLog) *entity.GpsEvent
- func DecodeReadConfigAck(original []byte) string
- func GenDeviceErrorsFromSinglePacket(singlePacket *entity.SinglePacket, seqNo string, devId string) []string
- func GenGpsEventFromSinglePacket(singlePacket *entity.SinglePacket, seqNo string, cntrNum string, ...) *entity.GpsEvent
- func GenOpModeChangeFromSinglePacket(singlePacket *entity.SinglePacket, seqNo string, cntrNum string) *entity.OperationModeChange
- func GenSetConfigCommand(cmdVal map[string]string) (setConfigCommand []byte, err error)
- func ParseToEventLog(bytes []byte, now time.Time, cntrNum string, seqNo int) *entity.EventLog
- func ParseToSinglePacket(data []byte) (*entity.SinglePacket, error)
- type GpsEventAddress
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 BitMask = []byte{ Bit0Mask, Bit1Mask, Bit2Mask, Bit3Mask, Bit4Mask, Bit5Mask, Bit6Mask, Bit7Mask, }
View Source
var UTC8 *time.Location = getUTC8()
Functions ¶
func DecodeReadConfigAck ¶
DecodeReadConfigAck for decoding the Read Config Cmd Ack
func GenDeviceErrorsFromSinglePacket ¶
func GenDeviceErrorsFromSinglePacket(singlePacket *entity.SinglePacket, seqNo string, devId string) []string
func GenOpModeChangeFromSinglePacket ¶
func GenOpModeChangeFromSinglePacket(singlePacket *entity.SinglePacket, seqNo string, cntrNum string) *entity.OperationModeChange
func GenSetConfigCommand ¶
GenSetConfigCommand for generating Command for setting config
func ParseToEventLog ¶
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
Click to show internal directories.
Click to hide internal directories.