1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00
trezor-firmware/tests/fido_tests/u2f-tests-hid/hidapi.h
2019-09-12 17:50:17 +02:00

34 lines
557 B
C

#ifndef __HIDAPI_H_
#include <stddef.h>
#include <sys/socket.h>
#include <netinet/in.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
int fd;
struct sockaddr_in other;
socklen_t slen;
} hid_device;
int hid_init(void);
int hid_exit(void);
hid_device *hid_open_path(const char *path);
void hid_close(hid_device *device);
int hid_write(hid_device *device, const unsigned char *data, size_t length);
int hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds);
#ifdef __cplusplus
}
#endif
#endif