diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2012-04-25 19:23:27 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2012-04-25 19:23:27 +0000 |
commit | 07905c26d6658b99d93a04e9185080915396afcf (patch) | |
tree | 0cc81b803d6e4fa7ef3b7476598029fa74e91c07 | |
parent | ff8205cf55622857c85de0495481b0cb169922b1 (diff) | |
download | libgphoto2-07905c26d6658b99d93a04e9185080915396afcf.tar.gz |
added single level mtp getobjectproplist
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14012 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r-- | camlibs/ptp2/ptp.c | 23 | ||||
-rw-r--r-- | camlibs/ptp2/ptp.h | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/camlibs/ptp2/ptp.c b/camlibs/ptp2/ptp.c index c907c58f5..744a4b202 100644 --- a/camlibs/ptp2/ptp.c +++ b/camlibs/ptp2/ptp.c @@ -2833,6 +2833,29 @@ ptp_mtp_getobjectproplist (PTPParams* params, uint32_t handle, MTPProperties **p } uint16_t +ptp_mtp_getobjectproplist_single (PTPParams* params, uint32_t handle, MTPProperties **props, int *nrofprops) +{ + uint16_t ret; + PTPContainer ptp; + unsigned char* opldata = NULL; + unsigned int oplsize; + + PTP_CNT_INIT(ptp); + ptp.Code = PTP_OC_MTP_GetObjPropList; + ptp.Param1 = handle; + ptp.Param2 = 0x00000000U; /* 0x00000000U should be "all formats" */ + ptp.Param3 = 0xFFFFFFFFU; /* 0xFFFFFFFFU should be "all properties" */ + ptp.Param4 = 0x00000000U; + ptp.Param5 = 0x00000000U; /* means - return single tree below the Param1 handle */ + ptp.Nparam = 5; + ret = ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &opldata, &oplsize); + if (ret == PTP_RC_OK) *nrofprops = ptp_unpack_OPL(params, opldata, props, oplsize); + if (opldata != NULL) + free(opldata); + return ret; +} + +uint16_t ptp_mtp_sendobjectproplist (PTPParams* params, uint32_t* store, uint32_t* parenthandle, uint32_t* handle, uint16_t objecttype, uint64_t objectsize, MTPProperties *props, int nrofprops) { diff --git a/camlibs/ptp2/ptp.h b/camlibs/ptp2/ptp.h index 513807ede..66295be23 100644 --- a/camlibs/ptp2/ptp.h +++ b/camlibs/ptp2/ptp.h @@ -2332,6 +2332,7 @@ uint16_t ptp_mtp_setobjectpropvalue (PTPParams* params, uint32_t oid, uint16_t o uint16_t ptp_mtp_getobjectreferences (PTPParams* params, uint32_t handle, uint32_t** ohArray, uint32_t* arraylen); uint16_t ptp_mtp_setobjectreferences (PTPParams* params, uint32_t handle, uint32_t* ohArray, uint32_t arraylen); uint16_t ptp_mtp_getobjectproplist (PTPParams* params, uint32_t handle, MTPProperties **props, int *nrofprops); +uint16_t ptp_mtp_getobjectproplist_single (PTPParams* params, uint32_t handle, MTPProperties **props, int *nrofprops); uint16_t ptp_mtp_sendobjectproplist (PTPParams* params, uint32_t* store, uint32_t* parenthandle, uint32_t* handle, uint16_t objecttype, uint64_t objectsize, MTPProperties *props, int nrofprops); uint16_t ptp_mtp_setobjectproplist (PTPParams* params, MTPProperties *props, int nrofprops); |