From 22f703cab05b7cd368f4de9e03991b7664dc5022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 1 Sep 2014 13:56:46 +0200 Subject: Initial import of argyll version 1.5.1-8 --- spectro/hidio.h | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 spectro/hidio.h (limited to 'spectro/hidio.h') diff --git a/spectro/hidio.h b/spectro/hidio.h new file mode 100644 index 0000000..b25fe03 --- /dev/null +++ b/spectro/hidio.h @@ -0,0 +1,87 @@ + +#ifndef HIDIO_H + + /* General USB HID I/O support */ + +/* + * Argyll Color Correction System + * + * Author: Graeme W. Gill + * Date: 2007/10/10 + * + * Copyright 2006 - 2013 Graeme W. Gill + * All rights reserved. + * + * This material is licenced under the GNU GENERAL PUBLIC LICENSE Version 2 or later :- + * see the License2.txt file for licencing details. + */ + +/* These routines supliement the class code in ntio.c and unixio.c */ + +#ifdef __APPLE__ +#include +#include +#include +#include +#include +#include +#endif /* __APPLE__ */ + +#ifdef __cplusplus + extern "C" { +#endif + +/* Add or modify paths to USB HID connected instruments, to the existing */ +/* icompath paths in the icoms structure, if HID access is supported. */ +/* return icom error */ +int hid_get_paths(struct _icompaths *p); + +void hid_close_port(icoms *p); + +/* Set the HID specific icoms methods */ +void hid_set_hid_methods(icoms *p); + +/* Copy hid_idevice contents */ +/* return icom error */ +int hid_copy_hid_idevice(icoms *d, icompath *s); + +/* Cleanup and then free a hid_del_hid_idevice */ +void hid_del_hid_idevice(struct hid_idevice *dev); + +/* Cleanup any HID specific icoms info */ +void hid_del_hid(icoms *p); + +/* Opaque structure to hid OS dependent HID details */ +struct hid_idevice { +#if defined(NT) + char *dpath; /* Device path */ + /* Stuff setup when device is open: */ + HANDLE fh; /* File handle for write/read */ + OVERLAPPED ols; /* Overlapped structure for write/read */ +#endif +#if defined(__APPLE__) + int lid; /* Location ID */ + io_object_t ioob; /* Object to open */ + /* Stuff setup when device is open: */ + IOHIDDeviceInterface122 **device; /* OS X HID device we've opened */ + mach_port_t port; /* Other stuff present when opened */ + CFRunLoopSourceRef evsrc; + CFRunLoopRef rlr; + IOReturn result; + int bread; /* Bytes read by callback */ +#endif +#if defined (UNIX) && !defined(__APPLE__) + int temp; /* Shut the compiler up */ +#endif +}; + +/* Cleanup and then free an hidd entry */ +void hid_del_hid_idevice(struct hid_idevice *hidd); + +#ifdef __cplusplus + } +#endif + +#define HIDIO_H +#endif /* HIDIO_H */ + -- cgit v1.2.3