Difference between revisions of "USBMuxConnectByPort"

From The iPhone Wiki
Jump to: navigation, search
(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...)
 
Line 1: Line 1:
 
//import iTunesMobileDevice.dll or link with MobileDevice.framework
 
//import iTunesMobileDevice.dll or link with MobileDevice.framework
  +
 
int USBMuxConnectByPort(int connectionID, int iPhone_port_network_byte_order, int* outHandle);
 
int USBMuxConnectByPort(int connectionID, int iPhone_port_network_byte_order, int* outHandle);
   

Revision as of 03:47, 16 May 2010

//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