When using requestSendPTPCommand to send both commands and data simultaneously, the response timeout occurs and the length of the command and data in the response is 0, need help pls.

I am debugging ImageCaptureCore to communicate with external cameras.

When I called the PTP function below to send a command and add data, the response timed out for more than 5 seconds. After waiting for a period of time, I obtained the response. However, the response callback function obtained responsivData.length as zero and ptpResponseData.length as zero too.

  • (void)requestSendPTPCommand:(NSData *)ptpCommand outData:(NSData *)ptpData completion:(void (^)(NSData *responseData, NSData *ptpResponseData, NSError *error))completion;

data is below: Wrote 1 = 0x1 bytes PTP:send data: (hexdump of 1 bytes) [ ] I/PTP (14564): 0000 01 - .

Answered by DTS Engineer in 855608022

When I called the PTP function below to send a command and add data, the response timed out for more than 5 seconds. After waiting for a period of time, I obtained the response. However, the response callback function obtained responsivData.length as zero and ptpResponseData.length as zero too.

What were the full contents of ptpCommand (6 bytes) and ptpData (if applicable)? More generally, what command were you trying to send and what did you expect to happen?

I haven't looked at the PTP spec in any great detail, but what your describing sound like what happens if you sent the device a command it didn't handle "well".

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

When I called the PTP function below to send a command and add data, the response timed out for more than 5 seconds. After waiting for a period of time, I obtained the response. However, the response callback function obtained responsivData.length as zero and ptpResponseData.length as zero too.

What were the full contents of ptpCommand (6 bytes) and ptpData (if applicable)? More generally, what command were you trying to send and what did you expect to happen?

I haven't looked at the PTP spec in any great detail, but what your describing sound like what happens if you sent the device a command it didn't handle "well".

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

        struct {
            uint32_t length;
            uint16_t type;
            uint16_t code;
            uint32_t transactionId;
            uint32_t Param1;
        } __attribute__((packed)) ptpCommand;

        ptpCommand.length = 16;
        ptpCommand.type = 2;
        ptpCommand.code = 0x9205;
        ptpCommand.transactionId = 3;
        ptpCommand.Param1 = 0xD25A;

        NSData sendCommand = [NSData dataWithBytes:&ptpCommand length:16];

        unsigned char specialData = 1;
        NSData sendData = [NSData dataWithBytes:&specialData length:1];

[cam requestSendPTPCommand:sendCommand outData:sendData completion:^(NSData* responseData, NSData* ptpResponseData, NSError* err){

}];

I don't know if specialData needs to be placed in sendData or sendCommand. I have tried various data structures, but none of them work

The camera is Sony A7M3 (ILCE-7M3), and the camera supports the command for this setting properties. The transmitted command and data are also correct, and the expected return is data with a length of 12 for ptpResponseData

When using requestSendPTPCommand to send both commands and data simultaneously, the response timeout occurs and the length of the command and data in the response is 0, need help pls.
 
 
Q