Documentation
¶
Index ¶
- Constants
- Variables
- type GPSData
- type Heartbeat
- type IntelliTracAProtocol
- func (t *IntelliTracAProtocol) ConsumeStream(reader *bufio.Reader, writer io.Writer, store store.Store) error
- func (t *IntelliTracAProtocol) GetDeviceID() string
- func (t *IntelliTracAProtocol) GetDeviceType() types.DeviceType
- func (t *IntelliTracAProtocol) GetProtocolType() types.DeviceProtocolType
- func (t *IntelliTracAProtocol) Login(reader *bufio.Reader) ([]byte, int, error)
- func (t *IntelliTracAProtocol) SendCommandToDevice(writer io.Writer, command string) error
- func (t *IntelliTracAProtocol) SetDeviceType(dt types.DeviceType)
- type PositionRecord
Constants ¶
View Source
const ( PreambleSize = 4 BinaryHeartbeatSize = 22 ASCIIHeartbeatSize = 8 BinaryAckSize = 6 BinaryPositionHeaderSize = 12 )
Protocol constants
View Source
const ( MsgEncodingBinaryPos = 0x00 MsgEncodingText = 0x02 MsgEncodingGarminText = 0x03 MsgEncodingATCommand = 0x01 MsgTypeRequest = 0x00 MsgTypeResponse = 0x01 MsgTypeAsync = 0x02 MsgTypeAck = 0x03 )
Message types
View Source
const ( IgnitionStatus = 0 Input1Status = 1 Input2Status = 2 Input3Status = 3 Input4Status = 4 Output1Status = 8 Output2Status = 9 Output3Status = 10 )
I/O Status bits (from page 11)
View Source
const ( EngineStatus = 0 MotionStatus = 1 )
Vehicle Status bits (from page 11)
Variables ¶
View Source
var ( ErrInvalidHeartbeat = errors.New("invalid heartbeat format") ErrUnsupportedMsgType = errors.New("unsupported message type") ErrInvalidPositionData = errors.New("invalid position data") ErrChecksumMismatch = errors.New("checksum mismatch") ErrInvalidLogin = errors.New("invalid login") )
Functions ¶
This section is empty.
Types ¶
type IntelliTracAProtocol ¶
type IntelliTracAProtocol struct {
Imei string
DeviceType types.DeviceType
IsBinary bool
}
func (*IntelliTracAProtocol) ConsumeStream ¶
func (*IntelliTracAProtocol) GetDeviceID ¶
func (t *IntelliTracAProtocol) GetDeviceID() string
func (*IntelliTracAProtocol) GetDeviceType ¶
func (t *IntelliTracAProtocol) GetDeviceType() types.DeviceType
func (*IntelliTracAProtocol) GetProtocolType ¶
func (t *IntelliTracAProtocol) GetProtocolType() types.DeviceProtocolType
func (*IntelliTracAProtocol) SendCommandToDevice ¶
func (t *IntelliTracAProtocol) SendCommandToDevice(writer io.Writer, command string) error
func (*IntelliTracAProtocol) SetDeviceType ¶
func (t *IntelliTracAProtocol) SetDeviceType(dt types.DeviceType)
type PositionRecord ¶
type PositionRecord struct {
TransactionID uint16
ModemID string
MessageID uint16
DataLength uint16
GPS GPSData
Odometer uint32
HDOP uint8
Satellites uint8
IOStatus uint16
VehicleStatus uint8
AnalogInput1 float32
AnalogInput2 float32
RTC time.Time
PositionSending time.Time
EventData []byte
RawData string
AdditionalMetrics map[uint16]interface{}
}
func (*PositionRecord) ToDeviceStatus ¶
func (p *PositionRecord) ToDeviceStatus(imei string) *types.DeviceStatus
Click to show internal directories.
Click to hide internal directories.