Python bindings for the TOSUN TSCAN API
Project description
tscan.lib
tscan.lib provides Python bindings for the TOSUN TSCAN API. The Python import package remains libTSCANAPI for compatibility with existing applications.
Requirements
- Python 3.6 or newer.
- Windows x86, Windows x64, or Linux x64.
- A supported TOSUN TSCAN device.
Installation
Install the package with pip:
python -m pip install tscan.lib
For offline environments, install the package file provided by TOSUN:
python -m pip install <package-file>
Basic Usage
from ctypes import c_int32
from libTSCANAPI import finalize_lib_tscan, initialize_lib_tscan, tscan_scan_devices
initialize_lib_tscan(True, True, False)
device_count = c_int32(0)
result = tscan_scan_devices(device_count)
print("scan result:", result)
print("device count:", device_count.value)
finalize_lib_tscan()
Platform Notes
- Windows supports the core TSCAN APIs and BLF APIs.
- Linux supports the core TSCAN APIs. BLF APIs are disabled on Linux and return a controlled unavailable result.
- If Linux device connection returns a permission error, install the udev rule from
libTSCANAPI/rules/99-tosun.rules.
Optional Integrations
To use the libtosun interface through python-can, set IS_ADD_PYTHON_CAN in libTSCANAPI/config.py to True, then import libTSCANAPI once.
To enable TOSUN-specific DBC parsing for automatic CAN and CAN FD message creation, set IS_ADD_CANTOOLS in libTSCANAPI/config.py to True, then import libTSCANAPI once.
Keep both options disabled unless the integration is required by your application.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file tscan_lib-1.5.3.tar.gz.
File metadata
- Download URL: tscan_lib-1.5.3.tar.gz
- Upload date:
- Size: 21.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cfe979410cd2472a624bd7a32e399c9f4bb5d3f83b6839e359940b87f0ad6bc
|
|
| MD5 |
78dc19a7150aeb00bb2769f016a54706
|
|
| BLAKE2b-256 |
2375115fe3d009ceb6c244c90e4f6ef810e3a3623ee1fc165868949b3b323f91
|