Module mcm

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_print
  • mcm_client_init (libmcm)
  • ql_mcm_required_service_updown
  • ql_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:

  1. Locks a global mutex
  2. Checks if a global mcm_client_handle_type static variable is set
  3. If not set, waits for /tmp/mcm_service_ready.flag to exist
    • Performs up to 1000 checks, 10 ms apart
    • Returns INTERNAL if the file doesn’t appear
  4. Calls mcm_client_init with the global client handle variable
  5. 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:

  1. Calls ql_mcm_required_service_updown to start the corresponding service
  2. 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§

ErrorCodeDeprecated