https://github.com/bl3tt3r/dtiw385
Rust crate to discover and control Orange DTIW385 decoders over the network.
https://github.com/bl3tt3r/dtiw385
api crate dtiw385 orange rust
Last synced: about 2 months ago
JSON representation
Rust crate to discover and control Orange DTIW385 decoders over the network.
- Host: GitHub
- URL: https://github.com/bl3tt3r/dtiw385
- Owner: bl3tt3r
- License: mit
- Created: 2026-03-14T16:01:32.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2026-04-25T11:10:37.000Z (about 2 months ago)
- Last Synced: 2026-04-25T13:14:55.815Z (about 2 months ago)
- Topics: api, crate, dtiw385, orange, rust
- Language: Rust
- Homepage: https://crates.io/crates/dtiw385
- Size: 79.1 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# dtiw385
[](./LICENSE)



This crate provides a Rust API to interact with [๐ Orange](https://www.orange.fr/) DTIW385 decoders, allowing device discovery, querying device information, and sending asynchronous remote control commands over the network.
__This project is not affiliated with, endorsed by, or sponsored by Orange.__
---
## ๐ฆ Installation
Add this to your `Cargo.toml`:
### ๐ฆ From crates.io (recommended)
```toml
[dependencies]
dtiw385 = "0.1.2"
```
__Or run the following Cargo command in your project directory: `cargo add dtiw385`__
### ๐น From Git (latest development version)
```toml
[dependencies]
dtiw385 = { git = "https://github.com/bl3tt3r/dtiw385", branch = "master" }
```
### ๐ From a tagged release
```toml
[dependencies]
dtiw385 = { git = "https://github.com/bl3tt3r/dtiw385", tag = "v0.1.2" }
```
---
## ๐งฉ Features
| Feature | Description |
| -------------- | ----------------------------------------------------- |
| `serializable` | Enable serialization of `Decoder` and `ApiInfosData`. |
---
## ๐ Usage
The library provides two main ways to work with decoders.
### ๐ Connect to a known decoder
If you already know the IP and port, you can create a decoder directly:
```rust
use dtiw385::Decoder;
let decoder = Decoder::new([192, 168, 1, 10], 8080);
```
You can then send commands to the device (button actions like press, hold, release).
---
### ๐ Discover decoders on the network
Scan a range of IPs and ports to find available devices:
```rust
use dtiw385::Decoders;
// Receiver of discovered decoders
let mut rx = Decoders::search(
[192, 168, 1, 1]..=[192, 168, 1, 254],
8080..=8080,
)
.find();
```
Each discovered decoder is sent through the receiver.
---
### ๐ฎ Interact with a decoder
#### ๐น Keys
The library provides a `Key` enum with most common remote control buttons already mapped.
Each key is internally converted to a Linux input event code (`u16`) when sent to the decoder.
You can use these keys directly with:
- `press`
- `hold`
- `release`
---
##### ๐ Available keys
| Key | Description |
| ------------- | ------------------ |
| `PowerOnOff` | Power toggle |
| `Ok` | Validate selection |
| `Up` | Navigate up |
| `Down` | Navigate down |
| `Left` | Navigate left |
| `Right` | Navigate right |
| `Back` | Go back |
| `Menu` | Open menu |
| `VolumeUp` | Increase volume |
| `VolumeDown` | Decrease volume |
| `Mute` | Mute sound |
| `ChannelUp` | Next channel |
| `ChannelDown` | Previous channel |
| `Play` | Play |
| `Pause` | Pause |
| `Stop` | Stop |
| `Forward` | Fast forward |
| `Rewind` | Rewind |
| `N0` | Number 0 |
| `N1` | Number 1 |
| `N2` | Number 2 |
| `N3` | Number 3 |
| `N4` | Number 4 |
| `N5` | Number 5 |
| `N6` | Number 6 |
| `N7` | Number 7 |
| `N8` | Number 8 |
| `N9` | Number 9 |
#### ๐งช Example
```rust
use dtiw385::{Decoder, Key};
let decoder = Decoder::new([192, 168, 1, 10], 8080);
decoder.press(Key::Ok).await?;
decoder.hold(Key::VolumeUp).await?;
decoder.release(Key::VolumeUp).await?;
```
---
## โ๏ธ Configuration
### ๐ Concurrency
```rust
Decoders::search(ip_range, port_range)
.with_concurrency(50);
```
* **Higher value** = faster scan โก
* **But more CPU and network usage ๐ฅ**
---
### โฑ๏ธ Timeout
```rust
Decoders::search(ip_range, port_range)
.with_timeout(500);
```
* **Timeout** is in milliseconds
* **Lower** = faster failure
* **Higher** = more reliable but slower
---
## ๐ Examples
Examples are available in the `examples/` folder.
- [find_available_decoders](examples/find_available_decoders.rs)
- [get_decoder_infos](examples/get_decoder_infos.rs)
- [switch_decoder_power](examples/switch_decoder_power.rs)
Run one with:
```bash
cargo run --example get_decoder_infos
```
---
License: MIT
---
Made with โค๏ธ and Rust ๐ฆ