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