Lines Matching defs:opd
797 ptp_unpack_OPD (PTPParams *params, unsigned char* data, PTPObjectPropDesc *opd, unsigned int opdlen)
801 memset (opd, 0, sizeof(*opd));
802 opd->ObjectPropertyCode=dtoh16a(&data[PTP_opd_ObjectPropertyCode]);
803 opd->DataType=dtoh16a(&data[PTP_opd_DataType]);
804 opd->GetSet=dtoh8a(&data[PTP_opd_GetSet]);
807 ret = ptp_unpack_DPV (params, data, &offset, opdlen, &opd->FactoryDefaultValue, opd->DataType);
810 opd->GroupCode=dtoh32a(&data[offset]);
813 opd->FormFlag=dtoh8a(&data[offset]);
816 switch (opd->FormFlag) {
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);
827 #define N opd->FORM.Enum.NumberOfValues
830 opd->FORM.Enum.SupportedValue = malloc(N*sizeof(opd->FORM.Enum.SupportedValue[0]));
831 if (!opd->FORM.Enum.SupportedValue)
834 memset (opd->FORM.Enum.SupportedValue,0 , N*sizeof(opd->FORM.Enum.SupportedValue[0]));
836 ret = ptp_unpack_DPV (params, data, &offset, opdlen, &opd->FORM.Enum.SupportedValue[i], opd->DataType);
846 opd->FORM.Enum.NumberOfValues = i;
855 ptp_free_objectpropdesc(opd);