gbt19056

package
v0.0.0-...-685ad17 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const LengthAccidentRecord = 234

LengthAccidentRecord ...

View Source
const LengthDriverLogRecord = 25

LengthDriverLogRecord ...

View Source
const LengthMetadata = 23

LengthMetadata ...

View Source
const LengthOvertimeLogRecord = 50

LengthOvertimeLogRecord ...

View Source
const LengthPosition = 10

LengthPosition ...

View Source
const LengthPositionLogRecord = 666

LengthPositionLogRecord ...

View Source
const LengthSpeedLogRecord = 126

LengthSpeedLogRecord ...

View Source
const LengthSpeedStatus = 2

LengthSpeedStatus ...

View Source
const LengthSpeedStatusLogRecord = 133

LengthSpeedStatusLogRecord ...

View Source
const LengthStatusName = 10

LengthStatusName ...

View Source
const OdometerMultiplier = 10

OdometerMultiplier ...

View Source
const PositionMultiplier = 10000.0 * 60

PositionMultiplier ...

Variables

This section is empty.

Functions

func DecodeBig5

func DecodeBig5(s []byte) ([]byte, error)

DecodeBig5 convert BIG5 to UTF-8

func DecodeGBK

func DecodeGBK(s []byte) ([]byte, error)

DecodeGBK convert GBK to UTF-8

func DecodeGBKStr

func DecodeGBKStr(s []byte) (string, error)

DecodeGBKStr convert GBK to UTF-8 String

func DecodeHZGB2312

func DecodeHZGB2312(s []byte) ([]byte, error)

DecodeHZGB2312 convert GBK to UTF-8

func EncodeBig5

func EncodeBig5(s []byte) ([]byte, error)

EncodeBig5 convert UTF-8 to BIG5

func EncodeGBK

func EncodeGBK(s []byte) ([]byte, error)

EncodeGBK convert UTF-8 to GBK

func EncodeHZGB2312

func EncodeHZGB2312(s []byte) ([]byte, error)

EncodeHZGB2312 convert UTF-8 to GBK

Types

type AccidentLog

type AccidentLog struct {
	Records []AccidentLogRecord `json:"records"`
	// contains filtered or unexported fields
}

AccidentLog ..

func (*AccidentLog) DumpData

func (e *AccidentLog) DumpData() ([]byte, error)

DumpData PositionLog

func (*AccidentLog) LoadBinary

func (e *AccidentLog) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary SpeedLog Table A.16, Code 0x08

type AccidentLogRecord

type AccidentLogRecord struct {
	Ts            DateTime      `json:"ts,string"`
	DriverID      string        `json:"driver_id"`
	EndPosition   Position      `json:"position"`
	SpeedStatuses []SpeedStatus `json:"speed_statuses"`
}

AccidentLogRecord ...

func (*AccidentLogRecord) DumpData

func (e *AccidentLogRecord) DumpData() ([]byte, error)

DumpData SpeedLogRecord

func (*AccidentLogRecord) LoadBinary

func (e *AccidentLogRecord) LoadBinary(buffer []byte)

LoadBinary SpeedLogRecord Table A.17

type ConfigChangeLog

type ConfigChangeLog struct {
	Records []ConfigChangeLogRecord `json:"records"`
	// contains filtered or unexported fields
}

ConfigChangeLog ..

func (*ConfigChangeLog) DumpData

func (e *ConfigChangeLog) DumpData() ([]byte, error)

DumpData ConfigChangeLog

func (*ConfigChangeLog) LoadBinary

func (e *ConfigChangeLog) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary SpeedLog Table A.16, Code 0x08

type ConfigChangeLogRecord

type ConfigChangeLogRecord struct {
	Ts   DateTime `json:"ts,string"`
	Type HexUint8 `json:"event"`
}

ConfigChangeLogRecord ...

func (*ConfigChangeLogRecord) DumpData

func (e *ConfigChangeLogRecord) DumpData() ([]byte, error)

DumpData ConfigChangeLogRecord

func (*ConfigChangeLogRecord) LoadBinary

func (e *ConfigChangeLogRecord) LoadBinary(buffer []byte)

LoadBinary DriverLogRecord Table A.25

type DateTime

type DateTime struct {
	time.Time
}

DateTime ...

func (*DateTime) DumpData

func (e *DateTime) DumpData() ([]byte, error)

DumpData DateTime

func (*DateTime) DumpDataShort

func (e *DateTime) DumpDataShort() ([]byte, error)

DumpDataShort DateTime

