Current section
Files
Jump to
Current section
Files
lib/qmi/network_access.ex
defmodule QMI.NetworkAccess do
@moduledoc """
Provides commands related to network access
"""
alias QMI.Codec
@doc """
Get the current signal strength
"""
@spec get_signal_strength(QMI.name()) ::
{:ok, Codec.NetworkAccess.signal_strength_report()} | {:error, atom()}
def get_signal_strength(qmi) do
Codec.NetworkAccess.get_signal_strength()
|> QMI.call(qmi)
end
@doc """
Get the home network of the device
This returns the MCC, MNC, and service provider for the network.
"""
@spec get_home_network(QMI.name()) ::
{:ok, Codec.NetworkAccess.home_network_report()} | {:error, atom()}
def get_home_network(qmi) do
Codec.NetworkAccess.get_home_network()
|> QMI.call(qmi)
end
@spec get_rf_band_info(QMI.name()) ::
{:ok, [Codec.NetworkAccess.rf_band_information()]} | {:error, atom()}
def get_rf_band_info(qmi) do
Codec.NetworkAccess.get_rf_band_info()
|> QMI.call(qmi)
end
end