libnjb 2.2.7
usb_io.h
1#ifndef __NJB__USB__IO__H
2#define __NJB__USB__IO__H
3
4#include "libnjb.h"
5
6/* Timeout floor, 5 seconds */
7#define USBTIMEOUT 5000
8
9#include <usb.h>
10
11/*
12 * Legacy #defines that map native *BSD USB #defines to those used by
13 * libusb. Some day we'll get rid of these.
14 */
15
16#ifndef UT_WRITE
17#define UT_WRITE USB_ENDPOINT_OUT
18#endif
19
20#ifndef UT_READ
21#define UT_READ USB_ENDPOINT_IN
22#endif
23
24#ifndef UT_CLASS
25#define UT_CLASS USB_TYPE_CLASS
26#endif
27
28#ifndef UT_STANDARD
29#define UT_STANDARD USB_TYPE_STANDARD
30#endif
31
32#ifndef UT_WRITE_VENDOR_OTHER
33#define UT_WRITE_VENDOR_OTHER (UT_WRITE | USB_TYPE_VENDOR | USB_RECIP_OTHER )
34#endif
35
36#ifndef UT_READ_VENDOR_OTHER
37#define UT_READ_VENDOR_OTHER (UT_READ | USB_TYPE_VENDOR | USB_RECIP_OTHER )
38#endif
39
40ssize_t usb_pipe_read (njb_t *njb, void *buf, size_t nbytes);
41ssize_t usb_pipe_write (njb_t *njb, void *buf, size_t nbytes);
42int usb_setup (njb_t *njb, int type, int request, int value,
43 int index, int length, void *data);
44
45#endif
struct njb_struct njb_t
Definition libnjb.h:168
ssize_t usb_pipe_read(njb_t *njb, void *buf, size_t nbytes)
Definition usb_io.c:118
ssize_t usb_pipe_write(njb_t *njb, void *buf, size_t nbytes)
Definition usb_io.c:67
int usb_setup(njb_t *njb, int type, int request, int value, int index, int length, void *data)
Definition usb_io.c:190