Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 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));
     }
 }
Exemplo n.º 4
0
 public static extern IntPtr AMDeviceCopyValue_Int(ref AMDevice device, uint unknown, byte[] cfstring);
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
 public static extern int AMDeviceConnect(ref AMDevice device);
Exemplo n.º 7
0
 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));
     }
 }
Exemplo n.º 8
0
 public static extern int AMDeviceStartSession(ref AMDevice device);
Exemplo n.º 9
0
        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;
        }
Exemplo n.º 10
0
 public extern static int AMDeviceGetConnectionID(ref AMDevice device);
Exemplo n.º 11
0
 public extern static int AMDeviceStartSession(ref AMDevice device);
Exemplo n.º 12
0
 public extern static int AMDeviceValidatePairing(ref AMDevice device);
Exemplo n.º 13
0
 public extern static int AMDeviceIsPaired(ref AMDevice device);
Exemplo n.º 14
0
 public extern static int AMDeviceConnect(ref AMDevice device);
Exemplo n.º 15
0
 internal ConnectEventArgs(AMDeviceNotificationCallbackInfo cbi)
 {
     message = cbi.msg;
     device = cbi.dev;
 }
Exemplo n.º 16
0
 public static extern int AMDeviceGetConnectionID(ref AMDevice device);
Exemplo n.º 17
0
 public static extern int AMDeviceIsPaired(ref AMDevice device);
Exemplo n.º 18
0
 public extern static int AMDeviceStartService(ref AMDevice device, byte[] service_name, ref IntPtr handle, IntPtr unknown);
Exemplo n.º 19
0
 public static extern int AMDeviceStartService(ref AMDevice device, byte[] service_name, ref IntPtr handle, IntPtr unknown);
Exemplo n.º 20
0
 public extern static IntPtr AMDeviceCopyValue_Int(ref AMDevice device, uint unknown, byte[] cfstring);
Exemplo n.º 21
0
 public static extern int AMDeviceValidatePairing(ref AMDevice device);
Exemplo n.º 22
0
 internal ConnectEventArgs(AMDeviceNotificationCallbackInfo cbi)
 {
     message = cbi.msg;
     device  = cbi.dev;
 }