I'm considering adding PTP support to CHIMP, which would allow the user to seamlessly update CHDK via USB.
One difficulty is that native windows software already controls PTP devices. chdkptp uses libusb-win32, which entirely takes over access to the device.
I don't know if there is way to send arbitrary PTP commands while playing nicely with the native windows drivers. Installing libusb (and disabling normal windows PTP) doesn't seem like it would be a great option for most users, though users who also want to use chdkptp might appreciate it.
chdkptp uses libusb for portability, but even if it was possible to play nice with Windows, it wouldn't really help, because standard PTP commands sent by the OS put the camera in a state where it can no longer switch to record mode.
Where can I find some documentation?
The CHDK PTP API is documented in the ptp.h header
https://app.assembla.com/spaces/chdk/subversion/source/HEAD/trunk/core/ptp.hchdkptp is available as a sample client implementation.
Is there an API for querying the platform/sub?
The CHDK PTP API is designed to do almost everything using CHDK Lua, and all normal CHDK script functions are available. You can use get_buildinfo() to get version and platform information.
The platform (PID) can also be determined directly from the USB layer, but without the firmware version that doesn't help for installs.