Hi Marcus,

Thank you for your quick reply.
After doing some debugging, I found out that the Sony A7S III includes a
second ENUM list for every property. The second one is either as long as
the first list, or longer. It seems like the first list contains the
enabled options, and the second list contains all the possible options
(some of which you might not be able to choose in the current state).

in ptp2/ptp-pack.c
static inline int ptp_unpack_Sony_DPD (PTPParams *params, unsigned char*
data, PTPDevicePropDesc *dpd, unsigned int dpdlen, unsigned int *poffset)

After the current ENUM list extraction
for (i=0;i<N;i++) {
   ret = ptp_unpack_DPV (params, data, poffset, dpdlen,
&dpd->FORM.Enum.SupportedValue[i], dpd->DataType);

     /* Slightly different handling here. The HP PhotoSmart 120
     * specifies an enumeration with N in wrong endian
     * 00 01 instead of 01 00, so we count the enum just until the
     * the end of the packet.
     */
     if (!ret) {
     if (!i)
     goto outofmemory;
     dpd->FORM.Enum.NumberOfValues = i;
     break;
     }
}

I added some code that updates the offset to skip the second list:

if(strcmp(params->deviceinfo.Model, "ILCE-7SM3")==0)
{
     int enum_value_len;
     switch (dpd->DataType) {
          case PTP_DTC_INT8:
          enum_value_len = 1;
          break;
          case PTP_DTC_UINT8:
          enum_value_len = 1;
          break;
          case PTP_DTC_INT16:
          enum_value_len = 2;
          break;
          case PTP_DTC_UINT16:
          enum_value_len = 2;
          break;
          case PTP_DTC_INT32:
          enum_value_len = 4;
          break;
          case PTP_DTC_UINT32:
          enum_value_len = 4;
          break;
          case PTP_DTC_INT64:
          enum_value_len = 8;
          break;
          case PTP_DTC_UINT64:
          enum_value_len = 8;
          break;
          case PTP_DTC_UINT128:
          enum_value_len = 16;
          break;
          case PTP_DTC_INT128:
          enum_value_len = 16;
          break;
          case PTP_DTC_AINT8:
          enum_value_len = 1;
          break;
          case PTP_DTC_AUINT8:
          enum_value_len = 1;
          break;
          case PTP_DTC_AUINT16:
          enum_value_len = 2;
          break;
          case PTP_DTC_AINT16:
          enum_value_len = 2;
          break;
          case PTP_DTC_AUINT32:
          enum_value_len = 4;
          break;
          case PTP_DTC_AINT32:
          enum_value_len = 4;
          break;
          case PTP_DTC_AUINT64:
          enum_value_len = 8;
          break;
          case PTP_DTC_AINT64:
          enum_value_len = 8;
          break;
          case PTP_DTC_STR:
          goto outofmemory;
          break;
          default:
          goto outofmemory;
     }
     uint16_t N_all = dtoh16a(&data[*poffset]);
     *poffset+=sizeof(uint16_t);
     *poffset += enum_value_len*N_all;
}

The debug log is here
https://drive.usercontent.google.com/uc?id=1MEanNTniSpzv8xd82fZ_D9n72hZBrFwQ&export=download
Although I now finally get lots of properties (hundreds), it still misses
some essential actions, such as image capture.
Perhaps because these have different addresses for this camera?

Kind regards, Jeroen

On Wed, Apr 3, 2024 at 3:47 PM Marcus Meissner <mar...@jet.franken.de>
wrote:

> Hi,
>
> Thanks for this report.
>
> it seems the binary format of this variable has changed, which leds to
> this error.
>
> I will need to adjust the decoder :(
>
> You can short term perhaps add a ignore to the decoder, perhaps it will
> help,
> except you cant use any config reads
>
> Ciao, Marcus
> On Wed, Apr 03, 2024 at 02:13:31PM +0200, Jeroen Lichtenauer wrote:
>
_______________________________________________
Gphoto-devel mailing list
Gphoto-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gphoto-devel

Reply via email to