simonmitchell / rocc

A Swift framework for remote control of digital Cameras
MIT License
120 stars 15 forks source link

Implement Sony PTP IP handshake #9

Closed simonmitchell closed 4 years ago

simonmitchell commented 4 years ago

@gswirski I'm just walking to dog and grabbing some lunch, but in-case you have a moment to work on this today this is what I'm starting with! The ptp client seems to get the init command request, but we're doing something wrong with the encoding of the device name here. So I'm guessing something is off in my wChar logic!

Received Init_Command_Request
 { guid:
   [ 56, 48, 48, 48, 100, 52, 52, 100, 97, 52, 51, 50, 99, 48, 99, 53 ],
  name: '椎倀栀漀渀攀 堀匀 䴀愀砀',
  length: 57,
  type: 1 }

Feel free to pick this up if you want, I'll be back on this in 1-2 hours!

simonmitchell commented 4 years ago

Fixed the above, now working on parsing the ack response! Problem was when converting the data factory’s wString function from ptp.js it includes a byte for the length of the string at the beginning, but it seems the ptp spec doesn’t require this!