func (*DateTime) LoadBinary

func (e *DateTime) LoadBinary(buffer []byte)

LoadBinary RealTime Table A.8, Code 0x02

func (*DateTime) LoadBinaryShort

func (e *DateTime) LoadBinaryShort(buffer []byte)

LoadBinaryShort RealTime Table A.14

type DriverInfo

type DriverInfo struct {
	ID string `json:"id"`
	// contains filtered or unexported fields
}

DriverInfo ..

func (*DriverInfo) DumpData

func (e *DriverInfo) DumpData() ([]byte, error)

DumpData StandardVersion

func (*DriverInfo) LoadBinary

func (e *DriverInfo) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary DriverInfo Table A.6, Code 0x00

type DriverLog

type DriverLog struct {
	Records []DriverLogRecord `json:"records"`
	// contains filtered or unexported fields
}

DriverLog ..

func (*DriverLog) DumpData

func (e *DriverLog) DumpData() ([]byte, error)

DumpData DriverLog

func (*DriverLog) LoadBinary

func (e *DriverLog) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary SpeedLog Table A.16, Code 0x12

type DriverLogRecord

type DriverLogRecord struct {
	Ts       DateTime `json:"ts,string"`
	DriverID string   `json:"driver_id"`
	Type     HexUint8 `json:"type"` // 0x01: Login; 0x02: Logout; Other resversed
}

DriverLogRecord ...

func (*DriverLogRecord) DumpData

func (e *DriverLogRecord) DumpData() ([]byte, error)

DumpData DriverLogRecord

func (*DriverLogRecord) LoadBinary

func (e *DriverLogRecord) LoadBinary(buffer []byte)

LoadBinary DriverLogRecord Table A.25

type ExportRecord

type ExportRecord struct {
	NumberBlock        uint16             `json:"number_block"`
	StandardVersion    StandardVersion    `json:"standard_version"`
	DriverInfo         DriverInfo         `json:"driver_info"`
	RealTime           RealTime           `json:"real_time"`
	Odometer           Odometer           `json:"odometer"`
	PulseFactor        PulseFactor        `json:"pulse_factor"`
	VehicleInfo        VehicleInfo        `json:"vehicle_info"`
	StatusSignalConfig StatusSignalConfig `json:"status_signal_config"`
	RecoderID          RecoderID          `json:"recoder_id"`
	SpeedLog           SpeedLog           `json:"speed_log"`
	PositionLog        PositionLog        `json:"position_log"`
	AccidentLog        AccidentLog        `json:"accident_log"`
	OvertimeLog        OvertimeLog        `json:"overtime_log"`
	DriverLog          DriverLog          `json:"driver_log"`
	ExternalPowerLog   ExternalPowerLog   `json:"external_power_log"`
	ConfigChangeLog    ConfigChangeLog    `json:"config_change_log"`
	SpeedStatusLog     SpeedStatusLog     `json:"speed_status_log"`
}

ExportRecord ...

func (*ExportRecord) DumpData

func (e *ExportRecord) DumpData() ([]byte, error)

DumpData ExportRecord

func (*ExportRecord) LoadBinary

func (e *ExportRecord) LoadBinary(buffer []byte) error

LoadBinary ExportRecord

func (*ExportRecord) MakeFileName

func (e *ExportRecord) MakeFileName() string

MakeFileName ...

type ExternalPowerLog

type ExternalPowerLog struct {
	Records []ExternalPowerLogRecord `json:"records"`
	// contains filtered or unexported fields
}

ExternalPowerLog ..

func (*ExternalPowerLog) DumpData

func (e *ExternalPowerLog) DumpData() ([]byte, error)

DumpData ExternalPowerLog

func (*ExternalPowerLog) LoadBinary

func (e *ExternalPowerLog) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary SpeedLog Table A.16, Code 0x08

type ExternalPowerLogRecord

type ExternalPowerLogRecord struct {
	Ts   DateTime `json:"ts,string"`
	Type HexUint8 `json:"type"` // 0x01: pluged; 0x02: unpluged;
}

ExternalPowerLogRecord ...

func (*ExternalPowerLogRecord) DumpData

func (e *ExternalPowerLogRecord) DumpData() ([]byte, error)

DumpData ExternalPowerLogRecord

func (*ExternalPowerLogRecord) LoadBinary

func (e *ExternalPowerLogRecord) LoadBinary(buffer []byte)

LoadBinary DriverLogRecord Table A.25

type HexUint8

type HexUint8 uint8

HexUint8 ...

func (*HexUint8) MarshalJSON

