Debian Codegraph @

src/qmi-firmware-update/qfu-sahara-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) 2019 Zodiac Inflight Innovations
19 * Copyright (C) 2019 Aleksander Morgado <[email protected]>
20 */
21
22 #ifndef QFU_SAHARA_DEVICE_H
23 #define QFU_SAHARA_DEVICE_H
24
25 #include <glib-object.h>
26 #include <gio/gio.h>
27
28 G_BEGIN_DECLS
29
30 #define QFU_TYPE_SAHARA_DEVICE (qfu_sahara_device_get_type ())
31 #define QFU_SAHARA_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), QFU_TYPE_SAHARA_DEVICE, QfuSaharaDevice))
32 #define QFU_SAHARA_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), QFU_TYPE_SAHARA_DEVICE, QfuSaharaDeviceClass))
33 #define QFU_IS_SAHARA_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), QFU_TYPE_SAHARA_DEVICE))
34 #define QFU_IS_SAHARA_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), QFU_TYPE_SAHARA_DEVICE))
35 #define QFU_SAHARA_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), QFU_TYPE_SAHARA_DEVICE, QfuSaharaDeviceClass))
36
37 typedef struct _QfuSaharaDevice QfuSaharaDevice;
38 typedef struct _QfuSaharaDeviceClass QfuSaharaDeviceClass;
39 typedef struct _QfuSaharaDevicePrivate QfuSaharaDevicePrivate;
40
41 struct _QfuSaharaDevice {
42 GObject parent;
43 QfuSaharaDevicePrivate *priv;
44 };
45
46 struct _QfuSaharaDeviceClass {
47 GObjectClass parent;
48 };
49
50 GType qfu_sahara_device_get_type (void);
51 G_DEFINE_AUTOPTR_CLEANUP_FUNC (QfuSaharaDevice, g_object_unref);
52
53 QfuSaharaDevice *qfu_sahara_device_new (GFile *file,
54 GCancellable *cancellable,
55 GError **error);
56 gboolean qfu_sahara_device_firehose_setup_download (QfuSaharaDevice *self,
57 QfuImage *image,
58 guint *n_blocks,
59 GCancellable *cancellable,
60 GError **error);
61 gboolean qfu_sahara_device_firehose_write_block (QfuSaharaDevice *self,
62 QfuImage *image,
63 guint block_i,
64 GCancellable *cancellable,
65 GError **error);
66 gboolean qfu_sahara_device_firehose_teardown_download (QfuSaharaDevice *self,
67 QfuImage *image,
68 GCancellable *cancellable,
69 GError **error);
70 gboolean qfu_sahara_device_firehose_reset (QfuSaharaDevice *self,
71 GCancellable *cancellable,
72 GError **error);
73
74 G_END_DECLS
75
76 #endif /* QFU_SAHARA_DEVICE_H */