Module mcm
Expand description
Contains the ql_mcm_*.h headers.
See: <ql_mcm.h>
MCM is preferred over the older APIs according to Quectel. This is weird because MCM uses QMI in the background…
§Notes on QL_MCM_Client_Init
This function is not directly bound; the following notes document its behavior.
§Dependencies
This function calls out to the following:
ql_log_printmcm_client_init(libmcm)ql_mcm_required_service_updownql_file_exist
§Initialization flow
The library maintains a static array of per-client-type metadata. One field
indicates whether the client type has already been initialized. If so, the
function returns immediately without writing to the provided
mcm_client_handle_type pointer.
If the client hasn’t been initialized, the function:
- Locks a global mutex
- Checks if a global
mcm_client_handle_typestatic variable is set - If not set, waits for
/tmp/mcm_service_ready.flagto exist- Performs up to 1000 checks, 10 ms apart
- Returns
INTERNALif the file doesn’t appear
- Calls
mcm_client_initwith the global client handle variable - Unlocks the mutex
Note: The library internally uses a single MCM client handle regardless of client type.
§Service-specific logic
For SERVICE_DATA, SERVICE_LOC, SERVICE_MOBILEAP,
SERVICE_ATCOP (id 0x0A), and SERVICE_SIM, the function:
- Calls
ql_mcm_required_service_updownto start the corresponding service - Waits for a service-specific flag file (1000 checks, 10 ms apart):
/tmp/mcm_data_service_ready.flag/tmp/mcm_loc_service_ready.flag/tmp/mcm_mobileap_service_ready.flag/tmp/mcm_atcop_service_ready.flag/tmp/mcm_sim_service_ready.flag
Note: ql_mcm_required_service_updown does not interact with Linux
processes; it uses mcm_client_execute_command_sync to interact with the
modem firmware. The creator of these flag files is currently unknown.
§Performance implications
This function can block for extended periods in the worst case, with potential waits of up to 10 seconds per flag file. Use with caution in performance-sensitive contexts.
Re-exports§
pub use self::common::Error;
Modules§
- atc
- MCM AT command API.
- common
- Common MCM types.
- data
- MCM Data API.
- nw
- MCM Network API.
- sim
- MCM SIM API.
- sms
- See: <ql_mcm_sms.h>
Constants§
- MAGIC_
MSG_ ID_ SERVICE_ DOWN - MAGIC_
MSG_ ID_ SERVICE_ UP - SERVICE_
ATC - SERVICE_
CLIENT - SERVICE_
DATA - SERVICE_
DM - SERVICE_
LOC - SERVICE_
MAX - SERVICE_
MOBILEAP - SERVICE_
NOT_ REQUIRED - SERVICE_
NW - SERVICE_
REQUIRED - SERVICE_
SIM - SERVICE_
SMS - SERVICE_
VCALL
Type Aliases§
- Error
Code Deprecated