Home | History | Annotate | Download | only in libpcap

Lines Matching refs:canusb

48 #include "pcap-canusb-linux.h"
50 #define CANUSB_IFACE "canusb"
100 * saying "no CANUSB devices".
128 snprintf(dev_descr, 50, "CanUSB [%s]", sernum);
212 struct pcap_canusb *canusb;
218 /* Does it begin with "canusb"? */
219 if (strncmp(cp, "canusb", 6) != 0) {
220 /* Nope, doesn't begin with "canusb" */
224 /* Yes - is "canusb" followed by a number? */
245 canusb = p->priv;
246 canusb->ctx = NULL;
247 canusb->dev = NULL;
248 canusb->rdpipe = -1;
249 canusb->wrpipe = -1;
259 struct pcap_canusb *canusb = arg;
266 fcntl(canusb->wrpipe, F_SETFL, O_NONBLOCK);
268 while(canusb->loop)
273 libusb_interrupt_transfer(canusb->dev, 0x81, (unsigned char*)&status, sizeof(status), &sz, 100);
275 libusb_interrupt_transfer(canusb->dev, 0x81, (unsigned char*)&status, sizeof(status), &sz, 100);
279 libusb_bulk_transfer(canusb->dev, 0x85, (unsigned char*)&msg, sizeof(msg), &sz, 100);
280 write(canusb->wrpipe, &msg, sizeof(msg));
320 struct pcap_canusb *canusb = handle->priv;
322 canusb->loop = 0;
323 pthread_join(canusb->worker, NULL);
325 if (canusb->dev)
327 libusb_close(canusb->dev);
328 canusb->dev = NULL;
330 if (canusb->ctx)
332 libusb_exit(canusb->ctx);
333 canusb->ctx = NULL;
341 struct pcap_canusb *canusb = handle->priv;
344 if (libusb_init(&canusb->ctx) != 0) {
370 canusb->dev = canusb_opendevice(canusb->ctx, serial);
371 if (!canusb->dev)
373 libusb_exit(canusb->ctx);
378 canusb_clearbufs(canusb);
380 handle->fd = canusb_startcapture(canusb);
431 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "inject not supported on canusb devices");