Post

Replies

Boosts

Views

Activity

Reply to 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.
Thank you for your reply. I have previously referred to PTPPassThrough, but there is no example of sending the outData parameter, and I have not found it on Apple forums or online. And I have also tried putting sendData into sendCommand, and sending the command and data in two separate requests, but none of them worked. I have tried changing the command type to 1, but it did not work. I think it should be 2 because it requires sending sendData, and another reason is that I have referenced other PTP libraries that use 2 to send data. The command and data are using little endian, which should not be a problem because we have referenced other PTP libraries that also use little endian. There are new developments or changes now, and I am using this camera. If there is no time limit for waiting for a response after sending a request, I will receive a normal response after more than 1 minute, which is a 12 byte length ptpResponseData. But obviously, normally I wouldn't wait that long. The timeout I set is 20 seconds. I am currently annotating the request to send commands and data to prevent it from working. Some cameras can function normally, but other cameras may not, and any request that contains both commands and data cannot work. I have tested several brands of cameras, and some will respond with error messages in a short period of time, such as not being able to complete this request, while others will respond with empty commands. If some cameras really need to receive timely and correct responses after sending commands and data requests to work properly, then the business will be seriously affected.
Sep ’25
Reply to 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.
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
Sep ’25
Reply to 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.
Thank you for your reply. I have previously referred to PTPPassThrough, but there is no example of sending the outData parameter, and I have not found it on Apple forums or online. And I have also tried putting sendData into sendCommand, and sending the command and data in two separate requests, but none of them worked. I have tried changing the command type to 1, but it did not work. I think it should be 2 because it requires sending sendData, and another reason is that I have referenced other PTP libraries that use 2 to send data. The command and data are using little endian, which should not be a problem because we have referenced other PTP libraries that also use little endian. There are new developments or changes now, and I am using this camera. If there is no time limit for waiting for a response after sending a request, I will receive a normal response after more than 1 minute, which is a 12 byte length ptpResponseData. But obviously, normally I wouldn't wait that long. The timeout I set is 20 seconds. I am currently annotating the request to send commands and data to prevent it from working. Some cameras can function normally, but other cameras may not, and any request that contains both commands and data cannot work. I have tested several brands of cameras, and some will respond with error messages in a short period of time, such as not being able to complete this request, while others will respond with empty commands. If some cameras really need to receive timely and correct responses after sending commands and data requests to work properly, then the business will be seriously affected.
Replies
Boosts
Views
Activity
Sep ’25
Reply to 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.
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
Replies
Boosts
Views
Activity
Sep ’25
Reply to 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.
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
Replies
Boosts
Views
Activity
Sep ’25
Reply to Crashes in ImageCaptureCore framework
你好,请问可以参考一下iOS应用使用 ImageCaptureCore 框架与相机进行 PTP 通信的代码吗,我现在可以获取设备的基本信息,但是使用PTP接口与相机通信出现IO错误,测试了其他应用没有问题。 感谢。
Replies
Boosts
Views
Activity
Aug ’25