View Source QMI (qmi v0.8.5)

Qualcomm MSM Interface in Elixir

This module lets you send and receive messages from a QMI-enabled cellular modem.

To use it, start a QMI.Supervisor in the supervision tree of your choosing and pass it a name and interface. After that, use the service modules to send it messages. For example:

# In your application's supervision tree
children = [
  #... other children ...
  {QMI.Supervisor, ifname: "wwan0", name: MyApp.QMI}
  #... other children ...
]

# Later on
iex> QMI.WirelessData.start_network_interface(MyApp.QMI, apn: "super")
:ok

iex> QMI.NetworkAccess.get_signal_strength(MyApp.QMI)
{:ok, %{rssi_reports: [%{radio: :lte, rssi: -74}]}}

Link to this section Summary

Types

A function that is ran when QMI receives an indication

The name passed to QMI.Supervisor

Structure that contains information about how to handle a QMI service message

Functions

Send a request over QMI and return the response

Configure the framing when using linux

Link to this section Types

Link to this type

indication_callback_fun()

View Source
@type indication_callback_fun() :: (map() -> :ok)

A function that is ran when QMI receives an indication

This function receives a map as the indication and returns :ok.

@type name() :: atom()

The name passed to QMI.Supervisor

@type request() :: %{
  service_id: non_neg_integer(),
  payload: iodata(),
  decode: (binary() -> :ok | {:ok, any()} | {:error, atom()})
}

Structure that contains information about how to handle a QMI service message

  • :service_id - which service this request is for
  • :payload - iodata of the message being sent
  • :decode - a function that will be used to decode the incoming response

Link to this section Functions

@spec call(request(), name()) :: any()

Send a request over QMI and return the response

NOTE: the QMI name parameter is second to facilitate piping

@spec configure_linux(String.t()) :: :ok

Configure the framing when using linux

This should be called once the device appears and before an attempt is made to connect to the network.