Documentation
¶
Index ¶
Constants ¶
View Source
const ( RxChannelBufferSize = 1024 // 接收通道缓冲区大小 MsgBufferSize = 1024 // 消息缓冲区大小 PollingInterval = time.Millisecond // 轮询间隔 InitDelay = 20 * time.Millisecond // 初始化延迟 )
缓冲区和轮询配置常量
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CANDriver ¶
type CANDriver interface {
Init() error
Start()
Stop()
Write(id int32, data []byte) error
RxChan() <-chan UnifiedCANMessage
Context() context.Context
}
CANDriver 定义了CAN/CAN-FD驱动的统一接口
type ToomossAdapter ¶
type ToomossAdapter struct {
// contains filtered or unexported fields
}
ToomossAdapter 是连接 go-uds 和 Toomoss 硬件的适配器
func NewToomossAdapter ¶
func NewToomossAdapter(dev CANDriver) (*ToomossAdapter, error)
NewToomossAdapter 是适配器的构造函数
func (*ToomossAdapter) RxFunc ¶
func (t *ToomossAdapter) RxFunc() (tp_layer.CanMessage, bool)
RxFunc 是接收函数,它完全符合 go-uds 库的 `rxfn` 签名要求
func (*ToomossAdapter) TxFunc ¶
func (t *ToomossAdapter) TxFunc(msg tp_layer.CanMessage)
TxFunc 是发送函数,它完全符合 go-uds 库的 `txfn` 签名要求
Click to show internal directories.
Click to hide internal directories.