MCPcopy Create free account
hub / github.com/Atarity/Lightpack / new_hid_device

Function new_hid_device

Software/src/hidapi/linux/hid-libusb.c:111–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109static int return_data(hid_device *dev, unsigned char *data, size_t length);
110
111static hid_device *new_hid_device(void)
112{
113 hid_device *dev = calloc(1, sizeof(hid_device));
114 dev->device_handle = NULL;
115 dev->input_endpoint = 0;
116 dev->output_endpoint = 0;
117 dev->input_ep_max_packet_size = 0;
118 dev->interface = 0;
119 dev->manufacturer_index = 0;
120 dev->product_index = 0;
121 dev->serial_index = 0;
122 dev->blocking = 1;
123 dev->shutdown_thread = 0;
124 dev->transfer = NULL;
125 dev->input_reports = NULL;
126
127 pthread_mutex_init(&dev->mutex, NULL);
128 pthread_cond_init(&dev->condition, NULL);
129 pthread_barrier_init(&dev->barrier, NULL, 2);
130
131 return dev;
132}
133
134static void free_hid_device(hid_device *dev)
135{

Callers 1

hid-libusb.cFile · 0.70

Calls 1

pthread_barrier_initFunction · 0.85

Tested by

no test coverage detected