Lines Matching defs:canusb
48 #define CANUSB_IFACE "canusb"
86 static struct canusb_t canusb;
214 libusb_init(&canusb.ctx);
220 /* Does it begin with "canusb"? */
221 if (strncmp(cp, "canusb", 6) != 0) {
222 /* Nope, doesn't begin with "canusb" */
226 /* Yes - is "canusb" followed by a number? */
247 memset(&canusb, 0x00, sizeof(canusb));
255 static void* canusb_capture_thread(struct canusb_t *canusb)
268 serial = canusb->serial;
271 fcntl(canusb->wrpipe, F_SETFL, O_NONBLOCK);
273 while(*canusb->loop)
285 n = write(canusb->wrpipe, &msg, sizeof(msg));
303 canusb.rdpipe = pipefd[0];
304 canusb.wrpipe = pipefd[1];
305 canusb.loop = &loop;
308 pthread_create(&this->worker, NULL, canusb_capture_thread, &canusb);
310 return canusb.rdpipe;
330 pthread_join(canusb.worker, NULL);
332 if (canusb.dev)
334 libusb_close(canusb.dev);
335 canusb.dev = NULL;
362 canusb.serial = strdup(serial);
364 canusb.dev = canusb_opendevice(canusb.ctx,serial);
365 if (!canusb.dev)
371 canusb_clearbufs(&canusb);
373 handle->fd = canusb_startcapture(&canusb);
426 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "inject not supported on canusb devices");