[PATCH] Enable GPS_UNMANAGED for Huawei modems

Aleksander Morgado aleksander at aleksander.es
Fri Jul 4 00:58:25 PDT 2014


On Fri, Jul 4, 2014 at 3:18 AM, David McCullough
<david.mccullough at accelecon.com> wrote:
>
> Hi all,
>
> Here's a patch to enable the new unmanaged GPS mode for Huawei modems,
>
> Cheers,
> Davidm
>
> Signed-off-by: David McCullough <david.mccullough at accelecon.com>
>

The patch adds support for the new enumeration, *but* it doesn't avoid
opening/closing the GPS tty when unmanaged GPS is requested.

GPS port should not get opened if GPS unmanaged is being enabled, see e.g.:
http://cgit.freedesktop.org/ModemManager/ModemManager/tree/plugins/option/mm-broadband-modem-hso.c#n579

GPS port should not get closed if GPS unmanaged is being disabled, see e.g.:
http://cgit.freedesktop.org/ModemManager/ModemManager/tree/plugins/option/mm-broadband-modem-hso.c#n494


> ---
>  plugins/huawei/mm-broadband-modem-huawei.c | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c
> index 614b354..69d0bce 100644
> --- a/plugins/huawei/mm-broadband-modem-huawei.c
> +++ b/plugins/huawei/mm-broadband-modem-huawei.c
> @@ -3211,7 +3211,9 @@ parent_load_capabilities_ready (MMIfaceModemLocation *self,
>
>      /* not sure how to check if GPS is supported, just allow it */
>      if (mm_base_modem_peek_port_gps (MM_BASE_MODEM (self)))
> -        sources |= (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW);
> +        sources |= (MM_MODEM_LOCATION_SOURCE_GPS_NMEA |
> +                    MM_MODEM_LOCATION_SOURCE_GPS_RAW  |
> +                    MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED);
>
>      /* So we're done, complete */
>      g_simple_async_result_set_op_res_gpointer (simple,
> @@ -3283,11 +3285,13 @@ disable_location_gathering (MMIfaceModemLocation *_self,
>
>      /* Only stop GPS engine if no GPS-related sources enabled */
>      if (source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA |
> -                  MM_MODEM_LOCATION_SOURCE_GPS_RAW)) {
> +                  MM_MODEM_LOCATION_SOURCE_GPS_RAW |
> +                  MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) {
>          self->priv->enabled_sources &= ~source;
>
>          if (!(self->priv->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA |
> -                                            MM_MODEM_LOCATION_SOURCE_GPS_RAW)))
> +                                             MM_MODEM_LOCATION_SOURCE_GPS_RAW |
> +                                             MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)))
>              stop_gps = TRUE;
>      }
>
> @@ -3408,10 +3412,12 @@ parent_enable_location_gathering_ready (MMIfaceModemLocation *self,
>
>      /* NMEA and RAW are both enabled in the same way */
>      if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA |
> -                       MM_MODEM_LOCATION_SOURCE_GPS_RAW)) {
> +                       MM_MODEM_LOCATION_SOURCE_GPS_RAW |
> +                       MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) {
>          /* Only start GPS engine if not done already */
>          if (!(ctx->self->priv->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA |
> -                                                  MM_MODEM_LOCATION_SOURCE_GPS_RAW)))
> +                                                  MM_MODEM_LOCATION_SOURCE_GPS_RAW |
> +                                                  MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)))
>              start_gps = TRUE;
>          ctx->self->priv->enabled_sources |= ctx->source;
>      }
> --
> 1.8.2.rc0
>



-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list