Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

int gp_port_check_int_fast ( GPPort port,
char *  data,
int  size 

Check for interrupt without wait.

port a GPPort
data a pointer to an allocated buffer
size the number of bytes that should be read
Reads a specified number of bytes from the inerrupt endpoint into the supplied buffer. Function waits 50 miliseconds for data on interrupt endpoint.

a gphoto2 error code

Definition at line 453 of file gphoto2-port.c.

References _GPPortOperations::check_int, CHECK_NULL, CHECK_RESULT, FAST_TIMEOUT, gp_log(), gp_log_data(), GP_LOG_DEBUG, _GPPortPrivateCore::ops, and _GPPort::pc.

        int retval;

      CHECK_NULL (port);
      CHECK_INIT (port);

      /* Check if we read as many bytes as expected */
      CHECK_SUPP (port, "check_int", port->pc->ops->check_int);
      retval = port->pc->ops->check_int (port, data, size, FAST_TIMEOUT);
      CHECK_RESULT (retval);

      if (retval != size && retval != 0 )
      if (retval != size )
            gp_log (GP_LOG_DEBUG, "gphoto2-port", _("Could only read %i "
                  "out of %i byte(s)"), retval, size);

      if ( retval != 0 ) {
            /* For Canon cameras, we will make lots of
               reads that will return zero length. Don't
               bother to log them as errors. */
            gp_log (GP_LOG_DEBUG, "gphoto2-port",
                  _("Reading %i=0x%x bytes from interrupt endpoint (fast)..."),
                  size, size);
            gp_log_data ("gphoto2-port", data, retval);

      return (retval);

Generated by  Doxygen 1.6.0   Back to index