Skip to main content

Crate ql_quec

Crate ql_quec 

Expand description

Rust client for Quectel’s QMI Common Service (quec_common).

quec_common (QMI service 0xE3) is a Quectel extension that runs in the modem firmware. It holds settings that Qualcomm’s services don’t have. This crate covers the indication filter, which replaces QL_NW_ForbidInd of Quectel’s libql_common_api.

EVA and EVD firmware share these messages. The crate only uses fields that both have. Both have IDL version 1.1.

§Example

use std::error::Error;

use ql_quec::{Client, Services};

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn Error>> {
    let (client, connection) = Client::builder().connect()?;
    tokio::spawn(connection.run());
    // Before sleep.
    client.forbid_indications(Services::NAS).await?;
    // After wake up, and once at startup.
    client.forbid_indications(Services::empty()).await?;
    Ok(())
}

Client has a method for every request of this crate. Each request method returns the request, so you can set a timeout with .timeout() before you await it. Client::qmi returns the typed ql_qmi::Client for custom requests.

§Indication filter

The modem drops indications of a forbidden service. This is meant to reduce wake ups of the application processor while it sleeps. Services lists which bits were found in the modem firmware.

The filter is global modem state. On EVA and EVD a filter set by a client that then disconnected still applied to another client. With Services::WDS forbidden, the client that started a data call didn’t receive any indication of its packet service status, and rmnet_data0 didn’t get the address of the call within 15 s. According to disassembly of the firmware, only a modem restart resets the filter. That part is untested. A process that forbids indications must clear the filter again when it wakes up and once when it starts, in case it exited while the filter was set.

According to disassembly, each call replaces the whole mask and there is no request to read the mask back. Any process can set it, also through Quectel’s QL_NW_ForbidInd. Let one process own the filter.

Forbid as little as possible. According to disassembly, Services::WDS also hides a data call that ends from every client, including netmgrd.

The client runs on tokio. See ql_qmi for the runtime and permission requirements.

Modules§

client 🔒
indication_filter 🔒
services 🔒

Structs§

Client
Client of the common service.
ForbidIndications
Sets the indication filter of the modem (QMI_COMM_QMI_FORBID_IND).
Quec
Marker of the common service for ql_qmi::Client.
Services
Services whose indications the modem drops.