aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli-modem-location.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-03-14 09:22:30 +0100
committerAleksander Morgado <aleksander@gnu.org>2019-04-09 12:24:39 +0000
commitd5dc9751b6e5d8472dec7b4ef076297e1df3d1f1 (patch)
tree41056704ea48548c88e17442f8248c410fc78c2f /cli/mmcli-modem-location.c
parentcaa1f8fdc1ad8c489a5584a4a0c50b1d0ff62f2a (diff)
location,agps: include support for MSB A-GPS
Diffstat (limited to 'cli/mmcli-modem-location.c')
-rw-r--r--cli/mmcli-modem-location.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/cli/mmcli-modem-location.c b/cli/mmcli-modem-location.c
index 075e874e..5469baac 100644
--- a/cli/mmcli-modem-location.c
+++ b/cli/mmcli-modem-location.c
@@ -16,7 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2012 Google, Inc.
- * Copyright (C) 2012 Lanedo GmbH <aleksander@lanedo.com>
+ * Copyright (C) 2012 Lanedo GmbH
+ * Copyright (C) 2012-2019 Aleksander Morgado <aleksander@aleksander.es>
*/
#include "config.h"
@@ -51,6 +52,8 @@ static gboolean enable_3gpp_flag;
static gboolean disable_3gpp_flag;
static gboolean enable_agps_msa_flag;
static gboolean disable_agps_msa_flag;
+static gboolean enable_agps_msb_flag;
+static gboolean disable_agps_msb_flag;
static gboolean enable_gps_nmea_flag;
static gboolean disable_gps_nmea_flag;
static gboolean enable_gps_raw_flag;
@@ -91,6 +94,14 @@ static GOptionEntry entries[] = {
"Disable MSA A-GPS location gathering.",
NULL
},
+ { "location-enable-agps-msb", 0, 0, G_OPTION_ARG_NONE, &enable_agps_msb_flag,
+ "Enable MSB A-GPS location gathering.",
+ NULL
+ },
+ { "location-disable-agps-msb", 0, 0, G_OPTION_ARG_NONE, &disable_agps_msb_flag,
+ "Disable MSB A-GPS location gathering.",
+ NULL
+ },
{ "location-enable-gps-nmea", 0, 0, G_OPTION_ARG_NONE, &enable_gps_nmea_flag,
"Enable NMEA-based GPS location gathering.",
NULL
@@ -164,6 +175,7 @@ mmcli_modem_location_get_option_group (void)
#define any_location_setup_flag ( \
enable_3gpp_flag || disable_3gpp_flag || \
enable_agps_msa_flag || disable_agps_msa_flag || \
+ enable_agps_msb_flag || disable_agps_msb_flag || \
enable_gps_nmea_flag || disable_gps_nmea_flag || \
enable_gps_raw_flag || disable_gps_raw_flag || \
enable_cdma_bs_flag || disable_cdma_bs_flag || \
@@ -181,6 +193,7 @@ mmcli_modem_location_options_enabled (void)
if ((enable_3gpp_flag && disable_3gpp_flag) ||
(enable_agps_msa_flag && disable_agps_msa_flag) ||
+ (enable_agps_msb_flag && disable_agps_msb_flag) ||
(enable_gps_nmea_flag && disable_gps_nmea_flag) ||
(enable_gps_raw_flag && disable_gps_raw_flag) ||
(enable_gps_unmanaged_flag && disable_gps_unmanaged_flag) ||
@@ -276,7 +289,7 @@ print_location_status (void)
gps_refresh_rate = g_strdup_printf ("%u", rate);
/* If A-GPS supported, show SUPL server setup */
- if (mm_modem_location_get_capabilities (ctx->modem_location) & MM_MODEM_LOCATION_SOURCE_AGPS_MSA)
+ if (mm_modem_location_get_capabilities (ctx->modem_location) & (MM_MODEM_LOCATION_SOURCE_AGPS_MSA | MM_MODEM_LOCATION_SOURCE_AGPS_MSB))
gps_supl_server = mm_modem_location_get_supl_server (ctx->modem_location);
mask = mm_modem_location_get_supported_assistance_data (ctx->modem_location);
@@ -452,6 +465,11 @@ build_sources_from_flags (void)
if (disable_agps_msa_flag)
sources &= ~MM_MODEM_LOCATION_SOURCE_AGPS_MSA;
+ if (enable_agps_msb_flag)
+ sources |= MM_MODEM_LOCATION_SOURCE_AGPS_MSB;
+ if (disable_agps_msb_flag)
+ sources &= ~MM_MODEM_LOCATION_SOURCE_AGPS_MSB;
+
if (enable_gps_nmea_flag)
sources |= MM_MODEM_LOCATION_SOURCE_GPS_NMEA;
if (disable_gps_nmea_flag)