USBMuxConnectByPort

From The iPhone Wiki
Revision as of 03:47, 16 May 2010 by Msft.guy (talk | contribs) (New page: //import iTunesMobileDevice.dll or link with MobileDevice.framework int USBMuxConnectByPort(int connectionID, int iPhone_port_network_byte_order, int* outHandle); <pre> //iphone_port - TC...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

//import iTunesMobileDevice.dll or link with MobileDevice.framework int USBMuxConnectByPort(int connectionID, int iPhone_port_network_byte_order, int* outHandle);

//iphone_port - TCP service port to connect to on the iPhone
//target_device - get this from a device callback.. use AMDeviceNotificationSubscribe to register callback.
		int ret = USBMuxConnectByPort(AMDeviceGetConnectionID(target_device), htons(iphone_port), &handle);
		if (ret != ERR_SUCCESS) {
			printf("USBMuxConnectByPort = %x\n", ret);
			goto error_service;
		}
		
		ret = AFCConnectionOpen(handle, 0, &afc_con);
		if (ret != ERR_SUCCESS) {
			printf ( "AFCConnectionOpen = %i\n" , ret );
			goto error_service;
		}
//handle - handle to use for send/recv