hidparser.c File Reference

USB HID report data parser implementation. More...

#include <usb/hid/hidparser.h>
#include <errno.h>
#include <stdio.h>
#include <malloc.h>
#include <mem.h>
#include <usb/debug.h>
#include <assert.h>

Go to the source code of this file.

Functions

uint8_t usb_hid_get_next_report_id (usb_hid_report_t *report, uint8_t report_id, usb_hid_report_type_t type)
 Returns next report_id of report of specified type.
int usb_hid_parse_report (const usb_hid_report_t *report, const uint8_t *data, size_t size, uint8_t *report_id)
 Parse and act upon a HID report.
size_t usb_hid_report_byte_size (usb_hid_report_t *report, uint8_t report_id, usb_hid_report_type_t type)
 Returns size of report of specified report id and type in bytes.
usb_hid_report_field_tusb_hid_report_get_sibling (usb_hid_report_t *report, usb_hid_report_field_t *field, usb_hid_report_path_t *path, int flags, usb_hid_report_type_t type)
 Function for sequence walking through the report.
usb_hid_report_item_tusb_hid_report_item_clone (const usb_hid_report_item_t *item)
 Clones given state table.
uint8_t * usb_hid_report_output (usb_hid_report_t *report, size_t *size, uint8_t report_id)
 Allocates output report buffer for output report.
void usb_hid_report_output_free (uint8_t *output)
 Frees output report buffer.
int usb_hid_report_output_translate (usb_hid_report_t *report, uint8_t report_id, uint8_t *buffer, size_t size)
 Makes the output report buffer for data given in the report structure.
void usb_hid_report_reset_local_items (usb_hid_report_item_t *report_item)
 Reset all local items in given state table.
size_t usb_hid_report_size (usb_hid_report_t *report, uint8_t report_id, usb_hid_report_type_t type)
 Returns size of report of specified report id and type in items.
uint32_t usb_hid_report_tag_data_uint32 (const uint8_t *data, size_t size)
 Converts raw data to uint32 (thats the maximum length of short item data).
int usb_hid_translate_data (usb_hid_report_field_t *item, const uint8_t *data)
 Translate data from the report as specified in report descriptor item.
uint32_t usb_hid_translate_data_reverse (usb_hid_report_field_t *item, int value)
 Translate given data for putting them into the outoput report.
int usb_pow (int a, int b)


Detailed Description

USB HID report data parser implementation.

Definition in file hidparser.c.


Generated on Thu Jun 2 07:45:54 2011 for HelenOS/USB by  doxygen 1.4.7