Debian Codegraph @

src/sensors/dtp94/dtp94-device.h

raw
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2013 Richard Hughes <[email protected]>
4 *
5 * Licensed under the GNU General Public License Version 2
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21
22 #ifndef __DTP94_DEVICE_H
23 #define __DTP94_DEVICE_H
24
25 #include <glib-object.h>
26 #include <gusb.h>
27 #include <colord-private.h>
28
29 G_BEGIN_DECLS
30
31 #define DTP94_DEVICE_ERROR dtp94_device_error_quark()
32
33 typedef enum {
34 DTP94_DEVICE_ERROR_INTERNAL,
35 DTP94_DEVICE_ERROR_NO_DATA,
36 DTP94_DEVICE_ERROR_NO_SUPPORT,
37 DTP94_DEVICE_ERROR_LAST
38 } Dtp94DeviceError;
39
40 GQuark dtp94_device_error_quark (void);
41 gboolean dtp94_device_send_data (GUsbDevice *device,
42 const guint8 *request,
43 gsize request_len,
44 guint8 *reply,
45 gsize reply_len,
46 gsize *reply_read,
47 GError **error)
48 G_GNUC_WARN_UNUSED_RESULT;
49 gboolean dtp94_device_send_cmd (GUsbDevice *device,
50 const gchar *command,
51 GError **error)
52 G_GNUC_WARN_UNUSED_RESULT;
53 CdColorXYZ *dtp94_device_take_sample (GUsbDevice *device,
54 CdSensorCap cap,
55 GError **error)
56 G_GNUC_WARN_UNUSED_RESULT;
57 gchar *dtp94_device_get_serial (GUsbDevice *device,
58 GError **error)
59 G_GNUC_WARN_UNUSED_RESULT;
60 gboolean dtp94_device_setup (GUsbDevice *device,
61 GError **error)
62 G_GNUC_WARN_UNUSED_RESULT;
63
64 G_END_DECLS
65
66 #endif /* __DTP94_DEVICE_H */
67