| 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_HELPERS_UDEV_H |
| 23 |
#define QFU_HELPERS_UDEV_H |
| 24 |
|
| 25 |
#include "config.h" |
| 26 |
#include <gio/gio.h> |
| 27 |
|
| 28 |
#if !defined WITH_UDEV |
| 29 |
# error udev not found |
| 30 |
#endif |
| 31 |
|
| 32 |
G_BEGIN_DECLS |
| 33 |
|
| 34 |
gchar *qfu_helpers_udev_find_by_file (GFile *file, |
| 35 |
GError **error); |
| 36 |
gchar *qfu_helpers_udev_find_by_file_path (const gchar *path, |
| 37 |
GError **error); |
| 38 |
gchar *qfu_helpers_udev_find_by_device_info (guint16 vid, |
| 39 |
guint16 pid, |
| 40 |
guint busnum, |
| 41 |
guint devnum, |
| 42 |
GError **error); |
| 43 |
|
| 44 |
GList *qfu_helpers_udev_list_devices (QfuHelpersDeviceType device_type, |
| 45 |
QfuHelpersDeviceMode device_mode, |
| 46 |
const gchar *sysfs_path); |
| 47 |
|
| 48 |
void qfu_helpers_udev_wait_for_device (QfuHelpersDeviceType device_type, |
| 49 |
QfuHelpersDeviceMode device_mode, |
| 50 |
const gchar *sysfs_path, |
| 51 |
const gchar *peer_port, |
| 52 |
GCancellable *cancellable, |
| 53 |
GAsyncReadyCallback callback, |
| 54 |
gpointer user_data); |
| 55 |
GFile *qfu_helpers_udev_wait_for_device_finish (GAsyncResult *res, |
| 56 |
GError **error); |
| 57 |
|
| 58 |
typedef struct _QfuHelpersUdevGenericMonitor QfuHelpersUdevGenericMonitor; |
| 59 |
QfuHelpersUdevGenericMonitor *qfu_helpers_udev_generic_monitor_new (const gchar *sysfs_path); |
| 60 |
void qfu_helpers_udev_generic_monitor_free (QfuHelpersUdevGenericMonitor *self); |
| 61 |
|
| 62 |
G_END_DECLS |
| 63 |
|
| 64 |
#endif /* QFU_HELPERS_UDEV_H */ |