Debian Codegraph @

src/qmi-firmware-update/qfu-qdl-device.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 Bjørn Mork <[email protected]>
19 * Copyright (C) 2016 Zodiac Inflight Innovations
20 * Copyright (C) 2016-2017 Aleksander Morgado <[email protected]>
21 */
22
23 #ifndef QFU_QDL_DEVICE_H
24 #define QFU_QDL_DEVICE_H
25
26 #include <glib-object.h>
27 #include <gio/gio.h>
28
29 G_BEGIN_DECLS
30
31 #define QFU_TYPE_QDL_DEVICE (qfu_qdl_device_get_type ())
32 #define QFU_QDL_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), QFU_TYPE_QDL_DEVICE, QfuQdlDevice))
33 #define QFU_QDL_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), QFU_TYPE_QDL_DEVICE, QfuQdlDeviceClass))
34 #define QFU_IS_QDL_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), QFU_TYPE_QDL_DEVICE))
35 #define QFU_IS_QDL_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), QFU_TYPE_QDL_DEVICE))
36 #define QFU_QDL_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), QFU_TYPE_QDL_DEVICE, QfuQdlDeviceClass))
37
38 typedef struct _QfuQdlDevice QfuQdlDevice;
39 typedef struct _QfuQdlDeviceClass QfuQdlDeviceClass;
40 typedef struct _QfuQdlDevicePrivate QfuQdlDevicePrivate;
41
42 struct _QfuQdlDevice {
43 GObject parent;
44 QfuQdlDevicePrivate *priv;
45 };
46
47 struct _QfuQdlDeviceClass {
48 GObjectClass parent;
49 };
50
51 GType qfu_qdl_device_get_type (void);
52 G_DEFINE_AUTOPTR_CLEANUP_FUNC (QfuQdlDevice, g_object_unref);
53
54 QfuQdlDevice *qfu_qdl_device_new (GFile *file,
55 GCancellable *cancellable,
56 GError **error);
57 gboolean qfu_qdl_device_hello (QfuQdlDevice *self,
58 GCancellable *cancellable,
59 GError **error);
60 gboolean qfu_qdl_device_ufopen (QfuQdlDevice *self,
61 QfuImage *image,
62 GCancellable *cancellable,
63 GError **error);
64 gboolean qfu_qdl_device_ufwrite (QfuQdlDevice *self,
65 QfuImage *image,
66 guint16 sequence,
67 GCancellable *cancellable,
68 GError **error);
69 gboolean qfu_qdl_device_ufclose (QfuQdlDevice *self,
70 GCancellable *cancellable,
71 GError **error);
72 gboolean qfu_qdl_device_reset (QfuQdlDevice *self,
73 GCancellable *cancellable,
74 GError **error);
75
76 G_END_DECLS
77
78 #endif /* QFU_QDL_DEVICE_H */