Expand description
§CANLink TSCan Backend
Safe Rust backend for LibTSCAN-backed CAN hardware. This crate implements
CanBackend from canlink-hal.
§Validation Scope
- Real-hardware regression in this repository is limited to TOSUN-related devices.
LibTSCANdocumentation lists more device types on the same backend path, but they are not individually validated here.- Future vendor-native SDK paths should land as separate backend crates.
§Requirements
- Windows 10/11 x64 (validated)
LibTSCANruntime (libTSCAN.dll+libTSCAN.lib)LibTSCANis not distributed by this project
§Quick Start
use canlink_hal::{BackendConfig, CanBackend, CanMessage};
use canlink_tscan::TSCanBackend;
let mut backend = TSCanBackend::new();
let config = BackendConfig::new("tscan");
backend.initialize(&config)?;
backend.open_channel(0)?;
let msg = CanMessage::new_standard(0x123, &[1, 2, 3, 4])?;
backend.send_message(&msg)?;
backend.close_channel(0)?;
backend.close()?;§TSCan Daemon Workaround (Vendor Bug)
To isolate a known vendor DLL hang in DISCONNECT_*, this crate supports an
out-of-process daemon path and enables it by default. See the crate README for
configuration details.
§Related Crates
canlink-hal- Core HALcanlink-tscan-sys-LibTSCANFFI bindingscanlink-cli- CLI tool
基于 LibTSCAN 的安全 Rust 后端,实现 canlink-hal 的 CanBackend。
§验证范围
- 当前仓库的实机回归仅覆盖同星 / TOSUN 相关硬件。
LibTSCAN文档列出的其他设备类型尚未逐项验证。- 若未来需要厂商原生 SDK 路径,应以新的独立后端 crate 落地。
§环境要求
- Windows 10/11 x64(已验证)
LibTSCAN运行库(libTSCAN.dll+libTSCAN.lib)- 本项目不分发
LibTSCAN文件
§快速开始
use canlink_hal::{BackendConfig, CanBackend, CanMessage};
use canlink_tscan::TSCanBackend;
let mut backend = TSCanBackend::new();
let config = BackendConfig::new("tscan");
backend.initialize(&config)?;
backend.open_channel(0)?;
let msg = CanMessage::new_standard(0x123, &[1, 2, 3, 4])?;
backend.send_message(&msg)?;
backend.close_channel(0)?;
backend.close()?;§TSCan 守护进程规避方案(厂商 DLL 问题)
为隔离 DISCONNECT_* 调用的厂商 DLL 卡死问题,本 crate 支持独立守护进程路径并默认启用。
具体配置见 crate README。
§相关包
canlink-hal- 核心 HALcanlink-tscan-sys-LibTSCANFFI 绑定canlink-cli- 命令行工具
Structs§
- Backend
Config - Backend configuration.
- Backend
Version - Backend version information.
- CanMessage
- Unified CAN message type.
- File
Config - File-based daemon configuration loaded from
canlink-tscan.toml. - Hardware
Capability - Hardware capability description.
- Message
Flags - CAN message flags.
- TSCan
Backend - CAN backend implementation for TOSUN
TSMasterdevices. - TSCan
Backend Factory - Factory used to create
TSCanBackendinstances throughcanlink-hal. - Timestamp
- Microsecond-precision timestamp.
- Tscan
Daemon Config - Effective daemon configuration merged from file and backend parameters.
Enums§
Traits§
- CanBackend
- CAN hardware backend interface.
Type Aliases§
- CanResult
- Result type alias for CAN operations.