[PATCH 2/2] Add custom flow control settings for Telit HE910, UE910, UL865
Aleksander Morgado
aleksander at aleksander.es
Thu Mar 12 03:35:37 PDT 2015
On Thu, Mar 12, 2015 at 10:00 AM, Aleksander Morgado
<aleksander at aleksander.es> wrote:
> When you call mm_base_at_command() with a valid callback method you
> also need to always call mm_base_modem_at_command_finish(), even if
> you don't want its output. You can just therefore do:
>
> /* Completely ignore errors */
> mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, NULL);
> return TRUE;
>
Well, to be honest, you don't *have to* call
mm_base_modem_at_command_finish(), but it's a good approach to always
do it. There are other async methods in MM which e.g. set as result in
the GSimpleAsyncResult a heap-allocated string, and rely on finish()
being called to return that very same string to the caller. In those
cases, if finish() wasn't called, we would be leaking memory. It's not
the case with mm_base_modem_at_command(), but well.
--
Aleksander
https://aleksander.es
More information about the ModemManager-devel
mailing list