Commit Graph

40 Commits

Author SHA1 Message Date
Teemu Ikonen
fa19b2b9b1 cli, location: Fix multi-sentence NMEA message output
Multi-sentence NMEA messages were printed as is, that is with
linebreaks, which made mmcli --location-get output look broken.

Split NMEA sentences with linebreaks to separate output list items, so
that they line up correctly.
2021-09-01 15:50:38 +00:00
Aleksander Morgado
c9ca1ab97b cli,location: new '--location-monitor' action
This action allows us to monitor location updates as signaled via the
'Location' property, only available if location signaling has been
explicitly enabled (e.g. with --location-set-enable-signal)
2021-07-01 01:10:39 +02:00
Aleksander Morgado
b385fc20b0 cli,location: TAC is 3 bytes in 5GNR
TAC is 3 bytes for NG-RAN as specified in 3GPP TS 38.413 clause
9.3.3.10 and in 3GPP TS 24.501 clause 9.10.3.8.

We'll always print it as 3 bytes in the cli output, as that's also
backwards compatible with the original 2 byte TAC in LTE.
2021-07-01 01:10:39 +02:00
Teijo Kinnunen
44671ced03 cli,location: use mm_location_3gpp_get_operator_code() in location output 2021-05-17 12:46:52 +03:00
Aleksander Morgado
f1e77cdbe6 cli: context: add ':' to the section titles
So that --help-all print all sections in the same way as the Help and
Application option groups.
2020-03-21 15:40:13 +01:00
Aleksander Morgado
1fa7e1260d cli: fix warnings with -Wshadow
mmcli-manager.c: In function ‘context_free’:
  mmcli-manager.c:167:24: error: declaration of ‘ctx’ shadows a global declaration [-Werror=shadow]
    167 | context_free (Context *ctx)
        |               ~~~~~~~~~^~~
  mmcli-manager.c:51:17: note: shadowed declaration is here
     51 | static Context *ctx;
        |                 ^~~
  ...
2020-01-31 15:18:35 +01:00
Aleksander Morgado
6c1991e930 cli,location: use new mm_location_gps_nmea_get_traces() 2020-01-01 09:13:45 +01:00
Aleksander Morgado
d5dc9751b6 location,agps: include support for MSB A-GPS 2019-04-09 12:24:39 +00:00
Aleksander Morgado
b77aa7ab0e location,agps: explicitly specify that MSA A-GPS is implemented
The A-GPS based implementations we currently have assume MSA A-GPS, so
rename the MMModemLocationSource enum value to reflect that.
2019-04-09 12:24:39 +00:00
Aleksander Morgado
619d2ce5ac cli,location: minor refactor to handle the location setup flags 2019-04-09 12:24:39 +00:00
Aleksander Morgado
b0fba14b1e cli: allow multiple output format types
In addition to the standard human-friendly output, we now allow a
machine-friendly key-value pair output, much easier to parse and use
by programs that look at the mmcli output.

This new key-value pair output should be treated as API from now on, so
third-party programs can assume the output is compatible from one
release to another.
2018-11-26 16:51:35 +00:00
Aleksander Morgado
cafc40245d cli,location: remove redundant --location-get-XXX actions
The --location-get action provides full location information from all
sources, which is better than per-source actions, as those were anyway
using the same API method to load location information as the global
one.
2018-11-26 16:51:35 +00:00
Ulrich Ölmann
4d16eec5fb mmcli,location: fix doubled variable declaration
Remove the redundant declaration of which slipped into the code in commit
091bf4dbd8 ("api: support location assistance data").

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
2018-09-21 15:15:54 +02:00
Aleksander Morgado
bc407a38d6 mmcli,location: print LAC/TAC/CID in hex
All these values are usually specified in hex, not in dec.
2018-09-12 17:15:13 +00:00
Aleksander Morgado
6e84f3d459 iface-modem-location: validate SUPL server address
Devices will expect SUPL server given as either IP:PORT or FQDN:PORT,
so just avoid saying we require a 'URL' because it's not true.

We will use a new helper method to parse and validate user-provided
SUPL server address.
2018-09-12 17:14:36 +00:00
Aleksander Morgado
091bf4dbd8 api: support location assistance data
Sometimes SUPL-server based A-GPS is not possible, e.g. if the module
doesn't have Internet connectivity. In such cases, the modem may
support injecting additional "assistance data" that may be downloaded
from the Internet using external means (e.g. WiFi), in order to keep
having a quick time to first fix.

We now support using this location assistance data, with the following
new API elements:

 * A new mask of supported assistance data types is provided in the
   SupportedAssistanceData property.

 * A new list of URLs from where the aassistance data may be
   downloaded is also provided in a new AssistanceDataServers
   property.

 * A new InjectAssistanceData() method is provided, to perform the
   data injection in the module once it's been downloaded to the host
   system.
2018-08-21 13:26:08 +00:00
Aleksander Morgado
7e6b4d7aa9 api,location: give Tracking Area Code field in 3GPP location info
The "location area code" field is given in GSM/UMTS networks
exclusively. LTE networks use the concept of "tracking area code"
instead.

This patch updates the Location interface to Provide separate fields
for LAC and TAC, instead of giving TAC values in the LAC field.
2018-08-08 21:46:28 +02:00
Aleksander Morgado
138b3dabc2 cli: validate SUPL server before showing it 2015-12-19 14:09:03 +01:00
Aleksander Morgado
9123c7bd93 cli: allow enabling/disabling location signaling via DBus
Not making them '--location-enable|disable-signal' because that's the pattern
used to enable/disable location sources. Instead, use the '--location-set-*'
pattern, as that is what we're already using for the other location setup
update.
2015-12-19 14:07:45 +01:00
Aleksander Morgado
6c35878f12 location: support updating the GPS refresh time
The default setup uses a refresh time of 30s, which means that even if the GPS
location updates are received at a higher frequency, the DBus interface will
still expose at most one update every 30s.

