Lines Matching refs:params
8 ptp_debug (PTPParams *params, const char *format, ...);
11 htod16p (PTPParams *params, uint16_t var)
13 return ((params->byteorder==PTP_DL_LE)?htole16(var):htobe16(var));
17 htod32p (PTPParams *params, uint32_t var)
19 return ((params->byteorder==PTP_DL_LE)?htole32(var):htobe32(var));
23 htod16ap (PTPParams *params, unsigned char *a, uint16_t val)
25 if (params->byteorder==PTP_DL_LE)
32 htod32ap (PTPParams *params, unsigned char *a, uint32_t val)
34 if (params->byteorder==PTP_DL_LE)
41 htod64ap (PTPParams *params, unsigned char *a, uint64_t val)
43 if (params->byteorder==PTP_DL_LE)
50 dtoh16p (PTPParams *params, uint16_t var)
52 return ((params->byteorder==PTP_DL_LE)?le16toh(var):be16toh(var));
56 dtoh32p (PTPParams *params, uint32_t var)
58 return ((params->byteorder==PTP_DL_LE)?le32toh(var):be32toh(var));
62 dtoh64p (PTPParams *params, uint64_t var)
64 return ((params->byteorder==PTP_DL_LE)?le64toh(var):be64toh(var));
68 dtoh16ap (PTPParams *params, const unsigned char *a)
70 return ((params->byteorder==PTP_DL_LE)?le16atoh(a):be16atoh(a));
74 dtoh32ap (PTPParams *params, const unsigned char *a)
76 return ((params->byteorder==PTP_DL_LE)?le32atoh(a):be32atoh(a));
80 dtoh64ap (PTPParams *params, const unsigned char *a)
82 return ((params->byteorder==PTP_DL_LE)?le64atoh(a):be64atoh(a));
86 #define htod16a(a,x) htod16ap(params,a,x)
87 #define htod32a(a,x) htod32ap(params,a,x)
88 #define htod64a(a,x) htod64ap(params,a,x)
89 #define htod16(x) htod16p(params,x)
90 #define htod32(x) htod32p(params,x)
91 #define htod64(x) htod64p(params,x)
94 #define dtoh16a(a) dtoh16ap(params,a)
95 #define dtoh32a(a) dtoh32ap(params,a)
96 #define dtoh64a(a) dtoh64ap(params,a)
97 #define dtoh16(x) dtoh16p(params,x)
98 #define dtoh32(x) dtoh32p(params,x)
99 #define dtoh64(x) dtoh64p(params,x)
103 ptp_unpack_string(PTPParams *params, unsigned char* data, uint16_t offset, uint8_t *len)
129 nconv = iconv(params->cd_ucs2_to_locale, &src, &srclen,
160 ptp_pack_string(PTPParams *params, char *string, unsigned char* data, uint16_t offset, uint8_t *len)
175 nconv = iconv(params->cd_locale_to_ucs2, &stringp, &convlen,
209 ptp_get_packed_stringcopy(PTPParams *params, char *string, uint32_t *packed_size)
216 ptp_pack_string(params, "", (unsigned char*) packed, 0, &len);
218 ptp_pack_string(params, string, (unsigned char*) packed, 0, &len);
234 ptp_unpack_uint32_t_array(PTPParams *params, unsigned char* data, uint16_t offset, uint32_t **array)
248 ptp_pack_uint32_t_array(PTPParams *params, uint32_t *array, uint32_t arraylen, unsigned char **data )
260 ptp_unpack_uint16_t_array(PTPParams *params, unsigned char* data, uint16_t offset, uint16_t **array)
283 ptp_unpack_DI (PTPParams *params, unsigned char* data, PTPDeviceInfo *di, unsigned int datalen)
296 ptp_unpack_string(params, data,
301 di->OperationsSupported_len = ptp_unpack_uint16_t_array(params, data,
305 di->EventsSupported_len = ptp_unpack_uint16_t_array(params, data,
310 ptp_unpack_uint16_t_array(params, data,
314 di->CaptureFormats_len = ptp_unpack_uint16_t_array(params, data,
318 di->ImageFormats_len = ptp_unpack_uint16_t_array(params, data,
322 di->Manufacturer = ptp_unpack_string(params, data,
326 di->Model = ptp_unpack_string(params, data,
330 di->DeviceVersion = ptp_unpack_string(params, data,
334 di->SerialNumber = ptp_unpack_string(params, data,
355 ptp_unpack_EOS_DI (PTPParams *params, unsigned char* data, PTPCanonEOSDeviceInfo *di, unsigned int datalen)
361 di->EventsSupported_len = ptp_unpack_uint32_t_array(params, data,
367 di->DevicePropertiesSupported_len = ptp_unpack_uint32_t_array(params, data,
373 di->unk_len = ptp_unpack_uint32_t_array(params, data,
385 ptp_unpack_OH (PTPParams *params, unsigned char* data, PTPObjectHandles *oh, unsigned int len)
388 oh->n = ptp_unpack_uint32_t_array(params, data, PTP_oh, &oh->Handler);
400 ptp_unpack_SIDs (PTPParams *params, unsigned char* data, PTPStorageIDs *sids, unsigned int len)
402 sids->n = ptp_unpack_uint32_t_array(params, data, PTP_sids,
417 ptp_unpack_SI (PTPParams *params, unsigned char* data, PTPStorageInfo *si, unsigned int len)
427 si->StorageDescription=ptp_unpack_string(params, data,
429 si->VolumeLabel=ptp_unpack_string(params, data,
459 ptp_pack_OI (PTPParams *params, PTPObjectInfo *oi, unsigned char** oidataptr)
487 ptp_pack_string(params, oi->Filename, oidata, PTP_oi_filenamelen, &filenamelen);
531 /*ptp_debug (params ,"datelen is larger then size of buffer", ptpdatelen, (int)sizeof(ptpdate));*/
536 /*ptp_debug (params ,"datelen is less than 15 (%d)", ptpdatelen);*/
566 ptp_unpack_OI (PTPParams *params, unsigned char* data, PTPObjectInfo *oi, unsigned int len)
587 oi->Filename= ptp_unpack_string(params, data, PTP_oi_filenamelen, &filenamelen);
589 capture_date = ptp_unpack_string(params, data,
598 capture_date = ptp_unpack_string(params, data,
629 PTPParams *params, unsigned char* data, int *offset, int total,
698 value->str = ptp_unpack_string(params,data,*offset,&len);
718 ptp_unpack_DPD (PTPParams *params, unsigned char* data, PTPDevicePropDesc *dpd, unsigned int dpdlen)
729 ret = ptp_unpack_DPV (params, data, &offset, dpdlen, &dpd->FactoryDefaultValue, dpd->DataType);
733 ret = ptp_unpack_DPV (params, data, &offset, dpdlen, &dpd->CurrentValue, dpd->DataType);
749 ret = ptp_unpack_DPV (params, data, &offset, dpdlen, &dpd->FORM.Range.MinimumValue, dpd->DataType);
751 ret = ptp_unpack_DPV (params, data, &offset, dpdlen, &dpd->FORM.Range.MaximumValue, dpd->DataType);
753 ret = ptp_unpack_DPV (params, data, &offset, dpdlen, &dpd->FORM.Range.StepSize, dpd->DataType);
767 ret = ptp_unpack_DPV (params, data, &offset, dpdlen, &dpd->FORM.Enum.SupportedValue[i], dpd->DataType);
797 ptp_unpack_OPD (PTPParams *params, unsigned char* data, PTPObjectPropDesc *opd, unsigned int opdlen)
807 ret = ptp_unpack_DPV (params, data, &offset, opdlen, &opd->FactoryDefaultValue, opd->DataType);
818 ret = ptp_unpack_DPV (params, data, &offset, opdlen, &opd->FORM.Range.MinimumValue, opd->DataType);
820 ret = ptp_unpack_DPV (params, data, &offset, opdlen, &opd->FORM.Range.MaximumValue, opd->DataType);
822 ret = ptp_unpack_DPV (params, data, &offset, opdlen, &opd->FORM.Range.StepSize, opd->DataType);
836 ret = ptp_unpack_DPV (params, data, &offset, opdlen, &opd->FORM.Enum.SupportedValue[i], opd->DataType);
861 ptp_pack_DPV (PTPParams *params, PTPPropertyValue* value, unsigned char** dpvptr, uint16_t datatype)
966 dpv=ptp_get_packed_stringcopy(params, value->str, &size);
976 ptp_pack_OPL (PTPParams *params, MTPProperties *props, int nrofprops, unsigned char** opldataptr)
1003 packedpropslens[noitems] = ptp_pack_DPV (params, &propitr->propval, &packedprops[noitems], propitr->datatype);
1042 ptp_unpack_OPL (PTPParams *params, unsigned char* data, MTPProperties **pprops, unsigned int len)
1052 ptp_debug (params ,"Unpacking MTP OPL, size %d (prop_count %d)", len, prop_count);
1059 ptp_debug (params ,"short MTP Object Property List at property %d (of %d)", i, prop_count);
1060 ptp_debug (params ,"device probably needs DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL", i);
1061 ptp_debug (params ,"or even DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST", i);
1079 ptp_unpack_DPV(params, data, &offset, len, &props[i].propval, props[i].datatype);
1102 ptp_unpack_EC (PTPParams *params, unsigned char* data, PTPContainer *ec, unsigned int len)
1117 ptp_debug (params, "Unknown canon event type %d (code=%x,tid=%x), please report!",type,ec->Code,ec->Transaction_ID);
1146 ptp_unpack_Canon_FE (PTPParams *params, unsigned char* data, PTPCANONFolderEntry *fe)
1161 ptp_unpack_EOS_ImageFormat (PTPParams* params, unsigned char** data )
1191 ptp_debug (params, "parsing EOS ImageFormat property failed (n != 1 && n != 2: %d)", n);
1197 ptp_debug (params, "parsing EOS ImageFormat property failed (l != 0x10: 0x%x)", l);
1208 ptp_debug (params, "parsing EOS ImageFormat property failed (l != 0x10: 0x%x)", l);
1222 ptp_pack_EOS_ImageFormat (PTPParams* params, unsigned char* data, uint16_t value)
1273 ptp_unpack_CANON_changes (PTPParams *params, unsigned char* data, int datasize, PTPCanon_changes_entry **ce)
1307 ptp_debug (params, "event %d: objectinfo added oid %08lx, parent %08lx, ofc %04x, size %d, filename %s", i, (*ce)[i].u.object.oid, (*ce)[i].u.object.oi.ParentObject, (*ce)[i].u.object.oi.ObjectFormat, (*ce)[i].u.object.oi.ObjectCompressedSize, (*ce)[i].u.object.oi.Filename);
1318 ptp_debug (params, "event %d: request object transfer oid %08lx, ofc %04x, size %d, filename %s", i, (*ce)[i].u.object.oid, (*ce)[i].u.object.oi.ObjectFormat, (*ce)[i].u.object.oi.ObjectCompressedSize, (*ce)[i].u.object.oi.Filename);
1328 ptp_debug (params, "event %d: EOS prop %04x desc record, datasize %d, propxtype %d", i, proptype, size-PTP_ece_Prop_Desc_Data, propxtype);
1329 for (j=0;j<params->nrofcanon_props;j++)
1330 if (params->canon_props[j].proptype == proptype)
1332 if (j==params->nrofcanon_props) {
1333 ptp_debug (params, "event %d: propdesc %x, default value not found.", i, proptype);
1336 dpd = ¶ms->canon_props[j].dpd;
1342 ptp_debug (params, "event %d: propxtype is %x for %04x, unhandled.", i, propxtype, proptype);
1344 ptp_debug (params, " %d: %02x", j, data[j]);
1350 ptp_debug (params, "event %d: propxtype is %x, prop is 0x%04x, data type is 0x%04x, propxcnt is %d.",
1364 dtoh16( ptp_unpack_EOS_ImageFormat( params, &data ) );
1365 ptp_debug (params, "event %d: suppval[%d] of %x is 0x%x.", i, j, proptype, dpd->FORM.Enum.SupportedValue[j].u16);
1374 ptp_debug (params, "event %d: suppval[%d] of %x is 0x%x.", i, j, proptype, CONV(data)); \
1385 ptp_debug (params ,"event %d: data type 0x%04x of %x unhandled, raw values:", i, dpd->DataType, proptype, dtoh32a(data));
1387 ptp_debug (params, " %3d: 0x%8x", j, dtoh32a(data));
1400 ptp_debug (params, "event %d: EOS prop %04x info record, datasize is %d", i, proptype, size-PTP_ece_Prop_Val_Data);
1401 for (j=0;j<params->nrofcanon_props;j++)
1402 if (params->canon_props[j].proptype == proptype)
1404 if (j<params->nrofcanon_props) {
1405 if ( (params->canon_props[j].size != size) ||
1406 (memcmp(params->canon_props[j].data,data,size-PTP_ece_Prop_Val_Data))) {
1407 params->canon_props[j].data = realloc(params->canon_props[j].data,size-PTP_ece_Prop_Val_Data);
1408 memcpy (params->canon_props[j].data,data,size-PTP_ece_Prop_Val_Data);
1412 params->canon_props = realloc(params->canon_props, sizeof(params->canon_props[0])*(j+1));
1414 params->canon_props = malloc(sizeof(params->canon_props[0]));
1415 params->canon_props[j].type = type;
1416 params->canon_props[j].proptype = proptype;
1417 params->canon_props[j].size = size;
1418 params->canon_props[j].data = malloc(size-PTP_ece_Prop_Val_Data);
1419 memcpy(params->canon_props[j].data, data, size-PTP_ece_Prop_Val_Data);
1420 memset (¶ms->canon_props[j].dpd,0,sizeof(params->canon_props[j].dpd));
1421 params->canon_props[j].dpd.GetSet = 1;
1422 params->canon_props[j].dpd.FormFlag = PTP_DPFF_None;
1423 params->nrofcanon_props = j+1;
1425 dpd = ¶ms->canon_props[j].dpd;
1515 ptp_debug (params, "event %d: Unknown EOS property %04x, datasize is %d, using uint16", i ,proptype, size-PTP_ece_Prop_Val_Data);
1517 ptp_debug (params, " %d: %02x", j, data[j]);
1531 ptp_debug (params, "event %d: Unknown EOS property %04x, datasize is %d, using uint8", i ,proptype, size-PTP_ece_Prop_Val_Data);
1533 ptp_debug (params, " %d: %02x", j, data[j]);
1562 ptp_debug (params, "event %d: Unknown EOS property %04x, datasize is %d, using uint32", i ,proptype, size-PTP_ece_Prop_Val_Data);
1564 ptp_debug (params, "event %d: Warning: datasize modulo sizeof(uint32) is not 0: ", i, (size-PTP_ece_Prop_Val_Data) % sizeof(uint32_t) );
1566 ptp_debug (params, " %d: 0x%8x", j, ((uint32_t*)data)[j]);
1569 ptp_debug (params
1571 ptp_debug (params, " %d: %02x", j, data[j]);
1578 ptp_debug (params ,"event %d: currentvalue of %x is %x", i, proptype, dpd->CurrentValue.u32);
1583 ptp_debug (params,"event %d: currentvalue of %x is %x", i, proptype, dpd->CurrentValue.u16);
1588 ptp_debug (params,"event %d: currentvalue of %x is %x", i, proptype, dpd->CurrentValue.u8);
1593 dpd->FactoryDefaultValue.str = ptp_unpack_string(params, data, 0, &len);
1594 dpd->CurrentValue.str = ptp_unpack_string(params, data, 0, &len);
1599 ptp_debug (params,"event %d: currentvalue of %x is %s", i, proptype, dpd->CurrentValue.str);
1614 dpd->FactoryDefaultValue.u16 = ptp_unpack_EOS_ImageFormat( params, &data );
1616 ptp_debug (params,"event %d: currentvalue of %x is %x", i, proptype, dpd->CurrentValue.u8);
1625 ptp_debug (params, "event %d: EOS event 0, but size %d", i, size);
1629 #define XX(x) case PTP_EC_CANON_EOS_##x: ptp_debug (params, "event %d: unhandled EOS event "#x" (size %d)", i, size);break;
1651 ptp_debug (params, "event %d: unknown EOS event %04x", i, type);
1657 ptp_debug (params, " %d: %02x", j, curdata[j]);
1679 ptp_unpack_Nikon_EC (PTPParams *params, unsigned char* data, unsigned int len, PTPContainer **ec, int *cnt)
1703 ptp_pack_EK_text(PTPParams *params, PTPEKTextParams *text, unsigned char **data) {
1730 ptp_pack_string(params, text->title, curdata, 0, &retlen); curdata+=2*retlen+1;htod16a(curdata,0);curdata+=2;
1734 ptp_pack_string(params, text->line[i], curdata, 0, &retlen); curdata+=2*retlen+1;htod16a(curdata,0);curdata+=2;
1769 PTPParams *params,