Documentation ¶
Index ¶
- Constants
- func DecodeBig5(s []byte) ([]byte, error)
- func DecodeGBK(s []byte) ([]byte, error)
- func DecodeGBKStr(s []byte) (string, error)
- func DecodeHZGB2312(s []byte) ([]byte, error)
- func EncodeBig5(s []byte) ([]byte, error)
- func EncodeGBK(s []byte) ([]byte, error)
- func EncodeHZGB2312(s []byte) ([]byte, error)
- type AccidentLog
- type AccidentLogRecord
- type ConfigChangeLog
- type ConfigChangeLogRecord
- type DateTime
- type DriverInfo
- type DriverLog
- type DriverLogRecord
- type ExportRecord
- type ExternalPowerLog
- type ExternalPowerLogRecord
- type HexUint8
- type Odometer
- type OvertimeLog
- type OvertimeLogRecord
- type Position
- type PositionLog
- type PositionLogRecord
- type PulseFactor
- type RealTime
- type RecoderID
- type SpeedLog
- type SpeedLogRecord
- type SpeedStatus
- type SpeedStatusLog
- type SpeedStatusLogRecord
- type StandardVersion
- type Status
- type StatusSignalConfig
- type VehicleInfo
Constants ¶
const LengthAccidentRecord = 234
LengthAccidentRecord ...
const LengthDriverLogRecord = 25
LengthDriverLogRecord ...
const LengthMetadata = 23
LengthMetadata ...
const LengthOvertimeLogRecord = 50
LengthOvertimeLogRecord ...
const LengthPosition = 10
LengthPosition ...
const LengthPositionLogRecord = 666
LengthPositionLogRecord ...
const LengthSpeedLogRecord = 126
LengthSpeedLogRecord ...
const LengthSpeedStatus = 2
LengthSpeedStatus ...
const LengthSpeedStatusLogRecord = 133
LengthSpeedStatusLogRecord ...
const LengthStatusName = 10
LengthStatusName ...
const OdometerMultiplier = 10
OdometerMultiplier ...
const PositionMultiplier = 10000.0 * 60
PositionMultiplier ...
Variables ¶
This section is empty.
Functions ¶
func DecodeGBKStr ¶
DecodeGBKStr convert GBK to UTF-8 String
func DecodeHZGB2312 ¶
DecodeHZGB2312 convert GBK to UTF-8
func EncodeHZGB2312 ¶
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 ¶
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 ¶
DateTime ...
func (*DateTime) DumpDataShort ¶
DumpDataShort DateTime
func (*DateTime) LoadBinary ¶
LoadBinary RealTime Table A.8, Code 0x02
func (*DateTime) LoadBinaryShort ¶
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) LoadBinary ¶
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
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 ¶
MarshalJSON HexUint8
func (*HexUint8) UnmarshalJSON ¶
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) LoadBinary ¶
LoadBinary RealTime Table A.9, Code 0x03
type OvertimeLog ¶
type OvertimeLog struct { Records []OvertimeLogRecord `json:"records"` // contains filtered or unexported fields }
OvertimeLog ..
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 ...
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) LoadBinary ¶
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) LoadBinary ¶
LoadBinary RecoderID Table A.11, Code 0x08
type SpeedLog ¶
type SpeedLog struct { Records []SpeedLogRecord `json:"records"` // contains filtered or unexported fields }
SpeedLog ..
func (*SpeedLog) LoadBinary ¶
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 ¶
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) LoadBinary ¶
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