Provides command related to wireless messaging
Summary
Functions
Create a 3GPP profile and return its index
Get current WDS settings for the given IP family (4 or 6).
Get the modem's default 3GPP profile index
Get the profile indexes the modem uses for the LTE initial attach
Get the list of all configured profiles by iterating through profile indices.
Get the settings for a specific profile by index.
Modify a profile's settings to be used when starting an interface connection.
Set the event report options for the wireless data event indication
Start the network interface
Functions
@spec create_profile(QMI.name(), [QMI.Codec.WirelessData.profile_setting()]) :: {:ok, %{index: non_neg_integer()}} | {:error, term()}
Create a 3GPP profile and return its index
@spec get_current_settings(QMI.name(), QMI.Codec.WirelessData.ip_family(), [ QMI.Codec.WirelessData.get_current_settings_opt() ]) :: {:ok, QMI.Codec.WirelessData.current_settings()} | {:error, atom()}
Get current WDS settings for the given IP family (4 or 6).
Returns comprehensive network configuration including IP addresses, DNS servers, gateway, MTU, and domain information assigned by the modem during connection.
Returned Information
- IPv4 Configuration:
:ipv4_address,:ipv4_gateway,:ipv4_subnet_mask,:ipv4_primary_dns,:ipv4_secondary_dns,:ipv4_mtu - IPv6 Configuration:
:ipv6_address,:ipv6_gateway,:ipv6_prefix_length,:ipv6_primary_dns,:ipv6_secondary_dns,:ipv6_mtu - Domain Information:
:domain_name_list,:pcscf_domain_name_list - PCSCF:
:pcscf_address_using_pco
Options
:extended_mask- add Extended Requested Settings (0x11) mask:packet_data_handle- include PDH (0x01) for the active session
Examples
# Get IPv4 configuration
{:ok, settings} = QMI.WirelessData.get_current_settings(client, 4)
# Returns: %{ipv4_address: "192.168.1.100", ipv4_gateway: "192.168.1.1", ...}
# Get IPv6 configuration
{:ok, settings} = QMI.WirelessData.get_current_settings(client, 6)
# Returns: %{ipv6_address: "2001:db8::1", ipv6_gateway: "2001:db8::1", ...}
@spec get_default_profile_number(QMI.name()) :: {:ok, non_neg_integer()} | {:error, term()}
Get the modem's default 3GPP profile index
@spec get_lte_attach_pdn_list(QMI.name()) :: {:ok, [non_neg_integer()]} | {:error, term()}
Get the profile indexes the modem uses for the LTE initial attach
An empty list means the modem has none configured.
Get the list of all configured profiles by iterating through profile indices.
Starts at index 1 and continues until receiving {:error, :extended_internal}, which indicates we've reached the end of available profiles.
Get the settings for a specific profile by index.
@spec modify_profile_settings(QMI.name(), profile_index :: integer(), [ QMI.Codec.WirelessData.profile_setting() ]) :: {:ok, map()} | {:error, atom()}
Modify a profile's settings to be used when starting an interface connection.
Available settings:
:apn- the Access Point Name (e.g., "simbase"):username- username for authentication:password- password for authentication:pdp_type- :ipv4, :ipv6, :ipv4v6, or :ppp:auth_method- :none, :pap, :chap, or :pap_or_chap:roaming_disallowed- true/false for roaming restrictions:profile_type- :profile_type_3gpp, :profile_type_3gpp2, or :profile_type_epc
Examples
# Configure a profile for "simbase" APN
QMI.WirelessData.modify_profile_settings(client, 1, [
apn: "simbase",
pdp_type: :ipv4v6,
auth_method: :none
])
@spec set_event_report(QMI.name(), [QMI.Codec.WirelessData.event_report_opt()]) :: :ok | {:error, atom()}
Set the event report options for the wireless data event indication
@spec start_network_interface(QMI.name(), [ QMI.Codec.WirelessData.start_network_interface_opt() | {:timeout, non_neg_integer()} ]) :: {:ok, QMI.Codec.WirelessData.start_network_report()} | {:error, atom() | {:call_failed, map()}}
Start the network interface
This will return once a packet data session is established and the interface can perform IP address configuration. That means once this returns you can configure the interface via DHCP.
Options
:apn- the name of the APN:profile_3gpp_index- the 3GPP profile index to use:ip_family-4or6, the IP family to request:timeout- override the default QMI call timeout (in milliseconds). Some modems take longer than 5s to establish a data session.
When the modem rejects the call, the error is {:call_failed, reason},
where reason holds the call end reason TLVs (e.g. a 3GPP cause in
:verbose_call_end_reason when :call_end_reason_type is
:three_gpp_specification_defined).