# `QMI.Codec.NetworkAccess`
[🔗](https://github.com/nerves-networking/qmi/blob/v0.10.3/lib/qmi/codec/network_access.ex#L8)

Codec for making network access service requests

# `attach_state`

```elixir
@type attach_state() :: :unknown | :attached | :detached
```

# `cell`

```elixir
@type cell() :: %{
  pci: 0..503,
  rsrq: -200..-30,
  rsrp: -1400..-440,
  rssi: -1200..0,
  srxlev: -128..128
}
```

Cell set

* `:pci` - Physical cell ID
* `:rsrq` - Current RSRQ in 1/10 dB as measured by L1
* `:rsrp` - Current RSRP in 1/10 dBm as measured by L1
* `:rssi` - Current RSSI in 1/10 dBm as measured by L1
* `:srxlev` - Cell selection Rx level (Srxlev) value (This field is only valid when
  ue_in_idle is TRUE.)

# `embms_coverage_status`

```elixir
@type embms_coverage_status() ::
  :not_available
  | :available
  | :not_available_due_to_uemode
  | :not_available_due_to_emergency
  | :unknown
```

eMBMS coverage status

* `:not_available` - Coverage not available
* `:available` - Coverage available
* `:not_available_due_to_uemode` - Coverage not available due to UE Mode
* `:not_available_due_to_emergency` - Coverage not available due to emergency
* `:unknown` - Coverage unknown

# `emergency_access`

```elixir
@type emergency_access() :: boolean() | :unknown
```

Whether LTE emergency bearer is supported.

* :true - LTE emergency bearer is supported
* :false - LTE emergency bearer is NOT supported
* :unknown - for scenarios where information is not available from the lower
  layers; e.g., if the UE powers up while acquiring service or in the middle
  of an attach procedure.

# `geo_sys_idx`

```elixir
@type geo_sys_idx() :: 0..65535
```

System table index referencing the beginning of
the geo in which the current serving system is
present. When the system index is not known,
0xFFFF is used.

# `get_cell_location_info`

```elixir
@type get_cell_location_info() :: %{
  optional(:lte_info_intrafrequency) =&gt; lte_info_intrafrequency(),
  optional(:timing_advance) =&gt; pos_integer(),
  optional(:doppler_measurement) =&gt; 0..400,
  optional(:lte_intra_earfcn) =&gt; pos_integer(),
  optional(:lte_inter_earfcn) =&gt; pos_integer()
}
```

Cell Location Info

* `:timing_advance` - Timing advance of the LTE cell in microseconds
* `:doppler_measurement` - Doppler measurement in Hz
* `:lte_intra_earfcn` - LTE intrafrequency EARFCN extended size
* `:lte_inter_earfcn` - LTE interfrequency EARFCN extended size

# `get_sys_info`

```elixir
@type get_sys_info() :: %{
  optional(:lte_sys_info) =&gt; lte_sys_info(),
  optional(:geo_sys_idx) =&gt; geo_sys_idx(),
  optional(:voice_support_on_lte) =&gt; boolean(),
  optional(:sim_rej_info) =&gt; sim_rej_info(),
  optional(:lte_ims_voice_avail) =&gt; boolean(),
  optional(:lte_voice_status) =&gt; lte_voice_status(),
  optional(:srv_reg_restriction) =&gt; srv_reg_restriction(),
  optional(:lte_reg_domain) =&gt; lte_reg_domain(),
  optional(:lte_embms_coverage_trace_id) =&gt; -1..32768,
  optional(:lte_sms_status) =&gt; lte_sms_status(),
  optional(:lte_is_eb_supported) =&gt; emergency_access(),
  optional(:emergency_access_barred) =&gt; emergency_access(),
  optional(:lte_cell_status) =&gt; lte_cell_status(),
  optional(:embms_coverage_status) =&gt; embms_coverage_status()
}
```

Sys Info

# `get_system_selection_preference_response`

```elixir
@type get_system_selection_preference_response() :: %{
  optional(:emergency_mode) =&gt; :off | :on,
  optional(:mode_preference) =&gt; [radio_interface()],
  optional(:roaming_preference) =&gt; roaming_preference(),
  optional(:network_selection_preference) =&gt; network_selection_preference(),
  optional(:acquisition_order) =&gt; [radio_interface()],
  optional(:registration_restriction) =&gt; registration_restriction_preference(),
  optional(:usage_settings) =&gt; usage_setting_preference(),
  optional(:voice_domain) =&gt; voice_domain_preference()
}
```

Preference settings for when a device selects a system

* `:emergency_mode` - `:on` if the device is in emergency mode, `:off`
  otherwise
* `:mode_preference` - a list of radio access technologies the device will
  try to use
* `:roaming_preference` - the device roaming preference
* `:network_selection_preference` - if the device will automatically select
  a network
* `:acquisition_order` - the order in which the device will try to connect
  to a radio access technology
* `:registration_restriction` - the system registration restriction
* `:usage_settings` - the modem usage preference
* `:voice_domain_preference` - the voice domain preference

# `home_network_report`

```elixir
@type home_network_report() :: %{mcc: char(), mnc: char(), provider: binary()}
```

Report from requesting the home network

# `lte_cell_status`

```elixir
@type lte_cell_status() ::
  :normal_only | :emergency_only | :no_calls | :all_calls | :unknown
```

Cell access status for LTE calls

* `:normal_only` - Cell access is allowed for normal calls only
* `:emergency_only` - Cell access is allowed for emergency calls only
* `:no_calls` - Cell access is not allowed for any call type
* `:all_calls` - Cell access is allowed for all call types
* `:unknown` - Cell access type is unknown

# `lte_info_intrafrequency`

```elixir
@type lte_info_intrafrequency() :: %{
  ue_in_idle: boolean(),
  plmn: pos_integer(),
  tac: pos_integer(),
  global_cell_id: pos_integer(),
  earfcn: 0..65535,
  serving_cell_id: 0..503,
  cell_resel_priority: 0..7,
  s_non_intra_search: 0..31,
  thresh_serving_low: 0..31,
  s_intra_search: 0..31,
  cells: [cell()]
}
```

LTE Info - Intrafrequency

* `:ue_in_idle` - true if the UE is in Idle mode
* `:plmn` - coded as octet 3, 4, and 5 in 3GPP TS 24.008Section 10.5.1.3
* `:tac` - Tracking area code
* `:global_cell_id` - Global cell ID in the system information block
* `:earfcn` - E-UTRA absolute radio frequency channel number of the serving cell.
* `:serving_cell_id` - LTE serving cell ID. Range: 0 to 503. This is the cell ID
  of the serving cell and can be found in the cell list.
* `:cell_resel_priority` - Priority for serving frequency. Range: 0 to 7. (This field
  is only valid when ue_in_idle is TRUE.)
* `:s_non_intra_search` - S non-intra search threshold to control non-intrafrequency searches.
  Range: 0 to 31. (This field is only valid when ue_in_idle is
  TRUE.)
* `:thresh_serving_low` - Serving cell low threshold. Range: 0 to 31. (This field is
  only valid when ue_in_idle is TRUE.)
* `:s_intra_search` - S intra search threshold. Range: 0 to 31. The current cell measurement
  must fall below this threshold to consider intrafrequency for reselection.
  (This field is only valid when ue_in_idle is TRUE.)

# `lte_reg_domain`

```elixir
@type lte_reg_domain() ::
  :not_applicable | :cs_only | :ps_only | :cs_ps | :limited_service
```

LTE registration domain

* `:not_applicable` - UE is not in Camp Only mode
* `:cs_only` - UE is in Camp Only mode and the PLMN can provide CS service only
* `:ps_only` - UE is in Camp Only mode and the PLMN can provide PS service only
* `:cs_ps` - UE is in Camp Only mode and the PLMN can provide CS and PS service
* `:limited_service` - UE is in Camp Only mode, but the PLMN cannot provide any service

# `lte_sms_status`

```elixir
@type lte_sms_status() :: :no_sms | :ims | :&quot;1X&quot; | :&quot;3GPP&quot;
```

LTE SMS domain

* `:no_sms` - No SMS, stay on LTE
* `:ims` - SMS is supported over the IMS network
* `:"1X" - SMS is supported over the 1X network
* `:"3GPP" - SMS is supported over the 3GPP network

# `lte_sys_info`

```elixir
@type lte_sys_info() :: %{
  optional(:srv_domain) =&gt; :no_service | :cs_only | :ps_only | :cs_ps | :camped,
  optional(:srv_capability) =&gt;
    :no_service | :cs_only | :ps_only | :cs_ps | :camped,
  optional(:roam_status) =&gt;
    :off
    | :on
    | :blink
    | :out_of_neighborhood
    | :out_of_building
    | :preferred_system
    | :available_system
    | :alliance_partner
    | :premium_partner
    | :full_service
    | :partial_service
    | :banner_on,
  optional(:is_sys_forbidden) =&gt; boolean(),
  optional(:lac) =&gt; pos_integer(),
  optional(:cell_id) =&gt; pos_integer(),
  optional(:reg_reject_srv_domain) =&gt;
    :no_service | :cs_only | :ps_only | :cs_ps | :camped,
  optional(:reg_reject_cause) =&gt; pos_integer(),
  optional(:mcc) =&gt; String.t(),
  optional(:mnc) =&gt; String.t(),
  optional(:tac) =&gt; pos_integer()
}
```

LTE System Infox

* `:srv_domain` - Service domain registered on the system
* `:srv_capability` - Current system’s service capability
* `:roam_status` - Current system's roaming status
* `:is_sys_forbidden` - Whether the system is forbidden
* `:lac` - Location area code (only applicable for 3GPP)
* `:cell_id` - Cell ID
* `:reg_reject_srv_domain` - Type of service domain in which the registration is rejected
* `:reg_reject_cause` - Reject cause
* `:mcc`, `:mnc` - ASCII network ID
* `:tac` - Tracking area code (only applicable for LTE)

# `lte_voice_status`

```elixir
@type lte_voice_status() :: :no_voice | :ims | :&quot;1X&quot; | :&quot;3GPP&quot;
```

LTE Voice domain

* `:no_voice` - No voice, stay on LTE
* `:ims` - Voice is supported over the IMS network
* `:"1X" - Voice is supported over the 1X network
* `:"3GPP" - Voice is supported over the 3GPP network

# `network`

```elixir
@type network() :: :network_unknown | :network_3gpp2 | :network_3gpp
```

# `network_selection_preference`

```elixir
@type network_selection_preference() :: :automatic | :manual
```

The networking selection preference

* `:automatic` - automatically select the network
* `:manual` - manually select the network

# `operator_name_indication`

```elixir
@type operator_name_indication() :: %{
  name: :operator_name_indication,
  long_name: binary(),
  short_name: binary()
}
```

# `preference_change_duration`

```elixir
@type preference_change_duration() :: :power_cycle | :permanent
```

How long a system preference change should be applied

* `:power_cycle` - only remains active until the next power cycle
* `:permanent` - remains active through power cycles until changed by a client

# `radio_interface`

```elixir
@type radio_interface() ::
  :no_service | :cdma_1x | :cdma_1x_evdo | :amps | :gsm | :umts | :lte
```

The radio interface that is being reported

# `registration_restriction_preference`

```elixir
@type registration_restriction_preference() ::
  :unrestricted | :camped_only | :limited | non_neg_integer()
```

The network registration restriction preference

* `:unrestricted` - device follows the normal registration process
* `:camped_only` - device will camp on a network but not register
* `:limited` - device selects the network for limited service

This can also be integer value that is specified by the specific modem
provider

# `rf_band_information`

```elixir
@type rf_band_information() :: %{
  interface: radio_interface(),
  band: binary(),
  channel: integer()
}
```

Information about an radio interface band

# `roaming_preference`

```elixir
@type roaming_preference() :: :off | :not_off | :not_flashing | :any
```

The roaming preference

* `:off` - acquire only systems for which the roaming indicator is off
* `:not_off` - acquire a system as long as its roaming indicator is not off
* `:not_flashing` - acquire a system as for which the roaming indicator is
  off or solid on - CDMA only.
* `:any` - acquire systems, regardless of their roaming indicator

# `serving_system_indication`

```elixir
@type serving_system_indication() :: %{
  :name =&gt; :serving_system_indication,
  :service_id =&gt; 3,
  :indication_id =&gt; 36,
  :serving_system_registration_state =&gt; serving_system_registration_state(),
  :serving_system_cs_attach_state =&gt; attach_state(),
  :serving_system_ps_attach_state =&gt; attach_state(),
  :serving_system_selected_network =&gt; network(),
  :serving_system_radio_interfaces =&gt; [radio_interface()],
  optional(:cell_id) =&gt; integer(),
  optional(:utc_offset) =&gt; Calendar.utc_offset(),
  optional(:location_area_code) =&gt; integer(),
  optional(:network_datetime) =&gt; NaiveDateTime.t(),
  optional(:roaming) =&gt; boolean(),
  optional(:std_offset) =&gt; Calendar.std_offset()
}
```

Required fields:

* `:name` - the name of the indication
* `:service_id` - the service id
* `:indication_id` - the indication id
* `:serving_system_registration_state` - the state of the registration status
  to the serving system
* `:serving_system_cs_attach_state` - the circuit-switched domain attach state
* `:serving_system_ps_attach_state` - the packet-switched domain attach state
* `:serving_system_selected_network` - the type of selected radio access network
* `:serving_system_radio_interfaces` - a list of radio interfaces currently in use

Optional fields:

* `:cell_id` - the id of the cell being used by the connected tower
* `:utc_offset` - the UTC offset in seconds
* `:location_area_code` - the location area code of a tower
* `:network_datetime` - the reported datetime of the network when connecting
* `:roaming` - if you are in roaming or not
* `:std_offset` - `Calendar.std_offset()` for daylight savings
  adjustment

# `serving_system_registration_state`

```elixir
@type serving_system_registration_state() ::
  :not_registered | :registered | :registration_denied | :registration_unknown
```

# `set_system_selection_preference_opt`

```elixir
@type set_system_selection_preference_opt() ::
  {:mode_preference, [radio_interface()]}
  | {:change_duration, preference_change_duration()}
  | {:roaming_preference, roaming_preference()}
```

The options to configure the system selection preference

* `:mode_preference` - which radio access technologies should the modem use
* `:change_duration` - the `preference_change_duration()` for the applied
  settings. The default is `:permanent`.
* `:roaming_preference` - the preferred roaming setting

# `signal_strength_report`

```elixir
@type signal_strength_report() :: %{
  rssi_reports: [%{radio: radio_interface(), rssi: integer()}]
}
```

Report from requesting the signal strength

# `sim_rej_info`

```elixir
@type sim_rej_info() ::
  :not_available | :available | :cs_invalid | :ps_invalid | :cs_ps_invalid
```

SIM rejection info

* `:available` - SIM is available
* `:not_available` - SIM is not available
* `:cs_invalid` - SIM has been marked by the network as invalid for circuit-switched services
* `:ps_invalid` - SIM has been marked by the network as invalid for packet-switched services
* `:cs_ps_invalid` - SIM has been marked by the network as invalid for circuit-switched and
  packet-switched services

# `srv_reg_restriction`

```elixir
@type srv_reg_restriction() :: :unrestricted | :camped_only
```

Registration restriction

* `:unrestricted` - Device follows the normal registration process
* `:camped_only` - Device follows the camp-only registration process

# `usage_setting_preference`

```elixir
@type usage_setting_preference() :: :unknown | :voice_centric | :data_centric
```

The modem usage preference setting

`:unknown` - device does not know the usage preference setting
`:voice_centric` - the device is set for voice centric usage
`:data_centric` - the device is set for data centric

# `voice_domain_preference`

```elixir
@type voice_domain_preference() :: :cs_only | :ps_only | :cs_preferred | :ps_preferred
```

The voice domain preference setting

* `:cs_only` - circuit-switched (CS) voice only
* `:ps_only` - packet-switched (PS) voice only
* `:cs_preferred` - PS is secondary
* `:ps_preferred` - CS is secondary

# `get_cell_location_info`

```elixir
@spec get_cell_location_info() :: QMI.request()
```

Make the `QMI.request()` for getting cell location info

# `get_home_network`

```elixir
@spec get_home_network() :: QMI.request()
```

Make the request for getting the home network

# `get_rf_band_info`

```elixir
@spec get_rf_band_info() :: QMI.request()
```

Get the radio band information

# `get_signal_strength`

```elixir
@spec get_signal_strength() :: QMI.request()
```

Make the `QMI.request()` for getting signal strength

# `get_sys_info`

```elixir
@spec get_sys_info() :: QMI.request()
```

Make the `QMI.request()` for getting cell location info

# `get_system_selection_preference`

```elixir
@spec get_system_selection_preference() :: QMI.request()
```

Make `QMI.request()` to get the system selection preferences

# `parse_indication`

```elixir
@spec parse_indication(binary()) ::
  {:ok, serving_system_indication()} | {:error, :invalid_indication}
```

Parse an indication

# `set_system_selection_preference`

```elixir
@spec set_system_selection_preference([set_system_selection_preference_opt()]) ::
  QMI.request()
```

Generate the `QMI.request()` for setting system selection preferences

---

*Consult [api-reference.md](api-reference.md) for complete listing*
