Logo Search packages:      
Sourcecode: nut version File versions

libusb.c File Reference


Detailed Description

HID Library - Generic USB backend for Generic HID Access (using MGE HIDParser).

Author:
Copyright (C) 2003 Arnaud Quette <arnaud.quette@free.fr> && <arnaud.quette@mgeups.com> Philippe Marzouk <philm@users.sourceforge.net> (dump_hex())
This program is sponsored by MGE UPS SYSTEMS - opensource.mgeups.com

The logic of this file is ripped from mge-shut driver (also from Arnaud Quette), which is a "HID over serial link" UPS driver for Network UPS Tools <http://www.networkupstools.org/>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

--------------------------------------------------------------------------

Definition in file libusb.c.

#include <stdio.h>
#include <string.h>
#include "libhid.h"
#include "hid-usb.h"
#include "config.h"
#include "common.h"

Go to the source code of this file.

Classes

struct  my_usb_hid_descriptor

Defines

#define TRACE   upsdebugx
#define USB_TIMEOUT   5000

Functions

void libusb_close (HIDDevice *curDevice)
int libusb_get_interrupt (unsigned char *buf, int bufsize, int timeout)
int libusb_get_report (int ReportId, unsigned char *raw_buf, int ReportSize)
int libusb_get_string (int StringIdx, char *string)
int libusb_open (HIDDevice *curDevice, MatchFlags *flg, unsigned char *ReportDesc, int mode)
int libusb_set_report (int ReportId, unsigned char *raw_buf, int ReportSize)
void upsdebugx (int level, const char *fmt,...)
void usb_fetch_and_parse_descriptors (usb_dev_handle *udev)

Variables

struct usb_bus * bus
struct usb_device * dev
usb_dev_handle * udev = NULL


Generated by  Doxygen 1.6.0   Back to index