Пример #1
0
 public void DpnupHandleControllerData(int hand, ref DpnnControllerStateRecordOriginal src, ref DpnnControllerStateRecord dest)
 {
     if (_device != IntPtr.Zero)
     {
         DpnpUnity.DpnupHandleControllerData(_device, hand, ref src, ref dest);
     }
 }
Пример #2
0
 public void DpnupBootPair(bool value)
 {
     if (_device != IntPtr.Zero)
     {
         DpnpUnity.DpnupBootPair(_device, value);
     }
 }
Пример #3
0
 public void DpnupRegisterRererencePositionFunction(int index, IntPtr callback, IntPtr userData)
 {
     if (_device != IntPtr.Zero)
     {
         DpnpUnity.DpnupRegisterRererencePositionFunction(_device, index, callback, userData);
     }
 }
Пример #4
0
 public void DpnupPause()
 {
     if (_device != IntPtr.Zero)
     {
         DpnpUnity.DpnupPause(_device);
     }
 }
Пример #5
0
 public void DpnupSetUnbindDevice()
 {
     if (_device != IntPtr.Zero)
     {
         DpnpUnity.DpnupSetUnbindDevice(_device);
     }
 }
Пример #6
0
 public void DpnupRegisterEventNotificationFunction(DpnpUnity.DpnpHandleEventFunc callback, int event_mask, IntPtr userData)
 {
     if (_device != IntPtr.Zero)
     {
         DpnpUnity.DpnupRegisterEventNotificationFunction(_device, callback, event_mask, userData);
     }
 }
Пример #7
0
 public void DpnupWriteDeviceFeedback(int index, float value)
 {
     if (_device != IntPtr.Zero)
     {
         DpnpUnity.DpnupWriteDeviceFeedback(_device, index, value);
     }
 }
Пример #8
0
 public int DpnupReadDeviceButton(int index)
 {
     if (_device != IntPtr.Zero)
     {
         return(DpnpUnity.DpnupReadDeviceButton(_device, index));
     }
     return(0);
 }
Пример #9
0
 public int DpnupSetDeviceAttribute(int index, IntPtr buffer, int buffer_length)
 {
     if (_device != IntPtr.Zero)
     {
         return(DpnpUnity.DpnupSetDeviceAttribute(_device, index, buffer, buffer_length));
     }
     return(0);
 }
Пример #10
0
 public double DpnupReadDeviceTime(int index)
 {
     if (_device != IntPtr.Zero)
     {
         return(DpnpUnity.DpnupReadDeviceTime(_device, index));
     }
     return(0);
 }
Пример #11
0
 public string DpnupReadDeviceId()
 {
     if (_device != IntPtr.Zero)
     {
         return(Marshal.PtrToStringAnsi(DpnpUnity.DpnupReadDeviceId(_device)));
     }
     return("");
 }
Пример #12
0
 public int DpnupGetDeviceFeedbackCount()
 {
     if (_device != IntPtr.Zero)
     {
         return(DpnpUnity.DpnupGetDeviceFeedbackCount(_device));
     }
     return(0);
 }
Пример #13
0
 public int DpnupGetDeviceAttributeCount()
 {
     if (_device != IntPtr.Zero)
     {
         return(DpnpUnity.DpnupGetDeviceAttributeCount(_device));
     }
     return(0);
 }
Пример #14
0
 public int DpnupGetDeviceQuaternionCount()
 {
     if (_device != IntPtr.Zero)
     {
         return(DpnpUnity.DpnupGetDeviceQuaternionCount(_device));
     }
     return(0);
 }
Пример #15
0
 public void DpnupCloseDevice()
 {
     if (_device != IntPtr.Zero)
     {
         DpnpUnity.DpnupCloseDevice(_device);
         _device = IntPtr.Zero;
     }
 }
Пример #16
0
 public float DpnupReadDeviceAxis(int index)
 {
     if (_device != IntPtr.Zero)
     {
         return(DpnpUnity.DpnupReadDeviceAxis(_device, index));
     }
     return(0.0f);
 }
Пример #17
0
 public string DpnupGetAssociatedDevice(DPNP_DEVICE_TYPE type)
 {
     if (_device != IntPtr.Zero)
     {
         return(Marshal.PtrToStringAnsi(DpnpUnity.DpnupGetAssociatedDevice(_device, type)));
     }
     return("");
 }
Пример #18
0
 public string DpnupGetBondDeviceName()
 {
     if (_device != IntPtr.Zero)
     {
         byte[] name = new byte[1024];
         DpnpUnity.DpnupGetBondDeviceName(_device, ref name[0]);
         return(System.Text.Encoding.Default.GetString(name, 0, name.Length));
     }
     return("");
 }
Пример #19
0
 public void DpnupResetDevicePosition(int index, float[] position)
 {
     if (position.Length < DpnpUnity.DPNP_VALUE_TYPE_SIZE_POSITION)
     {
         return;
     }
     if (_device != IntPtr.Zero)
     {
         DpnpUnity.DpnupResetDevicePosition(_device, index, position);
     }
 }
Пример #20
0
 public bool DpnupReadDevicePosition(int index, float[] position)
 {
     if (position.Length < DpnpUnity.DPNP_VALUE_TYPE_SIZE_POSITION)
     {
         return(false);
     }
     if (_device != IntPtr.Zero)
     {
         return(DpnpUnity.DpnupReadDevicePosition(_device, index, position));
     }
     return(false);
 }
Пример #21
0
 public bool DpnupReadDeviceQuaternion(int index, float[] quaternion)
 {
     if (quaternion.Length < DpnpUnity.DPNP_VALUE_TYPE_SIZE_QUATERNION)
     {
         return(false);
     }
     if (_device != IntPtr.Zero)
     {
         return(DpnpUnity.DpnupReadDeviceQuaternion(_device, index, quaternion));
     }
     return(false);
 }
Пример #22
0
 public bool DpnupReadDeviceVector(int index, float[] vector)
 {
     if (vector.Length < DpnpUnity.DPNP_VALUE_TYPE_SIZE_VECTOR)
     {
         return(false);
     }
     if (_device != IntPtr.Zero)
     {
         return(DpnpUnity.DpnupReadDeviceVector(_device, index, vector));
     }
     return(false);
 }
Пример #23
0
        public static DpnPeripheral DpnupOpenDevice(string deviceId)
        {
            IntPtr device = IntPtr.Zero;

            if (deviceId == null)
            {
                return(null);
            }
            if (deviceId != string.Empty)
            {
                device = DpnpUnity.DpnupOpenDevice(Marshal.StringToHGlobalAnsi(deviceId));
                return(device != IntPtr.Zero ? new DpnPeripheral(device, deviceId) : null);
            }
            else
            {
                return(new DpnPeripheral(device, deviceId));
            }
        }
Пример #24
0
 public static string DpnupGetDeviceId(DPNP_DEVICE_TYPE type, int index)
 {
     return(Marshal.PtrToStringAnsi(DpnpUnity.DpnupGetDeviceId(type, index)));
 }
Пример #25
0
 public static int DpnupQueryDeviceCount(DPNP_DEVICE_TYPE type)
 {
     return(DpnpUnity.DpnupQueryDeviceCount(type));
 }