Documentation
¶
Overview ¶
Package drewtech provides a client for DrewTech J2534 devices
Index ¶
- Constants
- type CANFrame
- type Device
- func (d *Device) Close() error
- func (d *Device) GetChannelConfig(param uint32) (uint32, error)
- func (d *Device) GetConfig(param uint32) (uint32, error)
- func (d *Device) GetDeviceInfo(param uint16) error
- func (d *Device) GetFirmwareVersion() (string, error)
- func (d *Device) GetSerial() (string, error)
- func (d *Device) GetStatus() error
- func (d *Device) Init() error
- func (d *Device) Open(portName string) error
- func (d *Device) PassThruClose() error
- func (d *Device) PassThruConnect(baudRate uint32) error
- func (d *Device) PassThruDisconnect() error
- func (d *Device) PassThruOpen() error
- func (d *Device) PassThruStartMsgFilter() error
- func (d *Device) PassThruStopMsgFilter() error
- func (d *Device) PassThruWriteMsgs(canID uint32, data []byte) error
- func (d *Device) SetChannelConfig(param, value uint32) error
- type FirmwareInfo
- type Option
- type Packet
- type Parser
- type Version
Constants ¶
const ( MagicByte uint8 = 0x51 ChecksumXOR uint8 = 0xE6 DirectionOut uint8 = 0x01 DirectionIn uint8 = 0x00 FlagRequest uint8 = 0x01 FlagRequestFinal uint8 = 0x00 FlagResponse uint8 = 0x81 FlagResponseFinal uint8 = 0x80 SubCmdInit uint8 = 0x00 SubCmdGetVersion uint8 = 0x03 SubCmdClose uint8 = 0x05 SubCmdConnect uint8 = 0x06 SubCmdDisconnect uint8 = 0x07 SubCmdCANTx uint8 = 0x08 SubCmdCANRx uint8 = 0x09 SubCmdSetConfig uint8 = 0x0B SubCmdGetConfig uint8 = 0x0C SubCmdStartMsgFilter uint8 = 0x0D SubCmdStopMsgFilter uint8 = 0x10 SubCmdGetStatus uint8 = 0x11 SubCmdSetProtocol uint8 = 0x12 SubCmdGetSerial uint8 = 0x13 ProtocolCAN uint32 = 6 ParamDataRate uint32 = 0x04 ParamBitSamplePoint uint32 = 0x14 ParamSyncJumpWidth uint32 = 0x15 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device represents a DrewTech J2534 device
func (*Device) GetChannelConfig ¶
GetChannelConfig gets a config parameter from the current channel
func (*Device) GetDeviceInfo ¶
func (*Device) GetFirmwareVersion ¶
func (*Device) PassThruClose ¶
PassThruClose closes the device connection
func (*Device) PassThruConnect ¶
PassThruConnect connects to CAN bus
func (*Device) PassThruDisconnect ¶
PassThruDisconnect disconnects from CAN bus
func (*Device) PassThruOpen ¶
PassThruOpen performs the full device initialization sequence
func (*Device) PassThruStartMsgFilter ¶
PassThruStartMsgFilter starts a pass-all filter
func (*Device) PassThruStopMsgFilter ¶
PassThruStopMsgFilter stops the current filter
func (*Device) PassThruWriteMsgs ¶
PassThruWriteMsgs transmits a CAN frame
func (*Device) SetChannelConfig ¶
SetChannelConfig sets a config parameter on the current channel
type FirmwareInfo ¶
func ExtractVersions ¶
func ExtractVersions(data []byte) FirmwareInfo
type Option ¶
type Option func(*Device)
Option configures the device
func WithCANChannel ¶
WithCANChannel sets a channel for receiving CAN frames
func WithCANFrameHandler ¶
WithCANFrameHandler sets the CAN frame callback
func WithErrorHandler ¶
WithErrorHandler sets the error callback
type Packet ¶
Packet represents a protocol packet