[PATCH] huawei: implement modem reset

Aleksander Morgado aleksander at lanedo.com
Mon Aug 12 00:05:47 PDT 2013


On 10/08/13 05:56, Ben Chan wrote:
> ---
>  plugins/huawei/mm-broadband-modem-huawei.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 

Pushed, thanks.

> diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c
> index 367ab3d..c34acc2 100644
> --- a/plugins/huawei/mm-broadband-modem-huawei.c
> +++ b/plugins/huawei/mm-broadband-modem-huawei.c
> @@ -422,6 +422,30 @@ sysinfo (MMBroadbandModemHuawei *self,
>  }
>  
>  /*****************************************************************************/
> +/* Reset (Modem interface) */
> +
> +static gboolean
> +reset_finish (MMIfaceModem *self,
> +              GAsyncResult *res,
> +              GError **error)
> +{
> +    return !!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error);
> +}
> +
> +static void
> +reset (MMIfaceModem *self,
> +       GAsyncReadyCallback callback,
> +       gpointer user_data)
> +{
> +    mm_base_modem_at_command (MM_BASE_MODEM (self),
> +                              "^RESET",
> +                              3,
> +                              FALSE,
> +                              callback,
> +                              user_data);
> +}
> +
> +/*****************************************************************************/
>  /* Load access technologies (Modem interface) */
>  
>  static MMModemAccessTechnology
> @@ -2951,6 +2975,8 @@ iface_modem_init (MMIfaceModem *iface)
>  {
>      iface_modem_parent = g_type_interface_peek_parent (iface);
>  
> +    iface->reset = reset;
> +    iface->reset_finish = reset_finish;
>      iface->load_access_technologies = load_access_technologies;
>      iface->load_access_technologies_finish = load_access_technologies_finish;
>      iface->load_unlock_retries = load_unlock_retries;
> 


-- 
Aleksander


More information about the ModemManager-devel mailing list