MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / new_hid_device

Function new_hid_device

lib/hidapi/mac/hid.c:148–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146};
147
148static hid_device *new_hid_device(void)
149{
150 hid_device *dev = (hid_device*) calloc(1, sizeof(hid_device));
151 if (dev == NULL) {
152 return NULL;
153 }
154
155 dev->device_handle = NULL;
156 dev->open_options = device_open_options;
157 dev->blocking = 1;
158 dev->disconnected = 0;
159 dev->run_loop_mode = NULL;
160 dev->run_loop = NULL;
161 dev->source = NULL;
162 dev->input_report_buf = NULL;
163 dev->input_reports = NULL;
164 dev->device_info = NULL;
165 dev->shutdown_thread = 0;
166 dev->last_error_str = NULL;
167
168 /* Thread objects */
169 pthread_mutex_init(&dev->mutex, NULL);
170 pthread_cond_init(&dev->condition, NULL);
171 pthread_barrier_init(&dev->barrier, NULL, 2);
172 pthread_barrier_init(&dev->shutdown_barrier, NULL, 2);
173
174 return dev;
175}
176
177static void free_hid_device(hid_device *dev)
178{

Callers 1

hid.cFile · 0.70

Calls 1

pthread_barrier_initFunction · 0.70

Tested by

no test coverage detected