aboutsummaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers.h
AgeCommit message (Collapse)Author
2022-11-10modem-helpers: new method to check if reg state is registeredAleksander Morgado
2022-03-16modem-helpers: improve and fix COPS=? numeric fields parsingAleksander Morgado
The numeric fields in the +COPS=? response were relying on a very weak parsing logic, assuming that they were single-digit numeric values and not using the common string to integer conversion utilities. This commit improves the conversion from the 3GPP/ETSI defined network availability and access technology values to the MM defined ones, providing enum-based matches even if the numeric values are the same. The commit also fixes the parsing of access technology values > 10, required to report 5G related values.
2021-12-26iface-modem-3gpp-profile-manager: support 'apn-type' as index fieldAleksander Morgado
The modem may report the 'apn-type' field is the one to be used as index; if that's the case, allow setting and deleting profiles based on the given 'apn-type' field. This change also makes the internal profile management operations use one index field or another, based on what the protocol implements.
2021-11-02broadband-modem: implement support for 'SetPacketServiceState()'Aleksander Morgado
2021-10-22cli, plugins: factorize usage of iso8601 datetime formatFrederic Martinsons
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com> Includes updates by Aleksander Morgado to fix coding style issues.
2021-10-18broadband-modem-mbim: fix signal quality reporting with MBIMEx v2.0Aleksander Morgado
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' >>>>>> }, >>>>>> }'
2021-10-18modem-helpers: setup common RSSI to signal quality converterAleksander Morgado
2021-10-18modem-helpers: remove unexistent method headerAleksander Morgado
2021-09-19sim-mbim: add support for loading eid via mbim protocolSom_SP
Support is added to set eid dbus interface property using MBIM protocol when the inserted sim is esim.
2021-06-16helpers: skip g_warning() in mm_3gpp_parse_ws46_test_response()Aleksander Morgado
Use mm_obj_warn() instead.
2021-05-17modem-helpers: add 3 digit MNC output to mm_3gpp_parse_operator_id()Teijo Kinnunen
MNC digit count information is lost on conversion to integers. Make it possible for the caller to get this information through a separate boolean.
2021-04-29broadband-bearer: rely on profile management for the cid selectionAleksander Morgado
There is no longer need to perform all the CID selection logic in the broadband bearer connection procedure, we can rely on the new profile management operations to do the same thing. We can do this because we're sure that all the MMBroadbandModem objects implement the MMModem3gppProfileManager interface. Additionally, given that we now provide the profile ID value as part of the MMBearerConnectResult, we no longer need a custom mm_broadband_bearer_get_3gpp_cid() as we can use the generic mm_base_bearer_get_profile_id() for the same purpose.
2021-04-29modem-helpers: new profile list helpersAleksander Morgado
The new helpers allow converting a PDP context list returned from the +CGDCONT? parser to a list of 3GPP profile objects. The new mm_3gpp_profile_list_find_best() method is equivalent to the mm_3gpp_select_best_cid() one, but using profile objects as input/output instead of specific settings. The unit tests that were testing mm_3gpp_select_best_cid() are also converted to use mm_3gpp_profile_list_find_best().
2021-04-08modem-helpers: new helper to lookup range from CGDCONT=? responseAleksander Morgado
2021-04-01modem-helpers: ip family normalization doesn't need log_objectAleksander Morgado
2021-03-31base-bearer: remove default IP family propertyAleksander Morgado
There is no point in providing a configurable default IP family in the bearer object, because we can always assume IPv4 as being the only default expected. Simplify the logic and also provide a new method to get the normalize the IP family, using IPv4 as default always.
2021-03-09modem-helpers,mm-base-sim: Sim.SetPreferredNetworks AT implementationTeijo Kinnunen
Implement Sim.SetPreferredNetworks method by using the AT+CPOL command.
2021-02-26libmm-glib,modem-helpers,mm-base-sim: implement Sim.PreferredNetworksTeijo Kinnunen
The ModemManager1.Sim.PreferredNetworks property contains the preferred networks (and access technologies, if available) configured to the SIM card. This commit implements preferred networks reading with AT+CPOL.
2021-02-23helpers: rework normalize_operator() to use str_to_utf8()Aleksander Morgado
Instead of blindly assuming that we can take whatever string given as valid UTF-8, we'll always attempt to convert from the current modem charset into UTF-8. Before we were doing this for hex-encoded UCS2, but not for example for GSM-7. And due to the now applied GSM-7 conversion, the mf627a/mf627b +COPS parsing unit tests are updated accordingly, because when converting from an input string that contains byte 0x40 ('@' in UTF-8) as if it were GSM-7, the 0x40 is taken as character '¡', encoded as 0xc2,0xa1 in UTF-8).
2020-10-16mm-modem-helpers: add low_nybble_first argument to mm_bcd_to_stringEric Caruso
All BCD-encoded strings used by MM currently have the low nybble of each byte come before the high nybble, but some strings (such as the EID string returned by QMI Get Slot Status) are meant to be read in order with the high nybble before the low one. As such, extend mm_bcd_to_string to decode both.
2020-04-09broadband-modem: run +C5GREG state checksAleksander Morgado
The generic CREG parser is improved to also allow parsing +C5GREG responses and URCs.
2020-04-09api: new 5GNR capabilityAleksander Morgado
2020-04-09api: deprecate MM_MODEM_CAPABILITY_LTE_ADVANCEDAleksander Morgado
It's not used anywhere.
2020-04-08modem-helpers: make cpms test parser return error on failureAleksander Morgado
2020-04-08modem-helpers: port ccwa service query parser to use object loggingAleksander Morgado
2020-04-08modem-helpers: port cesq response parser to use object loggingAleksander Morgado
2020-04-08modem-helpers: port creg response parser to use object loggingAleksander Morgado
2020-04-08modem-helpers: port clcc list parser to use object loggingAleksander Morgado
2020-04-08modem-helpers: remove unused supported capabilities filterAleksander Morgado
2020-04-08modem-helpers: port cmer test parser to use object loggingAleksander Morgado
2020-04-08modem-helpers: parse cgdcont test parser to use object loggingAleksander Morgado
2020-04-08modem-helpers: port cid selection helper to use object loggingAleksander Morgado
2020-04-08modem-helpers: port cops test parser to use object loggingAleksander Morgado
2020-04-08modem-helpers: port ifc test parser to use object loggingAleksander Morgado
2020-04-08modem-helpers: port supported modes filtering to use object loggingAleksander Morgado
2020-04-08modem-helpers: port device identifier to use object logging and autoptrAleksander Morgado
2020-01-31helpers: new macro to CLAMP high threshold onlyAleksander Morgado
Useful when clamping a unsigned integer with low threshold set to 0, which would give us compiler warnings with -Wtype-limits when using CLAMP(), e.g.: via/mm-broadband-modem-via.c: In function ‘handle_evdo_quality_change’: /usr/include/glib-2.0/glib/gmacros.h:811:63: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits] 811 | #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) | ^ via/mm-broadband-modem-via.c:284:19: note: in expansion of macro ‘CLAMP’ 284 | quality = CLAMP (quality, 0, 100); | ^~~~~
2020-01-31modem-helpers: fix warnings with -Wdiscarded-qualifiersAleksander Morgado
mm-modem-helpers.c:4019:45: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 4019 | { MM_MODEM_3GPP_FACILITY_SIM, "SC" }, | ^~~~ mm-modem-helpers.c:4020:45: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 4020 | { MM_MODEM_3GPP_FACILITY_PH_SIM, "PS" }, | ^~~~ mm-modem-helpers.c:4021:45: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 4021 | { MM_MODEM_3GPP_FACILITY_PH_FSIM, "PF" }, | ^~~~ mm-modem-helpers.c:4022:45: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 4022 | { MM_MODEM_3GPP_FACILITY_FIXED_DIALING, "FD" }, | ^~~~ mm-modem-helpers.c:4023:45: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 4023 | { MM_MODEM_3GPP_FACILITY_NET_PERS, "PN" }, | ^~~~ mm-modem-helpers.c:4024:45: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 4024 | { MM_MODEM_3GPP_FACILITY_NET_SUB_PERS, "PU" }, | ^~~~ mm-modem-helpers.c:4025:45: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 4025 | { MM_MODEM_3GPP_FACILITY_PROVIDER_PERS, "PP" }, | ^~~~ mm-modem-helpers.c:4026:45: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 4026 | { MM_MODEM_3GPP_FACILITY_CORP_PERS, "PC" } | ^~~~
2020-01-06broadband-modem: +COPS=? response may give strings in UCS2Aleksander Morgado
If the charset selected via CSCS is UCS2, the modem may decide to return all the strings in the +COPS=? response in UCS2: <debug> (ttyACM0): --> 'AT+COPS=?<CR>' <debug> (ttyACM0): <-- '<CR><LF>+COPS: (2,"004D006F007600690073007400610072","004D006F007600690073007400610072","00320031003400300037",7) <debug> Found network '00320031003400300037' ('004D006F007600690073007400610072','004D006F007600690073007400610072'); availability: current, access tech: lte
2019-10-17sim: load emergency numbers from EF_ECCAleksander Morgado
2019-09-13broadband-bearer: setup cid selection as a testable methodAleksander Morgado
Rework how the broadband bearer runs CGDCONT? and CGDCONT=? and setup a helper method to perform the CID selection logic. Also, implement unit tests for the CID selection logic.
2019-07-19broadband-modem,voice: implement call waiting status setup/query with +CCWAAleksander Morgado
2019-07-11helpers: new '+CLCC' test response parserAleksander Morgado
2019-07-11broadband-modem: implement +CCWA URC handlingAleksander Morgado
2019-06-11modem-helpers: minor coding style fixesAleksander Morgado
2018-11-26broadband-modem: enable and handle +CGEV indicationsAleksander Morgado
The +CGEV indications allow us to get notified of packet domain events like network-initiated or ME-initiated disconnections on specific connected contexts, as well as full PS detach events (all contexts disconnected). If the modem supports these indications, we will enable them with +CGEREP and will then process them when they are emitted by the modem. If a full PS detach event happens, we will explicitly disconnect all connected bearers. If a deactivation inidication is received for a single context, we will look for the associated bearer by CID and explicitly disconnect it.
2018-10-26modem-helpers: new helper to convert binary-coded decimalsBen Chan
This patch adds a mm_bcd_to_string() helper function to convert a byte array representing a binary-coded decimal (BCD) number to a string representing the equivalent decimal number.
2018-10-09sierra-legacy: implement connection status monitoring with !SCACT?Aleksander Morgado
Devices like the Netgear AC313U require explicit context monitoring, otherwise the device may end up disconnected internally and MM would still think that the connection is ongoing.
2018-09-13modem-helpers: Make 3gpp signal quality functions publicPaul Bartell
2018-09-12modem-helpers: reuse nicknames for the flow control tagsAleksander Morgado
And check that the string given in the tag is actually a valid one.