Documentation ¶
Index ¶
- Constants
- type Bus
- type Device
- func (s *Device) Connect() ([]byte, error)
- func (s *Device) ConnectForce(serial []byte) ([]byte, error)
- func (s *Device) Disconnect()
- func (s *Device) GetDeviceSerial() ([]byte, error)
- func (s *Device) GetSystemTime() (uint64, error)
- func (s *Device) SendCommand(cmd MessageType, payload []byte, timeout int) ([]byte, error)
- func (s *Device) TestComm() error
- type Error
- type MessageType
Constants ¶
View Source
const ( ErrorTimeout = Error("Command Timeout") ErrorNack = Error("Command rejected") ErrorSyncFailed = Error("Invaild sync response") ErrorNotConnected = Error("Not connected") )
View Source
const AddressDefault = 0xFF
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
func CreateProtocol ¶
func CreateProtocol(port io.ReadWriteCloser, key []byte) *Bus
func (*Bus) CloseProtocol ¶
func (*Bus) GetDefaultDevice ¶
func (*Bus) ProtocolHandler ¶
func (*Bus) SetUnsolicitedHandler ¶
func (s *Bus) SetUnsolicitedHandler(cb func(msgType MessageType, buf []byte))
type Device ¶
func (*Device) Disconnect ¶
func (s *Device) Disconnect()
func (*Device) GetDeviceSerial ¶
func (*Device) GetSystemTime ¶
func (*Device) SendCommand ¶
type MessageType ¶
type MessageType byte
Click to show internal directories.
Click to hide internal directories.