Re: [OT] Re: [MM] [PATCH v2] iface-modem, novatel-lte: disable network scan in LTE mode
- From: Aleksander Morgado <aleksander lanedo com>
- To: Marius Kotsbak <marius kotsbak com>
- Cc: networkmanager-list gnome org
- Subject: Re: [OT] Re: [MM] [PATCH v2] iface-modem, novatel-lte: disable network scan in LTE mode
- Date: Fri, 04 Jan 2013 12:06:21 +0100
>
>> You cannot mix in the same async method a code execution path using
>> mm_base_modem_at_command() with another one using GSimpleAsyncResult and
>> completion in idle. When you use mm_base_modem_at_command(), in
>> finish() you're expected to use mm_base_modem_at_command_finish(), like
>> you did. But when you use GSimpleAsyncResult and completion in idle you
>> should use g_simple_async_result_propagate_error() in finish(). The fact
>> that it may work as expected is due to how at_command_finish() is
>> implemented; but you shouldn't rely on that.
>>
>> So you'll need to use GSimpleAsyncResult for both cases, i.e. provide a
>> _ready() GAsyncReadyCallback in mm_base_modem_at_command() to which you
>> pass 'simple' as user_data; and then complete the 'simple' from within
>> the _ready() method. In this way, you can safely call
>> g_simple_async_result_propagate_error() in finish().
>
> Offtopic, but do you know where this is documented? Any books, online
> docs or api docs to recommend? Is it part of gnome/glibs, or dbus?
>
If you mean the overall GSimpleAsyncResult behaviour; I guess the
reference is still the GLib/GIO API documentation:
http://developer.gnome.org/gio/unstable/GSimpleAsyncResult.html
But note that for new code, GTask is the new better and cleaner
GSimpleAsyncResult replacement:
http://developer.gnome.org/gio/unstable/GTask.html
There's no manual or tutorial just talking about async GIO functions,
AFAIK, I guess you just end up getting used to it...
--
Aleksander
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]