~ubuntu-branches/ubuntu/saucy/argyll/saucy

« back to all changes in this revision

Viewing changes to spectro/icoms.h

  • Committer: Package Import Robot
  • Author(s): Christian Marillat
  • Date: 2012-04-25 07:46:07 UTC
  • mfrom: (1.2.2) (13.1.15 sid)
  • Revision ID: package-import@ubuntu.com-20120425074607-yjqadetw8kum9skc
Tags: 1.4.0-4
Should Build-Depends on libusb-dev (Closes: #670329).

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        forgiving in interrupting coms to/from the instrument, as well
27
27
        as being long winded and needing abort. For USB insruments it's
28
28
        not necessarily robust to interrupt or terminate after a give
29
 
        USB transaction. Really, the instrument driver should deterimine
 
29
        USB transaction. The handling of user commands and aborts
 
30
        is not consistent either, possibly leaving some instruments
 
31
        suseptable to body results due to an unrecognised aborted
 
32
        command. Really, the instrument driver should deterimine
30
33
        at what points an operation can be aborted, and how to recover.
 
34
 
 
35
        Because the instrument itself can be a source of commands,
 
36
        some way of waiting for instrument or user input is needed.
 
37
        Could a threaded approach with instrument abort work ?
31
38
        
32
39
*/
33
40
 
230
237
 
231
238
#ifdef ENABLE_USB
232
239
        /* USB port parameters */
 
240
#ifdef USE_LIBUSB1
 
241
        libusb_context *ctx; 
 
242
#endif
233
243
        unsigned int vid, pid;          /* USB vendor and product id's */
234
244
        struct usb_device *usbd;
235
245
        struct usb_dev_handle *usbh;
311
321
        void (*set_hid_port)(
312
322
                struct _icoms *p, 
313
323
                int            port,            /* Enumerated port number, 1..n */
314
 
                icomuflags usbflags);           /* Any special handling flags */
 
324
                icomuflags usbflags,            /* Any special handling flags */
 
325
                int retries,                            /* > 0 if we should retry set_configuration (100msec) */
 
326
                char **pnames                           /* List of process names to try and kill before opening */
 
327
        );
 
328
 
 
329
        /* Close the port */
 
330
        void (*close_port)(struct _icoms *p);
315
331
 
316
332
        /* Reset user interrupt handling to default (Esc, ^C, q or 'Q' = Abort) */
317
333
        void (*reset_uih)(struct _icoms *p);
433
449
        int (*usb_clearhalt)(struct _icoms *p,
434
450
                int ep);                                /* End point address */
435
451
 
 
452
        /* For an HID device, read a message from the device - thread friendly. */
 
453
        /* Set error state on error */
 
454
        int (*hid_read_th)(struct _icoms *p,
 
455
                unsigned char *buf,             /* Read buffer */
 
456
                int bsize,                              /* Bytes to read or write */
 
457
                int *bread,                             /* Bytes read */
 
458
                double tout,                    /* Timeout in seconds */
 
459
                int debug,                              /* debug flag value */
 
460
                int *cut,                               /* Character that caused termination */
 
461
                int checkabort);                /* Check for abort from keyboard */
 
462
 
436
463
        /* For an HID device, read a message from the device. */
437
464
        /* Set error state on error */
438
465
        int (*hid_read)(struct _icoms *p,
441
468
                int *bread,                             /* Bytes read */
442
469
                double tout);                   /* Timeout in seconds */
443
470
 
 
471
        /* For an HID device, write a message to the device - thread friendly. */
 
472
        /* Set error state on error */
 
473
        int (*hid_write_th)(struct _icoms *p,
 
474
                unsigned char *wbuf,    /* Write buffer */
 
475
                int wsize,                              /* Bytes to or write */
 
476
                int *bwritten,                  /* Bytes written */
 
477
                double tout,                    /* Timeout in seconds */
 
478
                int debug,                              /* debug flag value */
 
479
                int *cut,                               /* Character that caused termination */
 
480
                int checkabort);                /* Check for abort from keyboard */
 
481
 
444
482
        /* For an HID device, write a message to the device */
445
483
        /* Set error state on error */
446
484
        int (*hid_write)(struct _icoms *p,