diff --git a/camlibs/ptp2/ptp.c b/camlibs/ptp2/ptp.c index 445e74a5c..69334048e 100644 --- a/camlibs/ptp2/ptp.c +++ b/camlibs/ptp2/ptp.c @@ -1446,6 +1446,29 @@ ptp_getpartialobject (PTPParams* params, uint32_t handle, uint32_t offset, return ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, object, len); } +/** + * ptp_getpartialobject_to_handler: + * params: PTPParams* + * handle - Object handle + * offset - Offset into object + * maxbytes - Maximum of bytes to read + * handler - a ptp data handler + * + * Get object 'handle' from device and send the data to the + * data handler. Start from offset and read at most maxbytes. + * + * Return values: Some PTP_RC_* code. + **/ +uint16_t +ptp_getpartialobject_to_handler (PTPParams* params, uint32_t handle, uint32_t offset, + uint32_t maxbytes, PTPDataHandler *handler) +{ + PTPContainer ptp; + + PTP_CNT_INIT(ptp, PTP_OC_GetPartialObject, handle, offset, maxbytes); + return ptp_transaction_new(params, &ptp, PTP_DP_GETDATA, 0, handler); +} + /** * ptp_getthumb: * params: PTPParams* diff --git a/camlibs/ptp2/ptp.h b/camlibs/ptp2/ptp.h index b8282fc10..754ce13ee 100644 --- a/camlibs/ptp2/ptp.h +++ b/camlibs/ptp2/ptp.h @@ -2523,6 +2523,9 @@ uint16_t ptp_getobject_to_handler (PTPParams* params, uint32_t handle, PTPDataHa uint16_t ptp_getpartialobject (PTPParams* params, uint32_t handle, uint32_t offset, uint32_t maxbytes, unsigned char** object, uint32_t *len); +uint16_t ptp_getpartialobject_to_handler (PTPParams* params, uint32_t handle, uint32_t offset, + uint32_t maxbytes, PTPDataHandler *handler); + uint16_t ptp_getthumb (PTPParams *params, uint32_t handle, unsigned char** object, unsigned int *len);