Skip to content

A Rust library for interacting with ZTE devices, such as the GigaCube ZTE MF289F.

License

Notifications You must be signed in to change notification settings

1zun4/zte-cpe-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zte-cpe-rs

🚀 A Rust library for interacting with ZTE devices, such as the GigaCube ZTE MF289F.

Supported Devices

  • GigaCube ZTE MF289F

Features

  • 🔄 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...

Installation

Add this to your Cargo.toml:

[dependencies]
zte-cpe-rs = "0.2.0"

Usage

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(())
}

Contributing

We welcome contributions! To get started, follow these steps:

  1. Fork the repository: Click the "Fork" button at the top right of this page.
  2. Clone your fork:
    git clone https://github.com/yourusername/zte-cpe-rs.git
    cd zte-cpe-rs
  3. Create a new branch:
    git checkout -b feature/your-feature-name
  4. Make your changes: Implement your feature or fix the bug.
  5. Commit your changes:
    git commit -am 'Add a meaningful commit message'
  6. Push to your branch:
    git push origin feature/your-feature-name
  7. 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!

Setup

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

Acknowledgements

This project was inspired by and uses code from:

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE.