aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib/mm-common-helpers.h
AgeCommit message (Collapse)Author
2022-11-04libmm-glib,common: add helpers to build printable stringsAleksander Morgado
2022-10-05libmm-glib,common-helpers: don't assume new_from_unix_utc() always succeedsAleksander Morgado
The g_date_time_new_from_unix_utc() method in glib2 may fail if the given timestamp is too far into the future. The value is supposed to be seconds since unix time origin, but internally it will be converted into usecs, so any value longer than G_MAXINT64 / USEC_PER_SECOND isn't allowed. This is currently used in the CLI, and we're anyway ignoring the error returned in that case, but at least it won't crash if it ever happens.
2022-04-08sms: prevent crash if date is out of rangeCarlo Lobrano
g_date_time_new, and g_date_time_new_utc return NULL if inputs are out of range, and currently mm_new_iso8601_time passes the GDateTime created by those two functions to date_time_format_iso8601 without checking for NULL values, causing a g_date_time_format_iso8601 crash if PDU data is corrupted with wrong date. To prevent this, mm_new_iso8601_time now can return NULL and set a new GError if GDateTime created by g_date_time_new is NULL. Fixes #546
2021-12-24libmm-glib: new 'profile-source' in 3GPP profileAleksander Morgado
Not applicable to bearer properties, as this is exclusively a proflie management setting, unrelated to connection attempts.
2021-12-24libmm-glib: new 'access-type-preference' in 3GPP profile and bearer propertiesAleksander Morgado
2021-12-24libmm-glib: new helper to handle the 5GNR registration settingsAleksander Morgado
2021-11-16libmm-glib: fix license in sourcesAleksander Morgado
The libmm-glib library is LGPLv2+, not GPLv2+.
2021-11-02api,3gpp: new 'SetPacketServiceState()' methodAleksander 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-22api,bearer: new 'start-date' field in bearer statisticsFrederic Martinsons
It stores the epoch timestamp of the current bearer session start. If there is no connected bearer, it is set to 0 and not displayed in mmcli output. Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com> Includes updates by Aleksander Morgado to fix coding style issues.
2021-07-01libmm-glib,modem: use helper macros to manage the monitored propertiesAleksander Morgado
2021-07-01libmm-glib,common-helpers: refactor helper methodsAleksander Morgado
Remove unused methods, like all the variant_to_array() ones, and reorder some others so that both header and source file have the same order always.
2021-05-23api,bearer: new 'ConnectionError' propertyAleksander Morgado
This new property will provide detailed information about the failed connection attempt, or about the network initiated disconnection. The property will be cleared only if a new connection attempt is triggered, and so it can be used to investigate why a given attempt failed without needing to be the one who triggered the attempt (e.g. so that failures in NetworkManager-triggered connection attempts can be investigated looking at the DBus API). The property is built as a (ss) tuple, but the libmm-glib interface provides methods to read this property as a GError.
2021-05-22libmm-glib: setup common helper to register DBus errorsAleksander Morgado
2021-04-30libmm-glib: add helper to get 3gpp facility from stringMichal Mazur
2021-04-29api,bearer: new 'apn-type' settingAleksander Morgado
This new setting allows the user setting up the connection to specify the purpose of the connection being brought up. Until now, we would always assume that connections are exclusively brought up for connecting to the Internet, also limited by the inability to connect to multiple different APNs at the same time. But that may really not be true as there may be additional services that may be accessed through other APNs, like MMS services or even private networks for companies that have their own APNs on a given operator (e.g. not that uncommon with banks and connected cars). The new APN type setting will not change the way the bearer is connected, but will allow the connection manager to decide what kind of networking setup the specific connection needs. This new setting can be provided by the user itself, or implicitly read from the device if the device stores this information.
2021-03-10api,simple: new 'multiplex' setting in bearer propertiesAleksander Morgado
Both the Simple.Connect() and Modem.CreateBearer() are updated to allow a new 'multiplex' setting in the properties provided by the user in both of these methods. The new setting expects a MMBearerMultiplexSupport enum indicating what kind of multiplex needs the user has: * none: if multiplex must not be used. * requested: if multiplex should be used if available. * required: if multiplex must be used. The underlying implementations will take care of accepting or rejecting the setting depending on the system and modem capabilities.
2021-03-09mmcli,sim: implement --sim-set-preferred-networks functionTeijo Kinnunen
2021-02-23libmm-glib,common-helpers: make hexstr2bin() return a guint8 arrayAleksander Morgado
It makes much more sense than returning a gchar array, as gchar is signed.
2021-02-23libmm-glib,common-helpers: make hexstr2bin() accept input string lengthAleksander Morgado
Optionally given explicitly, and -1 can be used to assume it's NUL-terminated.
2021-02-23libmm-glib,common-helpers: make hexstr2bin() return a GErrorAleksander Morgado
This util method checks whether the input string is a valid hex string, so make sure we return a GError on failure.
2020-04-09libmm-glib,helpers: allow reading hex strings from match infoAleksander Morgado
2020-04-09api,modem: improve capabilities related documentationAleksander Morgado
And remove the unused mm_common_build_capability_combinations_any() method in the common non-public library code.
2020-01-15libmm-glib: unconditionally define autoptr support for all typesAleksander Morgado
As we now depend on glib 2.48
2019-09-17plugins,telit: refactor #BND command supportAleksander Morgado
And added support for several new things, including: * Setting "any" band now attempts to set all supported bands. * Added new 2G band value '5' (egsm+dcs+pcs+g850). * Setup support for two different 3G band combinations, a default one plus an alternate one applicable to the LM940/960 models only. The alternate combination is selected via udev tags. During the refactor, the following Telit-specific helpers were also removed and exchanged with more generic counterparts. * mm_telit_bands_contains() -> mm_common_bands_garray_lookup() * mm_telit_get_band_flags_from_string() -> mm_parse_uint_list()
2019-03-29libmm-glib,common: new helper methods to read guint64 valuesAleksander Morgado
We use strtoull() to read a "unsigned long long" that is always at least 64bits, even in 32bit systems.
2018-12-04mm-common-helpers: add mm_autoptr helpers for GRegex and GMatchInfoDan Williams
Alias them to g_autoptr() on glib >= 2.44, otherwise re-implement.
2018-08-21libmm-glib: new common helpers to check band typesAleksander Morgado
2018-01-20modem-3gpp: allow loading and changing EPS UE mode of operationAleksander Morgado
The UE modes of operation for LTE are defined in 3GPP TS 24.301 (e.g. section 4.3 in v10.3.0): * PS mode 1: EPS only, 'voice centric' * PS mode 2: EPS only, 'data centric' * CS/PS mode 1: EPS and non-EPS, 'voice centric' * CS/PS mode 2: EPS and non-EPS, 'data centric' The mode specifies, among other things, how the UE should behave w.r.t CS fallback depending on the capabilities reported by the network.
2016-10-12iface-modem: always sort supported and current bands before exposing themAleksander Morgado
2016-09-29core: allow building and running without udevAleksander Morgado
Instead of relying on the udev daemon and GUDev to manage the devices reported by the kernel, we can now run ModemManager relying solely on the kernel events reported via the new ReportKernelEvent() API. Therefore, the '--no-auto-scan' option is implicit for the ModemManager daemon when udev is disabled in the build. Additionally, a new custom implementation of the kernel device object is provided, which uses sysfs to load the properties and attributes required in each kernel device, instead of using a GUdevDevice. The udev rule files are kept in place, and a simple custom parser is provided which preloads all rules in memory once and then applies them to the different kernel objects reported via ReportKernelEvent(), e.g. to set port type hints. A simple unit test setup is prepared to validate the udev rules during the `check' Makefile target.
2015-08-02libmm-glib: added support for Modem.Voice and Call interfacesRiccardo Vangelisti
2013-10-25libmm-glib: allow new 'teleservice-id' and 'service-category' keywords in ↵Aleksander Morgado
MMSmsProperties
2013-09-09mmcli,oma: support for the new OMA interfaceAleksander Morgado
2013-09-09libmm-glib: support for the 'OMA' interfaceAleksander Morgado
2013-06-24api,introspection: new 'Ports' property in the Modem interfaceAleksander Morgado
We will expose a new 'Ports' property listing all ports currently known by a given modem. Ports which are not used but are detected as being part of the modem will be listed with an 'unknown' port type. This change uses the new 'MMModemPortType' enum and the new 'MMModemPortInfo' helper struct to handle these values in libmm-glib. The already available 'MMPortType' enum hasn't been re-used for the interface because it contains values that we don't need (e.g. IGNORED). The port list is now also included in the modem information command of mmcli: $ sudo mmcli -m 0 /org/freedesktop/ModemManager1/Modem/0 (device id '97b7b99e3e2bea103880545b619fb05a3cc81b26') ------------------------- System | device: '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4' | drivers: 'qcserial, qmi_wwan' | plugin: 'Gobi' | primary port: 'cdc-wdm0' | ports: 'ttyUSB0 (qcdm), ttyUSB1 (at), cdc-wdm0 (qmi), wwp0s29u1u4 (net)' https://bugzilla.gnome.org/show_bug.cgi?id=702678
2013-06-05mmcli: new '--set-current-capabilities' commandAleksander Morgado
New command to allow changing modem capabilities, if supported. The modem will power cycle automatically after having changed them.
2013-06-05api,introspection: rename 'ModemCapabilities' to 'SupportedCapabilities'Aleksander Morgado
And also make it a list of masks, specifying which are the specific combinations supported, not just one mask with all. E.g.: ------------------------- Hardware | manufacturer: 'Sierra Wireless, Incorporated' | model: 'MC7710' | revision: 'SWI9200X_03.05.19.04ap r5475 carmd-en-10527 2012/09/17 17:57:14' | supported: 'gsm-umts | gsm-umts, lte' | current: 'gsm-umts, lte' | equipment id: '358178040668164'
2013-06-05api,introspection: 'SupportedModes' is now a list of possible combinationsAleksander Morgado
Instead of just a mask of MMModemMode values, we now provide a list of the allowed and preferred mode combinations supported by the modem. E.g.: $> sudo mmcli -m 0 ------------------------- Modes | supported: 'allowed: 2g; preferred: none | allowed: 3g; preferred: none | allowed: 2g, 3g; preferred: none | allowed: 2g, 3g; preferred: 2g | allowed: 2g, 3g; preferred: 3g | allowed: 4g; preferred: none | allowed: 2g, 3g, 4g; preferred: none'
2013-02-22broadband-modem: don't assume the returned string is always hex-encodedAleksander Morgado
2012-10-07api,libmm-glib: new `allowed-auth' configuration for bearersAleksander Morgado
For bearers using STATIC or DHCP IP method, the modem itself is the one negotiating authentication with the network. The new `allowed-auth' property allows users to specify which authentication method(s) are allowed to be used. See the following NetworkManager commit for more reference: commit 34aef8aaaa09b7473b9496aa49e550bd2def03f8 Author: Andrew Bird <ajb@spheresystems.co.uk> Date: Thu Mar 15 16:19:43 2012 -0500
2012-10-04api: only allow including `ModemManager.h' directlyAleksander Morgado
2012-10-04libmm-glib: only allow including `libmm-glib.h' directlyAleksander Morgado
Unless when compiling libmm-glib itself, of course.
2012-10-04build: merge libmm-common into libmm-glibAleksander Morgado
It's pointless to have libmm-common around, just merge it into libmm-glib and make ModemManager depend on libmm-glib directly. At the end, the non-common stuff in libmm-glib is really minimal.