"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "camlibs/ptp2/usb.c" between
libgphoto2-2.5.26.tar.bz2 and libgphoto2-2.5.27.tar.bz2

About: libgphoto2 is a library that can be used by applications to access various digital cameras.

usb.c  (libgphoto2-2.5.26.tar.bz2):usb.c  (libgphoto2-2.5.27.tar.bz2)
skipping to change at line 650 skipping to change at line 650
} }
uint16_t uint16_t
ptp_usb_event_wait (PTPParams* params, PTPContainer* event) { ptp_usb_event_wait (PTPParams* params, PTPContainer* event) {
return ptp_usb_event (params, event, PTP_EVENT_CHECK); return ptp_usb_event (params, event, PTP_EVENT_CHECK);
} }
uint16_t uint16_t
ptp_usb_control_get_extended_event_data (PTPParams *params, char *buffer, int *s ize) { ptp_usb_control_get_extended_event_data (PTPParams *params, char *buffer, int *s ize) {
Camera *camera = ((PTPData *)params->data)->camera; Camera *camera = ((PTPData *)params->data)->camera;
int ret; int ret;
GPPortSettings settings;
GP_LOG_D ("Getting extended event data."); GP_LOG_D ("Getting extended event data.");
ret = gp_port_usb_msg_class_read (camera->port, 0x65, 0x0000, 0x0000, buf gp_port_get_settings (camera->port, &settings);
fer, *size); ret = gp_port_usb_msg_class_read (camera->port, 0x65, 0x0000, settings.us
b.interface, buffer, *size);
if (ret < GP_OK) if (ret < GP_OK)
return PTP_ERROR_IO; return PTP_ERROR_IO;
*size = ret; *size = ret;
return PTP_RC_OK; return PTP_RC_OK;
} }
uint16_t uint16_t
ptp_usb_control_device_reset_request (PTPParams *params) { ptp_usb_control_device_reset_request (PTPParams *params) {
Camera *camera = ((PTPData *)params->data)->camera; Camera *camera = ((PTPData *)params->data)->camera;
int ret; int ret;
GPPortSettings settings;
GP_LOG_D ("Sending usb device reset request."); GP_LOG_D ("Sending usb device reset request.");
ret = gp_port_usb_msg_class_write (camera->port, 0x66, 0x0000, 0x0000, NU gp_port_get_settings (camera->port, &settings);
LL, 0); ret = gp_port_usb_msg_class_write (camera->port, 0x66, 0x0000, settings.u
sb.interface, NULL, 0);
if (ret < GP_OK) if (ret < GP_OK)
return PTP_ERROR_IO; return PTP_ERROR_IO;
return PTP_RC_OK; return PTP_RC_OK;
} }
uint16_t uint16_t
ptp_usb_control_get_device_status (PTPParams *params, char *buffer, int *size) { ptp_usb_control_get_device_status (PTPParams *params, char *buffer, int *size) {
Camera *camera = ((PTPData *)params->data)->camera; Camera *camera = ((PTPData *)params->data)->camera;
int ret; int ret;
GPPortSettings settings;
ret = gp_port_usb_msg_class_read (camera->port, 0x67, 0x0000, 0x0000, buf
fer, *size); GP_LOG_D ("Getting usb device status.");
gp_port_get_settings (camera->port, &settings);
ret = gp_port_usb_msg_class_read (camera->port, 0x67, 0x0000, settings.us
b.interface, buffer, *size);
if (ret < GP_OK) if (ret < GP_OK)
return PTP_ERROR_IO; return PTP_ERROR_IO;
*size = ret; *size = ret;
return PTP_RC_OK; return PTP_RC_OK;
} }
uint16_t uint16_t
ptp_usb_control_cancel_request (PTPParams *params, uint32_t transactionid) { ptp_usb_control_cancel_request (PTPParams *params, uint32_t transactionid) {
Camera *camera = ((PTPData *)params->data)->camera; Camera *camera = ((PTPData *)params->data)->camera;
int ret; int ret;
unsigned char buffer[6]; unsigned char buffer[6];
GPPortSettings settings;
GP_LOG_D ("Sending cancel request.");
gp_port_get_settings (camera->port, &settings);
htod16a(&buffer[0],PTP_EC_CancelTransaction); htod16a(&buffer[0],PTP_EC_CancelTransaction);
htod32a(&buffer[2],transactionid); htod32a(&buffer[2],transactionid);
ret = gp_port_usb_msg_class_write (camera->port, 0x64, 0x0000, 0x0000, (c har*)buffer, sizeof (buffer)); ret = gp_port_usb_msg_class_write (camera->port, 0x64, 0x0000, settings.u sb.interface, (char*)buffer, sizeof (buffer));
if (ret < GP_OK) if (ret < GP_OK)
return PTP_ERROR_IO; return PTP_ERROR_IO;
return PTP_RC_OK; return PTP_RC_OK;
} }
 End of changes. 8 change blocks. 
16 lines changed or deleted 27 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)