func (sd *HexUint8) MarshalJSON() ([]byte, error)

MarshalJSON HexUint8

func (*HexUint8) UnmarshalJSON

func (sd *HexUint8) UnmarshalJSON(input []byte) error

UnmarshalJSON HexUint8 ...

type Odometer

type Odometer struct {
	Now          DateTime `json:"now,string"`
	TimeInit     DateTime `json:"time_init,string"`
	MileageTotal float64  `json:"mileage_total"`
	MileageInit  float64  `json:"mileage_init"`
	// contains filtered or unexported fields
}

Odometer ..

func (*Odometer) DumpData

func (e *Odometer) DumpData() ([]byte, error)

DumpData Odometer

func (*Odometer) LoadBinary

func (e *Odometer) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary RealTime Table A.9, Code 0x03

type OvertimeLog

type OvertimeLog struct {
	Records []OvertimeLogRecord `json:"records"`
	// contains filtered or unexported fields
}

OvertimeLog ..

func (*OvertimeLog) DumpData

func (e *OvertimeLog) DumpData() ([]byte, error)

DumpData SpeedLog

func (*OvertimeLog) LoadBinary

func (e *OvertimeLog) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary SpeedLog Table A.16, Code 0x08

type OvertimeLogRecord

type OvertimeLogRecord struct {
	DriverID      string   `json:"driver_id"`
	Start         DateTime `json:"start,string"`
	End           DateTime `json:"end,string"`
	PositionStart Position `json:"position_start"`
	PositionEnd   Position `json:"position_end"`
}

OvertimeLogRecord ...

func (*OvertimeLogRecord) DumpData

func (e *OvertimeLogRecord) DumpData() ([]byte, error)

DumpData OvertimeLogRecord

func (*OvertimeLogRecord) LoadBinary

func (e *OvertimeLogRecord) LoadBinary(buffer []byte)

LoadBinary DriverLogRecord Table A.25

type Position

type Position struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	Elevation float64 `json:"elevation"`
}

Position ...

func (*Position) DumpData

func (e *Position) DumpData() ([]byte, error)

DumpData Position

func (*Position) LoadBinary

func (e *Position) LoadBinary(buffer []byte)

LoadBinary ...

type PositionLog

type PositionLog struct {
	Records []PositionLogRecord `json:"records"`
	// contains filtered or unexported fields
}

PositionLog ..

func (*PositionLog) DumpData

func (e *PositionLog) DumpData() ([]byte, error)

DumpData PositionLog

func (*PositionLog) LoadBinary

func (e *PositionLog) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary SpeedLog Table A.16, Code 0x08

type PositionLogRecord

type PositionLogRecord struct {
	Start     DateTime            `json:"start,string"`
	Positions []positionWithSpeed `json:"positions"`
}

PositionLogRecord ...

func (*PositionLogRecord) DumpData

func (e *PositionLogRecord) DumpData() ([]byte, error)

DumpData SpeedLogRecord

func (*PositionLogRecord) LoadBinary

func (e *PositionLogRecord) LoadBinary(buffer []byte)

LoadBinary SpeedLogRecord Table A.17

type PulseFactor

type PulseFactor struct {
	Now    DateTime `json:"now,string"`
	Factor uint16   `json:"Factor"`
	// contains filtered or unexported fields
}

PulseFactor ..

func (*PulseFactor) DumpData

func (e *PulseFactor) DumpData() ([]byte, error)

DumpData PulseFactor

func (*PulseFactor) LoadBinary

func (e *PulseFactor) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary PulseFactor Table A.10, Code 0x04

type RealTime

type RealTime struct {
	Now DateTime `json:"now,string"`
	// contains filtered or unexported fields
}

RealTime ..

func (*RealTime) DumpData

func (e *RealTime) DumpData() ([]byte, error)

DumpData RealTime

func (*RealTime) LoadBinary

func (e *RealTime) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary RealTime Table A.8, Code 0x00

type RecoderID

type RecoderID struct {
	CCC     string   `json:"CCC"`
	Version string   `json:"version"`
	Dop     DateTime `json:"dop,string"`
	Sn      uint32   `json:"sn"`
	Comment []uint8  `json:"comment"`
	// contains filtered or unexported fields
}

RecoderID ..

func (*RecoderID) DumpData

func (e *RecoderID) DumpData() ([]byte, error)

DumpData RecoderID

func (*RecoderID) LoadBinary

func (e *RecoderID) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary RecoderID Table A.11, Code 0x08

type SpeedLog

