darwin.c

Go to the documentation of this file.
00001 
00004 #define HID_INTERNAL
00005 
00006 #include <hid.h>
00007 #include <os.h>
00008 #include <compiler.h>
00009 
00010 #include <debug.h>
00011 #include <assert.h>
00012 
00013 hid_return hid_os_force_claim(HIDInterface* const hidif, int const interface,
00014     HIDInterfaceMatcher const* const matcher, unsigned short retries UNUSED)
00015 {
00016   if (!hidif) {
00017     ERROR("cannot open NULL HIDInterface.");
00018     return HID_RET_INVALID_PARAMETER;
00019   }
00020 
00021   if (!hid_is_opened(hidif)) {
00022     ERROR("cannot force claim interface of unopened HIDInterface.");
00023     return HID_RET_DEVICE_ALREADY_OPENED;
00024   }
00025 
00026   if (!matcher) {
00027     ERROR("cannot match against NULL HIDInterfaceMatcher.");
00028     return HID_RET_INVALID_PARAMETER;
00029   }
00030 
00031   WARNING("code not tested on the Darwin platform!");
00032   TRACE("claiming USB device %s...", hidif->id);
00033 #if 1
00034   if (usb_claim_interface(hidif->dev_handle, interface) < 0) {
00035     WARNING("failed to claim USB device %s...", hidif->id);
00036     /* return HID_RET_FAIL_CLAIM_IFACE; */
00037   }
00038 #endif
00039   return HID_RET_SUCCESS;
00040 }
00041 
00042 /* COPYRIGHT --
00043  *
00044  * This file is part of libhid, a user-space HID access library.
00045  * libhid is (c) 2003-2005
00046  *   Martin F. Krafft <libhid@pobox.madduck.net>
00047  *   Charles Lepple <clepple@ghz.cc>
00048  *   Arnaud Quette <arnaud.quette@free.fr> && <arnaud.quette@mgeups.com>
00049  * and distributed under the terms of the GNU General Public License.
00050  * See the file ./COPYING in the source distribution for more information.
00051  *
00052  * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
00053  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES
00054  * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00055  */

Generated on Sun Mar 30 15:28:24 2008 for libhid by  doxygen 1.5.1