* libgphoto2_port/gphoto2-port.[ch]: added gp_port_check_event()

git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@4262 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Mariusz Woloszyn
2002-03-11 18:13:08 +00:00
parent df7d9504c9
commit ed9a719c8e
3 changed files with 46 additions and 0 deletions

View File

@@ -1,3 +1,13 @@
2002-03-11 Mariusz Woloszyn
* libgphoto2_port/gphoto2-port-library.h: added
check_event to GPPortOperationsl
* libgphoto2_port/gphoto2-port.h: added eventep to
GPPortSettingsUSB
* usb/libusb.c: added gp_port_usb_check_event(),
changed gp_port_usb_find_bulk to gp_port_usb_find_ep(),
added setting of eventsep to gp_port_usb_find_device_lib()
* libgphoto2_port/gphoto2-port.[ch]: added gp_port_check_event()
2002-02-23 Dan Fandrich <dan@coneharvesters.com>
* libgphoto2_port/gphoto2-port-info-list.c: Fixed error test for

View File

@@ -414,6 +414,41 @@ gp_port_read (GPPort *port, char *data, int size)
return (retval);
}
/**
* gp_port_check_event:
* @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 event ep the supplied buffer.
*
* Return value: a gphoto2 error code
**/
int
gp_port_check_event (GPPort *port, char *data, int size)
{
int retval;
gp_log (GP_LOG_DEBUG, "gphoto2-port", "Reading %i=0x%x bytes from event ep...",
size, size);
CHECK_NULL (port);
CHECK_INIT (port);
/* Check if we read as many bytes as expected */
CHECK_SUPP (port, _("check_event"), port->pc->ops->check_event);
retval = port->pc->ops->check_event (port, data, 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", data, retval);
return (retval);
}
/**
* gp_port_set_timeout:
* @port: a #GPPort

View File

@@ -99,6 +99,7 @@ int gp_port_close (GPPort *port);
int gp_port_write (GPPort *port, const char *data, int size);
int gp_port_read (GPPort *port, char *data, int size);
int gp_port_check_event (GPPort *port, char *data, int size);
int gp_port_get_timeout (GPPort *port, int *timeout);
int gp_port_set_timeout (GPPort *port, int timeout);