Codec for making wireless data service requests
Summary
Types
Authentication method for the profile
The type of reasons the call ended
Complete current settings including network configuration
The indication for the wireless data service's event report
Options for the wireless data event report configuration
Options for Get Current Settings
IP family selector for WDS Get Current Settings
Response from issuing a modify profile settings request
The indication for a change in the current packet data connection status
PDP (Packet Data Protocol) type for the profile
The profile settings
Profile settings returned by get_profile_settings
The profile technology type
Options for whens starting a network interface
Report from starting the network interface
The type of measurement you are wanting to be reported
Name of the technology
Functions
Create a profile with the given settings
Build WDS Get Current Settings request. Defaults to IPv4 if no family given.
Build WDS Get Current Settings request with options similar a qmicli.
Get the modem's default profile index for a profile type
Get the profile indexes the modem uses for the LTE initial attach
Get settings for a specific profile.
Modify the QMI profile setting
Try to parse an indication from the wireless data service
Request to set the wireless data services event report options
Send command to request the that the network interface starts to receive data
Types
@type auth_method() :: :none | :pap | :chap | :pap_or_chap | :unknown
Authentication method for the profile
@type call_end_reason_type() :: :unspecified | :mobile_ip | :internal | :call_manager_defined | :three_gpp_specification_defined | :ppp | :ehrpd | :ipv6 | :handoff | {:unknown, non_neg_integer()}
The type of reasons the call ended
@type current_settings() :: %{ optional(:ipv4_mtu) => non_neg_integer(), optional(:ipv6_mtu) => non_neg_integer(), optional(:ipv4_address) => String.t(), optional(:ipv4_gateway) => String.t(), optional(:ipv4_subnet_mask) => String.t(), optional(:ipv4_primary_dns) => String.t(), optional(:ipv4_secondary_dns) => String.t(), optional(:ipv6_address) => String.t(), optional(:ipv6_gateway) => String.t(), optional(:ipv6_prefix_length) => non_neg_integer(), optional(:ipv6_primary_dns) => String.t(), optional(:ipv6_secondary_dns) => String.t(), optional(:domain_name_list) => [String.t()], optional(:pcscf_address_using_pco) => String.t(), optional(:pcscf_domain_name_list) => [String.t()] }
Complete current settings including network configuration
@type event_report_indication() :: %{ :name => :event_report_indication, optional(:tx_bytes) => integer(), optional(:rx_bytes) => integer(), optional(:tx_packets) => integer(), optional(:rx_packets) => integer(), optional(:tx_overflows) => integer(), optional(:rx_overflows) => integer(), optional(:tx_errors) => integer(), optional(:rx_errors) => integer(), optional(:tx_drops) => integer(), optional(:rx_drops) => integer() }
The indication for the wireless data service's event report
To configure what information is sent through this indication see
set_event_report/1.
@type event_report_opt() :: {:statistics_interval, non_neg_integer()} | {:statistics, [statistic_measurement()] | :all | :none}
Options for the wireless data event report configuration
:statistics_interval- an interval in seconds on when to report statistics about transmit and receive operations:statistics- list which statistic measurements to report
For transmit and receive statistics, if no interval is provided the default is
60 seconds. If the :statistics option is not provided it will default to
:all. The report is only sent in the interval if there was a change in any
of the statistics. So, if no changes took place the report will be skipped for
an interval.
To configure event report to not included any stats pass :none to
the :statistics option.
@type get_current_settings_opt() :: {:extended_mask, non_neg_integer()} | {:packet_data_handle, non_neg_integer()}
Options for Get Current Settings
:extended_mask- 32-bit mask for Extended Requested Settings TLV (0x11). Defaults to 0xFFFFFFFF.:packet_data_handle- integer PDH from Start Network Interface response (TLV 0x01).
@type ip_family() :: 4 | 6
IP family selector for WDS Get Current Settings
4- IPv46- IPv6
@type modify_profile_settings_response() :: %{extended_error_code: integer() | nil}
Response from issuing a modify profile settings request
@type packet_status_indication() :: %{ name: :packet_status_indication, status: :disconnected | :connected | :suspended | :authenticating, reconfiguration_required: boolean(), call_end_reason: integer() | nil, call_end_reason_type: call_end_reason_type() | nil, ip_family: 4 | 6 | nil, tech_name: tech_name() | nil, bearer_id: integer() | nil, xlat_capable: boolean() | nil }
The indication for a change in the current packet data connection status
@type pdp_type() :: :ipv4 | :ppp | :ipv6 | :ipv4v6 | :unknown
PDP (Packet Data Protocol) type for the profile
@type profile_setting() :: {:roaming_disallowed, boolean()} | {:profile_type, profile_type()} | {:profile_name, String.t()} | {:apn, String.t()} | {:username, String.t()} | {:password, String.t()} | {:pdp_type, pdp_type()} | {:auth_method, auth_method()}
The profile settings
:roaming_disallowed- if using roaming is allowed or not:profile_type- the profile type - seeprofile_type()type docs for more information:profile_name- the name of the profile (a label, not the APN):apn- the Access Point Name string:username- the username for authentication:password- the password for authentication:pdp_type- the PDP (Packet Data Protocol) type:auth_method- the authentication method to use
@type profile_settings() :: %{ optional(:apn) => String.t(), optional(:pdp_type) => pdp_type(), optional(:username) => String.t(), optional(:password) => String.t(), optional(:auth) => auth_method() }
Profile settings returned by get_profile_settings
@type profile_type() :: :profile_type_3gpp | :profile_type_3gpp2 | :profile_type_epc
The profile technology type
@type start_network_interface_opt() :: {:apn, String.t()} | {:profile_3gpp_index, integer()} | {:ip_family, 4 | 6}
Options for whens starting a network interface
:apn- the name of our APN
@type start_network_report() :: %{packet_data_handle: non_neg_integer()}
Report from starting the network interface
@type statistic_measurement() ::
:tx_bytes
| :rx_bytes
| :tx_packets
| :rx_packets
| :tx_overflows
| :rx_overflows
| :tx_errors
| :rx_errors
| :tx_drops
| :rx_drops
The type of measurement you are wanting to be reported
:tx_bytes- number of bytes transmitted:rx_bytes- number of bytes received:tx_packets- number of transmit packets sent without error:rx_packets- number of packets received without error:tx_overflows- number of packets dropped due to tx buffer overflowed (out of memory):rx_overflows- number of packets dropped due to rx buffer overflowed (out of memory):tx_errors- number of outgoing packets with framing errors:rx_errors- number of incoming packets with framing errors:tx_drops- number outgoing packets dropped:rx_drops- number incoming packets dropped
@type tech_name() ::
:cdma
| :umts
| :wlan_local_brkout
| :iwlan_s2b
| :epc
| :embms
| :modem_link_local
Name of the technology
Functions
@spec create_profile([profile_setting()]) :: QMI.request()
Create a profile with the given settings
The modem picks the index, which the response returns. :profile_type
defaults to :profile_type_3gpp.
@spec get_current_settings(ip_family()) :: QMI.request()
Build WDS Get Current Settings request. Defaults to IPv4 if no family given.
The request includes:
- TLV 0x10 (Requested Settings mask) set to all bits (0xFFFFFFFF) to get all available fields
- TLV 0x19 (IP family) as 0x04 for IPv4 or 0x06 for IPv6
@spec get_current_settings(ip_family(), [get_current_settings_opt()]) :: QMI.request()
Build WDS Get Current Settings request with options similar a qmicli.
Supported options:
:extended_mask- adds TLV 0x11 (Extended Requested Settings) with this mask:packet_data_handle- adds TLV 0x01 (Packet Data Handle) with given PDH
@spec get_default_profile_number(profile_type()) :: QMI.request()
Get the modem's default profile index for a profile type
The default profile is the one the modem uses for data calls that do not name a profile.
@spec get_lte_attach_pdn_list() :: QMI.request()
Get the profile indexes the modem uses for the LTE initial attach
On LTE the attach brings up the default bearer with the settings of the first profile of this list.
@spec get_profile_settings(integer(), profile_type()) :: QMI.request()
Get settings for a specific profile.
Examples
iex> get_profile_settings(3, :profile_type_3gpp)
%{service_id: 1, payload: [...], decode: ...}This builds a QMI request map that you can send with your
QMI transport (QMI.call/2 or equivalent).
@spec modify_profile_settings(profile_index :: integer(), [profile_setting()]) :: QMI.request()
Modify the QMI profile setting
When providing the profile settings if :profile_type is not included this
function will default to :profile_type_3gpp
@spec parse_event_report_indication(event_report_indication(), binary()) :: event_report_indication()
@spec parse_indication(binary()) :: {:ok, packet_status_indication() | event_report_indication()} | {:error, :invalid_indication}
Try to parse an indication from the wireless data service
@spec set_event_report([event_report_opt()]) :: QMI.request()
Request to set the wireless data services event report options
@spec start_network_interface([start_network_interface_opt()]) :: QMI.request()
Send command to request the that the network interface starts to receive data
@spec stat_to_integer(statistic_measurement()) :: 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512
@spec statistics_mask(:all | [statistic_measurement()]) :: non_neg_integer()