Esempio n. 1
0
static void
list_sms_ready (MMModemMessaging *modem,
                GAsyncResult *res,
                GetSmsContext *ctx)
{
    GList *sms_list;
    GError *error = NULL;

    sms_list = mm_modem_messaging_list_finish (modem, res, &error);
    if (error) {
        g_printerr ("error: couldn't list SMS at '%s': '%s'\n",
                    mm_modem_messaging_get_path (modem),
                    error->message);
        exit (EXIT_FAILURE);
    }

    ctx->sms = find_sms_in_list (sms_list, ctx->sms_path);
    g_list_free_full (sms_list, (GDestroyNotify) g_object_unref);

    /* Found! */
    if (ctx->sms) {
        g_simple_async_result_set_op_res_gpointer (
            ctx->result,
            ctx,
            (GDestroyNotify)get_sms_context_free);
        get_sms_context_complete (ctx);
        return;
    }

    /* Not found, try with next modem */
    look_for_sms_in_modem (ctx);
}
static void
list_ready (MMModemMessaging *modem,
            GAsyncResult     *result,
            gpointer          nothing)
{
    GList *operation_result;
    GError *error = NULL;

    operation_result = mm_modem_messaging_list_finish (modem, result, &error);
    list_process_reply (operation_result, error);

    mmcli_async_operation_done ();
}