Debian Codegraph @

src/qmi-firmware-update/qfu-reseter.h

raw
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_RESETER_H
23 #define QFU_RESETER_H
24
25 #include <glib-object.h>
26 #include <gio/gio.h>
27 #include <libqmi-glib.h>
28
29 #include "qfu-device-selection.h"
30
31 G_BEGIN_DECLS
32
33 #define QFU_TYPE_RESETER (qfu_reseter_get_type ())
34 #define QFU_RESETER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), QFU_TYPE_RESETER, QfuReseter))
35 #define QFU_RESETER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), QFU_TYPE_RESETER, QfuReseterClass))
36 #define QFU_IS_RESETER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), QFU_TYPE_RESETER))
37 #define QFU_IS_RESETER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), QFU_TYPE_RESETER))
38 #define QFU_RESETER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), QFU_TYPE_RESETER, QfuReseterClass))
39
40 typedef struct _QfuReseter QfuReseter;
41 typedef struct _QfuReseterClass QfuReseterClass;
42 typedef struct _QfuReseterPrivate QfuReseterPrivate;
43
44 struct _QfuReseter {
45 GObject parent;
46 QfuReseterPrivate *priv;
47 };
48
49 struct _QfuReseterClass {
50 GObjectClass parent;
51 };
52
53 GType qfu_reseter_get_type (void);
54 G_DEFINE_AUTOPTR_CLEANUP_FUNC (QfuReseter, g_object_unref);
55
56 QfuReseter *qfu_reseter_new (QfuDeviceSelection *device_selection,
57 QmiClientDms *qmi_client,
58 QmiDeviceOpenFlags device_open_flags);
59 void qfu_reseter_run (QfuReseter *self,
60 GCancellable *cancellable,
61 GAsyncReadyCallback callback,
62 gpointer user_data);
63 gboolean qfu_reseter_run_finish (QfuReseter *self,
64 GAsyncResult *res,
65 GError **error);
66
67 G_END_DECLS
68
69 #endif /* QFU_RESETER_H */