| 1 |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 |
/* |
| 3 |
* qmi-firmware-update -- Command line tool to update firmware in QMI devices |
| 4 |
* |
| 5 |
* This program is free software: you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation, either version 2 of the License, or |
| 8 |
* (at your option) any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
* |
| 18 |
* Copyright (C) 2016 Zodiac Inflight Innovations |
| 19 |
* Copyright (C) 2016-2017 Aleksander Morgado <[email protected]> |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef QFU_UPDATER_H |
| 23 |
#define QFU_UPDATER_H |
| 24 |
|
| 25 |
#include <glib-object.h> |
| 26 |
#include <gio/gio.h> |
| 27 |
|
| 28 |
#include "qfu-device-selection.h" |
| 29 |
|
| 30 |
G_BEGIN_DECLS |
| 31 |
|
| 32 |
#define QFU_TYPE_UPDATER (qfu_updater_get_type ()) |
| 33 |
#define QFU_UPDATER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), QFU_TYPE_UPDATER, QfuUpdater)) |
| 34 |
#define QFU_UPDATER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), QFU_TYPE_UPDATER, QfuUpdaterClass)) |
| 35 |
#define QFU_IS_UPDATER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), QFU_TYPE_UPDATER)) |
| 36 |
#define QFU_IS_UPDATER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), QFU_TYPE_UPDATER)) |
| 37 |
#define QFU_UPDATER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), QFU_TYPE_UPDATER, QfuUpdaterClass)) |
| 38 |
|
| 39 |
typedef struct _QfuUpdater QfuUpdater; |
| 40 |
typedef struct _QfuUpdaterClass QfuUpdaterClass; |
| 41 |
typedef struct _QfuUpdaterPrivate QfuUpdaterPrivate; |
| 42 |
|
| 43 |
struct _QfuUpdater { |
| 44 |
GObject parent; |
| 45 |
QfuUpdaterPrivate *priv; |
| 46 |
}; |
| 47 |
|
| 48 |
struct _QfuUpdaterClass { |
| 49 |
GObjectClass parent; |
| 50 |
}; |
| 51 |
|
| 52 |
GType qfu_updater_get_type (void); |
| 53 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC (QfuUpdater, g_object_unref); |
| 54 |
|
| 55 |
QfuUpdater *qfu_updater_new (QfuDeviceSelection *device_selection, |
| 56 |
const gchar *firmware_version, |
| 57 |
const gchar *config_version, |
| 58 |
const gchar *carrier, |
| 59 |
QmiDeviceOpenFlags device_open_flags, |
| 60 |
gboolean ignore_version_errors, |
| 61 |
gboolean override_download, |
| 62 |
guint8 modem_storage_index, |
| 63 |
gboolean skip_validation); |
| 64 |
QfuUpdater *qfu_updater_new_download (QfuDeviceSelection *device_selection); |
| 65 |
void qfu_updater_run (QfuUpdater *self, |
| 66 |
GList *image_file_list, |
| 67 |
GCancellable *cancellable, |
| 68 |
GAsyncReadyCallback callback, |
| 69 |
gpointer user_data); |
| 70 |
gboolean qfu_updater_run_finish (QfuUpdater *self, |
| 71 |
GAsyncResult *res, |
| 72 |
GError **error); |
| 73 |
|
| 74 |
G_END_DECLS |
| 75 |
|
| 76 |
#endif /* QFU_UPDATER_H */ |