Added PTP/IP code from gphoto2