switchtec-user-sys

A Rust wrapper for the switchtec-user
library.
Details and usage instructions for the switchtec-user
library can be found here.
Example Usage
The examples below use the [SwitchtecDevice
] and [CStrExt
] types introduced by this library, including functions from the switchtec-user
C library that this crate wraps.
Get pciswitch device name and temperature
Example using the switchtec_name
and switchtec_die_temp
functions provided by the switchtec-user
library
use env;
use ;
Get status for each port for a pciswitch device
A more complex example using an out-value struct with switchtec_status
use env;
use io;
use ptr;
use ;
Dependencies
Bindgen & Clang
This crate uses bindgen
which requires Clang to build: bindgen
requirements
Switchtec submodule
In order to build the bindgen
bindings and link the library to the switchtec-user
C library, the switchtec-user
submodule needs to be present. The build.rs
script will automatically init the submodule, but you can also do this like:
git submodule update --init
License
switchtec-user-sys
is both MIT and Apache License, Version 2.0 licensed, as found
in the LICENSE-MIT and LICENSE-APACHE files.