diff --git a/camlibs/ptp/library.c b/camlibs/ptp/library.c index 2cfb24bce..709f63ffa 100644 --- a/camlibs/ptp/library.c +++ b/camlibs/ptp/library.c @@ -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); diff --git a/camlibs/ptp/ptp.h b/camlibs/ptp/ptp.h index 7ced27531..ac96ea72a 100644 --- a/camlibs/ptp/ptp.h +++ b/camlibs/ptp/ptp.h @@ -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]; };