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

int gp_port_usb_msg_interface_read ( GPPort port,
int  request,
int  value,
int  index,
char *  bytes,
int  size 
)

Send a USB interface control message with input data.

Parameters:
port a GPPort
request control request code
value control value
index control index
bytes pointer to data
size size of the data
Sends a specific USB control command and read associated data.

Returns:
a gphoto2 error code

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

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

{
        int retval;

      gp_log (GP_LOG_DEBUG, "gphoto2-port", "Reading message "
            "(request=0x%x value=0x%x index=0x%x size=%i=0x%x)...",
            request, value, index, size, size);

      CHECK_NULL (port);
      CHECK_INIT (port);

      CHECK_SUPP (port, "msg_read", port->pc->ops->msg_interface_read);
        retval = port->pc->ops->msg_interface_read (port, request, 
                  value, index, bytes, size);
      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", bytes, retval);

        return (retval);
}


Generated by  Doxygen 1.6.0   Back to index