1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! # canlink-tscan-sys
//!
//! Low-level FFI bindings to LibTSCAN for CAN hardware access.
//!
//! This crate provides unsafe, raw bindings to the LibTSCAN C API.
//! For a safe, high-level interface, use the `canlink-tscan` crate instead.
//!
//! ## Platform Support
//!
//! This crate currently only builds on Windows targets.
//! LibTSCAN documentation includes non-Windows artifacts, but this crate has not been verified or adapted there yet.
//!
//! ## Usage
//!
//! ```no_run
//! use canlink_tscan_sys::*;
//!
//! unsafe {
//! // Initialize library
//! initialize_lib_tscan(true, false, false);
//!
//! // Scan for devices
//! let mut device_count = 0;
//! tscan_scan_devices(&mut device_count);
//!
//! // Connect to default device
//! let mut handle = 0;
//! tscan_connect(std::ptr::null(), &mut handle);
//!
//! // ... use the device ...
//!
//! // Cleanup
//! tscan_disconnect_by_handle(handle);
//! finalize_lib_tscan();
//! }
//! ```
//!
//! ## Safety
//!
//! All functions in this crate are `unsafe` because they directly call C functions.
//! Callers must ensure:
//! - `initialize_lib_tscan()` is called before any other functions
//! - Device handles are valid
//! - Pointers are valid and properly aligned
//! - Buffers are large enough for the requested operations
//! - `finalize_lib_tscan()` is called when done
//!
//! ## Library Location
//!
//! The LibTSCAN.dll must be available in the system PATH or in the same directory
//! as the executable. Typically, it is located in the TSMaster installation
//! directory under `bin`, for example `TSMaster\\bin\\libTSCAN.dll`.
// Re-export everything for convenience
pub use *;
pub use *;