Re: [MM] [PATCH 4/5] novatel: Poll for whether the connection still exists.



Hey Nathan,

>  static void
> +poll_connection_ready (MMBaseModem *modem,
> +                       GAsyncResult *res,
> +                       MMBroadbandBearerNovatel *bearer)
> +{
> +    const gchar *result;
> +    GError *error = NULL;
> +
> +    result = mm_base_modem_at_command_finish (modem, res, &error);
> +    if (!result) {
> +        mm_warn ("QMI connection status failed: %s", error->message);
> +        g_error_free (error);
> +    } else {
> +        result = mm_strip_tag (result, "$NWQMISTATUS:");
> +        if (g_strrstr(result, "QMI State: DISCONNECTED")) {
> +            mm_bearer_report_disconnection (MM_BEARER (bearer));
> +            g_source_remove (bearer->priv->connection_poller);
> +            bearer->priv->connection_poller = 0;
> +            bearer->priv->connection_modem = NULL;
> +        }
> +    }
> +}
> +
> +static gboolean
> +poll_connection (MMBroadbandBearerNovatel *bearer)
> +{
> +    mm_base_modem_at_command (
> +        bearer->priv->connection_modem,
> +        "$NWQMISTATUS",
> +        3,
> +        FALSE,
> +        (GAsyncReadyCallback)poll_connection_ready,
> +        bearer);
> +    return TRUE;
> +}


Given that the $NWQMISTATUS reply is not bearer-specific (reports
overall status of the modem), I was thinking in moving the periodic
connectivity check to MMIfaceModem instead, and plug it in using the
same logic as e.g. the signal quality check. In that way, other
implementations (e.g. Samsung) could benefit from the same generic
timeout handling logic. What do you think?

-- 
Aleksander


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]