type SpeedLog struct {
	Records []SpeedLogRecord `json:"records"`
	// contains filtered or unexported fields
}

SpeedLog ..

func (*SpeedLog) DumpData

func (e *SpeedLog) DumpData() ([]byte, error)

DumpData SpeedLog

func (*SpeedLog) LoadBinary

func (e *SpeedLog) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary SpeedLog Table A.16, Code 0x08

type SpeedLogRecord

type SpeedLogRecord struct {
	Start         DateTime      `json:"start,string"`
	SpeedStatuses []SpeedStatus `json:"speed_statuses"`
}

SpeedLogRecord ...

func (*SpeedLogRecord) DumpData

func (e *SpeedLogRecord) DumpData() ([]byte, error)

DumpData SpeedLogRecord

func (*SpeedLogRecord) LoadBinary

func (e *SpeedLogRecord) LoadBinary(buffer []byte)

LoadBinary SpeedLogRecord Table A.17

type SpeedStatus

type SpeedStatus struct {
	Speed  uint8  `json:"speed"`
	Status Status `json:"status"`
}

SpeedStatus ...

func (*SpeedStatus) DumpData

func (e *SpeedStatus) DumpData() ([]byte, error)

DumpData SpeedStatus

func (*SpeedStatus) LoadBinary

func (e *SpeedStatus) LoadBinary(buffer []byte)

LoadBinary SpeedStatus

type SpeedStatusLog

type SpeedStatusLog struct {
	Records []SpeedStatusLogRecord `json:"records"`
	// contains filtered or unexported fields
}

SpeedStatusLog ..

func (*SpeedStatusLog) DumpData

func (e *SpeedStatusLog) DumpData() ([]byte, error)

DumpData SpeedStatusLog

func (*SpeedStatusLog) LoadBinary

func (e *SpeedStatusLog) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary SpeedLog Table A.16, Code 0x08

type SpeedStatusLogRecord

type SpeedStatusLogRecord struct {
	Status     HexUint8 `json:"status"` // 0x01: normal; 0x02: error;
	Start      DateTime `json:"start,string"`
	End        DateTime `json:"end,string"`
	Speeds     []int    `json:"speeds"`
	SpeedsGNSS []int    `json:"speeds_gnss"`
}

SpeedStatusLogRecord ...

func (*SpeedStatusLogRecord) DumpData

func (e *SpeedStatusLogRecord) DumpData() ([]byte, error)

DumpData SpeedStatusLogRecord

func (*SpeedStatusLogRecord) LoadBinary

func (e *SpeedStatusLogRecord) LoadBinary(buffer []byte)

LoadBinary DriverLogRecord Table A.25

type StandardVersion

type StandardVersion struct {
	Year   uint8    `json:"year"`
	Update HexUint8 `json:"update"`
	// contains filtered or unexported fields
}

StandardVersion ...

func (*StandardVersion) DumpData

func (e *StandardVersion) DumpData() ([]byte, error)

DumpData StandardVersion

func (*StandardVersion) LoadBinary

func (e *StandardVersion) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary StandardVersion Table A.6, Code 0x00

type Status

type Status [8]bool

Status ...

func (*Status) DumpData

func (e *Status) DumpData() (byte, error)

DumpData DateTime

func (*Status) LoadBinary

func (e *Status) LoadBinary(buffer byte)

LoadBinary Status Table A.8, Code 0x02

type StatusSignalConfig

type StatusSignalConfig struct {
	Now    DateTime   `json:"now,string"`
	Config [][]string `json:"config"`
	// contains filtered or unexported fields
}

StatusSignalConfig ..

func (*StatusSignalConfig) DumpData

func (e *StatusSignalConfig) DumpData() ([]byte, error)

DumpData StatusSignalConfig

func (*StatusSignalConfig) LoadBinary

func (e *StatusSignalConfig) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary StatusSignalConfig Table A.12, Code 0x06

type VehicleInfo

type VehicleInfo struct {
	ID        string `json:"id"`
	Plate     string `json:"plate"`
	PlateType string `json:"plate_type"`
	// contains filtered or unexported fields
}

VehicleInfo ..

func (*VehicleInfo) DumpData

func (e *VehicleInfo) DumpData() ([]byte, error)

DumpData VehicleInfo

func (*VehicleInfo) LoadBinary

func (e *VehicleInfo) LoadBinary(buffer []byte, meta dataBlockMeta)

LoadBinary PulseFactor Table A.11, Code 0x05

Jump to

Keyboard shortcuts

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