Reversed previouce changes.

Moved getdevinfo request inside the session.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@4887 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Mariusz Woloszyn
2002-07-20 01:55:02 +00:00
parent 815b5aec60
commit 440edffdf1
2 changed files with 11 additions and 11 deletions

View File

@@ -1029,15 +1029,6 @@ camera_init (Camera *camera, GPContext *context)
/* Use the defaults the core parsed */
CR (gp_port_set_settings (camera->port, settings));
/* get device info */
CPR(context, ptp_getdeviceinfo(&camera->pl->params,
&camera->pl->params.deviceinfo));
GP_DEBUG ("Vendor extension description: %s",camera->pl->params.deviceinfo.VendorExtensionDesc);
GP_DEBUG ("Manufacturer: %s",camera->pl->params.deviceinfo.Manufacturer);
GP_DEBUG (" model: %s", camera->pl->params.deviceinfo.Model);
GP_DEBUG (" device version: %s", camera->pl->params.deviceinfo.DeviceVersion);
/* Establish a connection to the camera */
((PTPData *) camera->pl->params.data)->context = context;
ret=ptp_opensession (&camera->pl->params, 1);
@@ -1050,6 +1041,16 @@ camera_init (Camera *camera, GPContext *context)
return (translate_ptp_result(ret));
}
/* Seems HP does not like getdevinfo outside of session */
/* get device info */
CPR(context, ptp_getdeviceinfo(&camera->pl->params,
&camera->pl->params.deviceinfo));
GP_DEBUG ("Vendor extension description: %s",camera->pl->params.deviceinfo.VendorExtensionDesc);
GP_DEBUG ("Manufacturer: %s",camera->pl->params.deviceinfo.Manufacturer);
GP_DEBUG (" model: %s", camera->pl->params.deviceinfo.Model);
GP_DEBUG (" device version: %s", camera->pl->params.deviceinfo.DeviceVersion);
/* init internal ptp objectfiles (required for fs implementation) */
init_ptp_fs (camera, context);

View File

@@ -34,7 +34,7 @@
#define PTP_REQ_LEN 30
#define PTP_RESP_LEN sizeof(PTPReq)
#define PTP_REQ_HDR_LEN (3*sizeof(uint32_t)+2*sizeof(uint16_t))
#define PTP_REQ_HDR_LEN (2*sizeof(uint32_t)+2*sizeof(uint16_t))
#define PTP_REQ_DATALEN 16384
#define PTP_EVENT_LEN sizeof(PTPEvent)
@@ -42,7 +42,6 @@ struct _PTPReq {
uint32_t len;
uint16_t type;
uint16_t code;
uint32_t session_id;
uint32_t trans_id;
char data[PTP_REQ_DATALEN];
};