public static string AMDeviceCopyValue(ref AMDevice device, uint unknown, string name) { IntPtr result; byte[] cfstring; cfstring = StringToCFString(name); result = AMDeviceCopyValue_Int(ref device, unknown, cfstring); if (result != IntPtr.Zero) { byte length; length = Marshal.ReadByte(result, 8); if (length > 0) { return(Marshal.PtrToStringAnsi(new IntPtr(result.ToInt64() + 9), length)); } else { return(String.Empty); } } return(String.Empty); }
public static int AMDeviceStartService(ref AMDevice device, string service_name, ref afc_connection conn, IntPtr unknown) { IntPtr ptr; int ret; ptr = IntPtr.Zero; ret = AMDeviceStartService(ref device, StringToCFString(service_name), ref ptr, unknown); if ((ret == 0) && (ptr != IntPtr.Zero)) { conn = (afc_connection)Marshal.PtrToStructure(ptr, conn.GetType()); } return(ret); }
private void NotifyCallback(ref AMDeviceNotificationCallbackInfo callback) { if (callback.msg == NotificationMessage.Connected) { iPhoneHandle = callback.dev; if (ConnectToPhone()) { OnConnect(new ConnectEventArgs(callback)); } } else if (callback.msg == NotificationMessage.Disconnected) { connected = false; OnDisconnect(new ConnectEventArgs(callback)); } }
public static extern IntPtr AMDeviceCopyValue_Int(ref AMDevice device, uint unknown, byte[] cfstring);
public static string AMDeviceCopyValue(ref AMDevice device, uint unknown, string name) { IntPtr result; byte[] cfstring; cfstring = StringToCFString(name); result = AMDeviceCopyValue_Int(ref device, unknown, cfstring); if (result != IntPtr.Zero) { byte length; length = Marshal.ReadByte(result, 8); if (length > 0) { return Marshal.PtrToStringAnsi(new IntPtr(result.ToInt64() + 9), length); } else { return String.Empty; } } return String.Empty; }
public static extern int AMDeviceConnect(ref AMDevice device);
public static extern int AMDeviceStartSession(ref AMDevice device);
public static int AMDeviceStartService(ref AMDevice device, string service_name, ref afc_connection conn, IntPtr unknown) { IntPtr ptr; int ret; ptr = IntPtr.Zero; ret = AMDeviceStartService(ref device, StringToCFString(service_name), ref ptr, unknown); if ((ret == 0) && (ptr != IntPtr.Zero)) { conn = (afc_connection)Marshal.PtrToStructure(ptr, conn.GetType()); } return ret; }
public extern static int AMDeviceGetConnectionID(ref AMDevice device);
public extern static int AMDeviceStartSession(ref AMDevice device);
public extern static int AMDeviceValidatePairing(ref AMDevice device);
public extern static int AMDeviceIsPaired(ref AMDevice device);
public extern static int AMDeviceConnect(ref AMDevice device);
internal ConnectEventArgs(AMDeviceNotificationCallbackInfo cbi) { message = cbi.msg; device = cbi.dev; }
public static extern int AMDeviceGetConnectionID(ref AMDevice device);
public static extern int AMDeviceIsPaired(ref AMDevice device);
public extern static int AMDeviceStartService(ref AMDevice device, byte[] service_name, ref IntPtr handle, IntPtr unknown);
public static extern int AMDeviceStartService(ref AMDevice device, byte[] service_name, ref IntPtr handle, IntPtr unknown);
public extern static IntPtr AMDeviceCopyValue_Int(ref AMDevice device, uint unknown, byte[] cfstring);
public static extern int AMDeviceValidatePairing(ref AMDevice device);