Re: [OT] Re: [MM] [PATCH v2] iface-modem, novatel-lte: disable network scan in LTE mode

>> 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:

But note that for new code, GTask is the new better and cleaner
GSimpleAsyncResult replacement:

There's no manual or tutorial just talking about async GIO functions,
AFAIK, I guess you just end up getting used to it...


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