🚀 A Rust library for interacting with ZTE devices, such as the GigaCube ZTE MF289F.
- GigaCube ZTE MF289F
- 🔄 Device Reboot
- 📊 Device Status Information / Monitoring
- 📡 Connect and Disconnect Network
- 🔀 Set Connection Mode
- 🛡️ Set Bearer Preference
- 🔒 Set LTE Band Lock
- 🌐 Set DNS mode configuration
- 📶 Set WiFi Coverage
- 🔌 Configure UPnP
- 🌐 Configure DMZ
- ♻️ Manage Auto Update
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:
- Fork the repository: Click the "Fork" button at the top right of this page.
- Clone your fork:
git clone https://github.com/yourusername/zte-cpe-rs.git cd zte-cpe-rs
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes: Implement your feature or fix the bug.
- Commit your changes:
git commit -am 'Add a meaningful commit message'
- Push to your branch:
git push origin feature/your-feature-name
- Open a Pull Request: Go to the original repository and click the "New Pull Request" button.
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.