Logo Search packages:      
Sourcecode: nut version File versions

libhid.h File Reference


Detailed Description

HID Library - User API.

Author:
Copyright (C) 2003 Arnaud Quette <arnaud.quette@free.fr> && <arnaud.quette@mgeups.com> Charles Lepple <clepple@ghz.cc> 2005 Peter Selinger <selinger@users.sourceforge.net>
This program is sponsored by MGE UPS SYSTEMS - opensource.mgeups.com

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 libhid.h.

#include "config.h"
#include <sys/types.h>
#include <regex.h>
#include "hidtypes.h"
#include "timehead.h"
#include <usb.h>

Go to the source code of this file.

Classes

struct  communication_subdriver_s
struct  HIDDevice
struct  HIDDeviceMatcher_s
struct  HIDEvent_s
struct  MatchFlags_s
struct  usage_lkp_t

: can be either "shut" for Serial HID UPS Transfer (from MGE) or "usb"

communication_subdriver_s: structure to describe the communication routines

typedef struct
communication_subdriver_s 
communication_subdriver_t
communication_subdriver_t * comm_driver
void HIDCloseDevice (hid_dev_handle *udev)
void HIDDumpTree (hid_dev_handle *udev, usage_tables_t *utab)
void HIDFreeEvents (HIDEvent *events)
int HIDGetEvents (hid_dev_handle *udev, HIDDevice *dev, HIDEvent **eventsListp, usage_tables_t *utab)
char * HIDGetItemString (hid_dev_handle *udev, char *path, unsigned char *rawbuf, usage_tables_t *utab)
int HIDGetItemValue (hid_dev_handle *udev, char *path, float *Value, usage_tables_t *utab)
HIDDeviceHIDOpenDevice (hid_dev_handle **udevp, HIDDevice *hd, HIDDeviceMatcher_t *matcher, int mode)
bool HIDSetItemValue (hid_dev_handle *udev, char *path, float value, usage_tables_t *utab)

Defines

#define MAX_TS   2
#define MODE_OPEN   0
#define MODE_REOPEN   1

Typedefs

typedef enum ebool bool
typedef usb_dev_handle hid_dev_handle
typedef struct HIDDeviceMatcher_s HIDDeviceMatcher_t
typedef struct HIDEvent_s HIDEvent
typedef struct MatchFlags_s MatchFlags_t
typedef usage_lkp_t * usage_tables_t

Enumerations

enum  ebool {
  FALSE, TRUE, FALSE = 0, TRUE,
  FALSE, TRUE
}

Functions

void free_exact_matcher (HIDDeviceMatcher_t *matcher)
void free_regex_matcher (HIDDeviceMatcher_t *matcher)
static int matches (HIDDeviceMatcher_t *matcher, HIDDevice *device)
HIDDeviceMatcher_tnew_exact_matcher (HIDDevice *d)
int new_regex_matcher (HIDDeviceMatcher_t **matcher, char *regex_array[6], int cflags)

Variables

usage_lkp_t hid_usage_lkp []


Generated by  Doxygen 1.6.0   Back to index