Struct Client
pub struct Client {
qmi: Client<Uim>,
}Expand description
Client of the UIM service.
Its Connection must run for requests to complete.
Cloning the client is cheap. Dropping every clone stops the connection.
Fields§
§qmi: Client<Uim>Implementations§
§impl Client
impl Client
pub const fn builder() -> ClientBuilder<Uim, Self>
pub const fn builder() -> ClientBuilder<Uim, Self>
Returns a builder for the client, for example to change the request timeout.
pub fn card_status(&self) -> RequestBuilder<'_, CardStatus>
pub fn card_status(&self) -> RequestBuilder<'_, CardStatus>
Reads the status of all card slots. Sends GetCardStatus.
pub fn event_reg(
&self,
request: &EventReg,
) -> RequestBuilder<'_, RegisteredEvents>
pub fn event_reg( &self, request: &EventReg, ) -> RequestBuilder<'_, RegisteredEvents>
Sets which indications the modem sends to this client. Sends
EventReg.
pub fn events(&self) -> Result<Indications<StatusChange>, Error>
pub fn events(&self) -> Result<Indications<StatusChange>, Error>
Subscribes to card status changes.
Only indications received after this call are delivered. Subscribe
before you enable them with Client::event_reg, otherwise the first
ones are lost.
§Errors
Returns ql_qmi::Error::Disconnected if the connection has stopped.
pub const fn qmi(&self) -> &Client<Uim>
pub const fn qmi(&self) -> &Client<Uim>
Returns the typed QMI client, for example to send a custom request.
pub fn read_iccid(
&self,
slot: Slot,
) -> RequestBuilder<'_, Transparent, Result<Iccid, Error>>
pub fn read_iccid( &self, slot: Slot, ) -> RequestBuilder<'_, Transparent, Result<Iccid, Error>>
Reads the ICCID of the card in slot. Sends ReadTransparent::iccid.
§Errors
Returns the errors of Client::read_transparent, or
Error::InvalidIccid if the file doesn’t contain a valid ICCID.
pub async fn read_imsi(&self) -> Result<Imsi, Error>
pub async fn read_imsi(&self) -> Result<Imsi, Error>
Reads the IMSI of the application in the primary GSM or UMTS session.
This sends GetCardStatus to find the type of the application, and
then reads the file with ReadTransparent::imsi.
§Errors
Returns Error::NoPrimaryGwApp if the session has no application,
an error if a request fails, or Error::InvalidImsi if the file
doesn’t contain a valid IMSI.
pub fn read_transparent(
&self,
request: &ReadTransparent<'_>,
) -> RequestBuilder<'_, Transparent, Result<Transparent, Error>>
pub fn read_transparent( &self, request: &ReadTransparent<'_>, ) -> RequestBuilder<'_, Transparent, Result<Transparent, Error>>
Reads a transparent file and checks the status word of the card. Sends
ReadTransparent.
If the card refuses the read, it returns Error::Card with the status
word instead of a plain rejection.
§Errors
Returns an error if the request fails, Error::Card if the card
reports an error status word, or Error::NoContent if the response
has no content.