diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-10-17 22:27:49 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-10-18 00:04:59 +0200 |
commit | d6aa72736610865729625e295ff39128c7dd4b17 (patch) | |
tree | 0d8c96d6fd2698c22b890a5e11d537fe7cc147e5 /src/mm-modem-helpers.h | |
parent | c01f22804e0e4ac35216208e4a38da02cc56290c (diff) |
broadband-modem-mbim: fix signal quality reporting with MBIMEx v2.0
When we enable MBIMEx v2.0, the "Signal State" responses and
indications no longer report a valid RSSI value; and instead, they
report per access technology RSRP/RSRQ values.
>>>>>> Header:
>>>>>> length = 116
>>>>>> type = indicate-status (0x80000007)
>>>>>> transaction = 0
>>>>>> Fragment header:
>>>>>> total = 1
>>>>>> current = 0
>>>>>> Contents:
>>>>>> service = 'basic-connect' (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)
>>>>>> cid = 'signal-state' (0x0000000b)
>>>>>> Fields:
>>>>>> Rssi = '99'
>>>>>> ErrorRate = '99'
>>>>>> SignalStrengthInterval = '5'
>>>>>> RssiThreshold = '2'
>>>>>> ErrorRateThreshold = '4294967295'
>>>>>> RsrpSnr = '{
>>>>>> [0] = {
>>>>>> Rsrp = '0'
>>>>>> Snr = '0'
>>>>>> RsrpThreshold = '4294967295'
>>>>>> SnrThreshold = '4294967295'
>>>>>> SystemType = '5g-nsa'
>>>>>> },
>>>>>> [1] = {
>>>>>> Rsrp = '49'
>>>>>> Snr = '45'
>>>>>> RsrpThreshold = '4294967295'
>>>>>> SnrThreshold = '4294967295'
>>>>>> SystemType = 'lte'
>>>>>> },
>>>>>> }'
Diffstat (limited to 'src/mm-modem-helpers.h')
-rw-r--r-- | src/mm-modem-helpers.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mm-modem-helpers.h b/src/mm-modem-helpers.h index 7391409f..4107137c 100644 --- a/src/mm-modem-helpers.h +++ b/src/mm-modem-helpers.h @@ -576,6 +576,10 @@ gboolean mm_sim_parse_cpol_test_response (const gchar *response, #define MM_RSSI_TO_QUALITY(rssi) \ (guint8)(100 - ((CLAMP (rssi, -113, -51) + 51) * 100 / (-113 + 51))) +/* Limit the value betweeen [-110,-60] and scale it to a percentage */ +#define MM_RSRP_TO_QUALITY(rsrp) \ + (guint8)(100 - ((CLAMP (rsrp, -110, -60) + 60) * 100 / (-110 + 60))) + /*****************************************************************************/ /* Helper function to decode eid read from esim */ |