Hi Patrik,

On Sat, Nov 27, 2010 at 09:55:40PM +0200, [email protected] wrote:
> From: Patrik Flykt <[email protected]>
> 
> When a service fails, call __connman_agent_report_error to send an
> ReportError method call to the agent. Sending of ReportError is requested
> only if the service was connected due to a D-Bus request. Thus automatic
> connection creation will be done silently without invoking an agent.
Some comments:


> ---
>  src/service.c |   22 ++++++++++++++++++++--
>  1 files changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/src/service.c b/src/service.c
> index 1c29d88..ce4b784 100644
> --- a/src/service.c
> +++ b/src/service.c
> @@ -2942,6 +2942,15 @@ static void service_complete(struct connman_service 
> *service)
>       __connman_storage_save_service(service);
>  }
>  
> +static void report_error_cb(struct connman_service *service,
> +                     gboolean retry, void *user_data)
> +{
> +     if (retry == TRUE)
> +             __connman_service_connect(service);
> +     else
> +             service_complete(service);
> +}
So here I see an issue: If we don't want to retry, ConnMan will just call
service_complete, but the UI won't be notified about the service state change.
If you look at __connman_service_indicate_state() you'll see that
connman_profile_changed() is called when we fail to connect, which sends a
D-Bus signal to notify apps about a service list change.

I think what we want here is to call __connman_profile_changed() from your
callback, but return from __connman_service_indicate_state() when we're
calling the agent method. Unless we want to send D-Bus signals to let UI/apps
know that the service is in failure state. But I think we want to do that if
the agent doesn't want to retry anymore, or if we couldn't call any agent.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to