#api-bindings #bindings #api

tinkerforge

Rust API bindings for https://www.tinkerforge.com Bricks and Bricklets

21 stable releases

2.0.21 Feb 27, 2024
2.0.20 May 11, 2022
2.0.19 Aug 26, 2021
2.0.18 May 27, 2021
2.0.5 Nov 21, 2018

#106 in Hardware support

Download history 4/week @ 2024-02-20 149/week @ 2024-02-27 6/week @ 2024-03-05 8/week @ 2024-03-12 1/week @ 2024-03-19 1/week @ 2024-03-26 11/week @ 2024-04-02 68/week @ 2024-04-09 1/week @ 2024-04-23

292 downloads per month

CC0-1.0 OR MIT OR Apache-2.0

5MB
56K SLoC

Tinkerforge Rust Bindings

Latest version Documentation Minimum rustc version License

This crate provides API bindings for Tinkerforge bricks and bricklets.

How to install

Add tinkerforge = "2.0" to the [dependencies] of your project's Cargo.toml.

How to use

First, import the IP connection and any devices you want to use:

use tinkerforge::{ip_connection::*, temperature_bricklet::*}

You can than create instances like this:

let ipcon = IpConnection::new();
let t = TemperatureBricklet::new("UID", &ipcon);

where "UID" is the unique identifier of your brick or bricklet. Once the IP connection is established using:

ipcon.connect((HOST, PORT)).recv()??;

you can use the device's API, for example:

let temperature = t.get_temperature().recv()? as f32 / 100.0;

Further examples can be found here.

Rust version requirements

The bindings require the rust compiler in version 1.41 or higher.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be triple licensed as above, without any additional terms or conditions.

Dependencies

~1MB
~21K SLoC