This patch includes a new "SetGpsRefreshTime()" method in the Location
interface, which takes a single 'u' parameter, specifying the refresh rate to
use, in seconds. This method also allows 0 being passed, which will make the
implementation to publish the GPS location updates are soon as ModemManager
detects them.

Along with the new method, a "GpsRefreshTime" read-only property is exposed
to specify the refresh time in effect.

The new method and property will only be applicable if the device has GPS
capabilities.

https://bugs.freedesktop.org/show_bug.cgi?id=89924
2015-12-19 12:22:30 +01:00
Aleksander Morgado
ee85a463cf license: mmcli is GPLv2+, not GPLv3+
mmcli is GPLv2+; that's what --version has always said and that's what the
README in ModemManager sources specifies:
  License.
  The ModemManager and mmcli binaries are both GPLv2+.
  The libmm-glib library is LGPLv2+.
2015-12-07 13:16:24 +01:00
Aleksander Morgado
72f4aa75d7 cli,location: allow enabling/disabling A-GPS 2014-09-05 11:30:24 +02:00
Aleksander Morgado
9dc5cdf78e cli,location: allow getting/setting SUPL server address 2014-09-05 11:30:24 +02:00
Aleksander Morgado
ad67d68179 location: new 'unmanaged' GPS setup
Standard GPS setup (raw/nmea) will both enable the GPS module and take full
control of the GPS port. This prevents other processes from reading the NMEA
traces from e.g. a tty. In order to handle this, a new 'unmanaged' GPS location
source is introduced, which will just enable/disable the GPS module, without
reading anything from the GPS port. Of course, both raw/nmea and unmanaged
setups cannot be enabled at the same time.
2014-07-02 12:28:56 +02:00
Ben Chan
d4177f554b cli: consistently use spaces for indentation 2014-05-20 09:32:15 +02:00
Aleksander Morgado
b508316a5a cli: new actions to setup or gather CDMA BS location source 2012-11-02 08:23:11 +01:00
Aleksander Morgado
c250fa3797 libmm-glib: remove the `libmm-common.h' header
Both the ModemManager daemon and the mmcli will now include `libmm-glib.h' only.

We also handle two new special `_LIBMM_INSIDE_MM' and `LIBMM_INSIDE_MMCLI'
symbols, which if included before the `libmm-glib.h' library allow us to:

 * Don't include the libmm-glib high level API in the ModemManager daemon, as
   the object names would clash with those in the core.

 * Define some of the methods of helper objects to be included only if compiling
   ModemManager daemon or the mmcli.
2012-10-04 10:17:12 +02:00
Aleksander Morgado
8f8bcd7724 cli: allow modifying default DBus timeout with `--timeout'
By default 30s will be used for every operation.
2012-07-25 11:44:01 +02:00
Aleksander Morgado
001f35234e cli: ensure modem is enabled when performing actions
Don't rely on the lock status, as the modem may say it requires SIM PIN 2, but
we're allowed to run most operations even with that unlock required.
2012-07-25 11:43:45 +02:00
Aleksander Morgado
f1d4e0fb63 mmcli: prefix all NMEA traces in order to get a pretty print 2012-03-29 09:18:04 +02:00
Aleksander Morgado
4bc990ce76 mmcli: new actions to request gps-specific or all available locations 2012-03-29 09:18:04 +02:00
Aleksander Morgado
9116a58eb6 mmcli: allow multiple location source enabling/disabling commands
For example, we do allow:
 mmcli -m 0 --enable-location-gps-nmea --disable-location-gps-raw

All the options get merged into a single Setup() call in the Location interface.
2012-03-29 09:18:04 +02:00
Aleksander Morgado
2bd321489d mmcli: new --location-enable-gps' and --location-disable-gps' actions 2012-03-29 09:17:53 +02:00
Aleksander Morgado
a69b4d2451 mmcli: new `--location-status' to show supported and enabled location sources 2012-03-29 09:17:53 +02:00
Aleksander Morgado
ceefa2c356 location: rework to allow multiple location sources
Location sources can now be enabled or disabled by using the mask of sources
given in Setup() (similar previous Enable()).
2012-03-29 09:17:53 +02:00
Aleksander Morgado
28f13c09ec mmcli: abort certain operations if modem is unlocked
Do not try to perform feature/capability specific actions if we're still
unlocked, as the modem didn't yet export the feature/capability specific
interface.

The only interfaces expected while modem is unlocked are the Modem and Simple
interfaces, as well as the SIM interface in the SIM object, of course.
2012-03-26 13:00:07 +02:00
Aleksander Morgado
bb352d5da3 libmm-common: `MMLocation3gpp' won't be considered internal any more
Renamed `MMCommonLocation3gpp' to `MMLocation3gpp', and removed the
`MMModemLocation3gpp' provided in libmm-glib. We'll just use the original one
from libmm-common always.
2012-03-16 14:53:19 +01:00
Aleksander Morgado
d528a2211b cli: ensure EOL is added at every error message 2012-03-15 14:15:01 +01:00
Aleksander Morgado
ffa374c793 cli: fail if requesting location actions and modem doesn't handle locations 2012-03-15 14:14:58 +01:00
Aleksander Morgado
f8cb1269e3 cli: include Location-related actions 2012-03-15 14:14:52 +01:00