View Source VintageNetQMI.ASUCalculator (vintage_net_qmi v0.4.2)
Convert raw ASU values to friendlier units
See https://en.wikipedia.org/wiki/Mobile_phone_signal#ASU for more information.
The following conversions are done:
- dBm
- Number of "bars" out of 4 bars
Summary
Types
@type bars() :: 0..4
Number of bars out of 4 to show in a UI
@type dbm() :: neg_integer()
dBm
@type gsm_asu() :: 0..31 | 99
GSM ASU values
ASU values map to RSSI. 99 means unknown
@type lte_asu() :: 0..97
LTE ASU values
ASU values map to RSRP
@type umts_asu() :: 0..90 | 255
UMTS ASU values
ASU values map to RSCP
Functions
Compute signal level numbers from a GSM ASU
The AT+CSQ
command should report ASU values in this format.
@spec from_lte_rssi(dbm()) :: %{asu: non_neg_integer(), dbm: dbm(), bars: bars()}