Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tscan_lib-1.5.2.tar.gz (21.4 MB view details)

Uploaded Source

File details

Details for the file tscan_lib-1.5.2.tar.gz.

File metadata

  • Download URL: tscan_lib-1.5.2.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

Hashes for tscan_lib-1.5.2.tar.gz
Algorithm Hash digest
SHA256 d973f42cfd71089e65fdc5d345791d1d3e767378f8554c3c9f068d5ada7a7d0d
MD5 61174376cf36adccb3eef37d63c2561b
BLAKE2b-256 99d8ff3e494fcb4cd1a037bf941deb0e32609fbfbef392bf5a6a05daab91aa95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page