hid_initialisation.c File Reference

Initialization routines for libhid structures. More...

#include "config.h"
#include <hid.h>
#include <hid_helpers.h>
#include <debug.h>
#include <assert.h>

Go to the source code of this file.

Defines

#define HID_INTERNAL

Functions

HIDInterfacehid_new_HIDInterface ()
void hid_delete_HIDInterface (HIDInterface **const ixs)
void hid_reset_HIDInterface (HIDInterface *const hidif)
hid_return hid_init ()
 Initialize libhid: scan for USB busses and devices using libusb.
hid_return hid_cleanup ()
 Complement to hid_init(): cleans up after libhid.
bool hid_is_initialised ()
 Check to see that hid_init() has been called.

Variables

static bool initialised = false
 Programmers can check this with hid_is_initialized().


Detailed Description

Initialization routines for libhid structures.

Definition in file hid_initialisation.c.


Define Documentation

#define HID_INTERNAL

Definition at line 4 of file hid_initialisation.c.


Function Documentation

hid_return hid_cleanup (  ) 

Complement to hid_init(): cleans up after libhid.

Definition at line 96 of file hid_initialisation.c.

References ERROR, hid_is_initialised(), HID_RET_NOT_INITIALISED, HID_RET_SUCCESS, initialised, and NOTICE.

Referenced by main().

void hid_delete_HIDInterface ( HIDInterface **const   ixs  ) 

Definition at line 31 of file hid_initialisation.c.

References ERROR.

Referenced by main().

hid_return hid_init (  ) 

Initialize libhid: scan for USB busses and devices using libusb.

Call this routine before making any other libhid calls.

Returns:
HID_RET_SUCCESS if everything was properly initialized.

Definition at line 63 of file hid_initialisation.c.

References ERROR, hid_is_initialised(), HID_RET_ALREADY_INITIALISED, HID_RET_FAIL_FIND_BUSSES, HID_RET_FAIL_FIND_DEVICES, HID_RET_SUCCESS, initialised, NOTICE, and TRACE.

Referenced by main().

bool hid_is_initialised (  ) 

Check to see that hid_init() has been called.

Returns:
Non-zero if libhid has been initialized.

Definition at line 111 of file hid_initialisation.c.

References initialised.

Referenced by hid_cleanup(), hid_force_open(), hid_get_feature_report(), hid_get_input_report(), hid_get_item_value(), hid_init(), hid_interrupt_read(), hid_interrupt_write(), hid_open(), hid_set_feature_report(), and hid_set_output_report().

HIDInterface* hid_new_HIDInterface (  ) 

Definition at line 17 of file hid_initialisation.c.

References ERROR, hid_reset_HIDInterface(), and TRACE.

Referenced by main().

void hid_reset_HIDInterface ( HIDInterface *const   hidif  ) 

Definition at line 42 of file hid_initialisation.c.

References HIDInterface_t::dev_handle, HIDInterface_t::device, ERROR, HIDInterface_t::hid_data, HIDInterface_t::hid_parser, HIDInterface_t::id, and HIDInterface_t::interface.

Referenced by hid_close(), and hid_new_HIDInterface().


Variable Documentation

bool initialised = false [static]

Programmers can check this with hid_is_initialized().

Definition at line 15 of file hid_initialisation.c.

Referenced by hid_cleanup(), hid_init(), and hid_is_initialised().


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