Logo Search packages:      
Sourcecode: libgphoto2 version File versions

int gp_port_check_int ( GPPort port,
char *  data,
int  size 
)

Check for intterupt.

Parameters:
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 interrupt endpoint into the supplied buffer. Function waits port->timeout miliseconds for data on interrupt endpoint.

Returns:
a gphoto2 error code

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

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

{
        int retval;

      gp_log (GP_LOG_DEBUG, "gphoto2-port", _("Reading %i=0x%x bytes from interrupt endpoint..."),
            size, size);

      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, port->timeout);
      CHECK_RESULT (retval);
      if (retval != size)
            gp_log (GP_LOG_DEBUG, "gphoto2-port", _("Could only read %i "
                  "out of %i byte(s)"), retval, size);

      gp_log_data ("gphoto2-port", data, retval);

      return (retval);
}


Generated by  Doxygen 1.6.0   Back to index