Crates.io | zte-cpe-rs |
lib.rs | zte-cpe-rs |
version | 0.2.0 |
source | src |
created_at | 2024-10-18 15:29:04.785316 |
updated_at | 2024-10-18 23:42:00.901854 |
description | Control ZTE MF289F LTE CPE using Rust |
homepage | |
repository | https://github.com/1zun4/zte-cpe-rs/ |
max_upload_size | |
id | 1414383 |
size | 69,517 |
🚀 A Rust library for interacting with ZTE devices, such as the GigaCube ZTE MF289F.
More features coming soon...
Add this to your Cargo.toml
:
[dependencies]
zte-cpe-rs = "0.2.0"
Here's a basic example of how to use zte-cpe-rs
:
use std::collections::HashSet;
use anyhow::{Context, Result};
use zte_cpe_rs::{bands::LteBand, ZteClient};
#[tokio::main]
async fn main() -> Result<()> {
let mut zte_client = ZteClient::new("giga.cube")
.context("Failed to create ZteClient")?;
// Login
zte_client.login("YOURPASSWORD".to_string())
.await
.context("Failed to login")?;
// Disconnect network
zte_client.disconnect_network().await?;
// Connect network
zte_client.connect_network().await?;
// Get status
println!("{}", zte_client.get_status().await?);
// Set LTE band
let mut bands = HashSet::new();
bands.insert(LteBand::Band1);
bands.insert(LteBand::Band3);
bands.insert(LteBand::Band7);
zte_client.select_lte_band(Some(bands))
.await?;
// Logout
zte_client.logout().await?;
Ok(())
}
We welcome contributions! To get started, follow these steps:
git clone https://github.com/yourusername/zte-cpe-rs.git
cd zte-cpe-rs
git checkout -b feature/your-feature-name
git commit -am 'Add a meaningful commit message'
git push origin feature/your-feature-name
Please ensure your code adheres to the project's coding standards and includes appropriate tests.
Thank you for your contributions!
Clone the repository:
git clone https://github.com/1zun4/zte-cpe-rs.git
cd zte-cpe-rs
Build the project:
cargo build
Run tests:
cargo test
This project was inspired by and uses code from:
This project is licensed under the GNU GENERAL PUBLIC LICENSE.