예제 #1
0
        public override void Write(object data, HIDDevice.WriteCallback callback, int timeout)
        {
            var writeDelegate = new WriteDelegate(Write);
            var asyncState    = new HidAsyncState(writeDelegate, callback);

            writeDelegate.BeginInvoke((byte[])data, timeout, EndWrite, asyncState);
        }
예제 #2
0
 public override void Write(object data, HIDDevice.WriteCallback callback)
 {
     if (!IsConnected)
     {
         return;
     }
     if (IsOpen == false)
     {
         OpenDevice();
     }
     this.Write((byte[])data, callback, 0);
 }
        internal void StopMotor(IDevice device, HIDDevice.WriteCallback callback)
        {
            byte[] data = new byte[5];
            data [0] = 0x40;
            data [1] = 0x7f;
            data [2] = 0xff;
            data [3] = 0x00;
            data [4] = 0x00;

            this.__hidInterface.Write(data, device.ID, callback);
            //this.__hidInterface.Generics[device].Write(data, callback);
        }
예제 #4
0
        public override void Write(object data, HIDDevice.WriteCallback callback, int timeout)
        {
            if (!IsConnected)
            {
                return;
            }
            if (IsOpen == false)
            {
                OpenDevice();
            }

            var writeDelegate = new WriteDelegate(Write);
            var asyncState    = new HidAsyncState(writeDelegate, callback);

            writeDelegate.BeginInvoke((byte[])data, timeout, EndWrite, asyncState);
        }
        /// <summary>
        /// Move FFD motor of the wheel left or right
        /// </summary>
        /// <param name="forceXY">0xFF - 0xA7(left) and 0x00-0x64(rights) are measurable by feeling </param>
        internal void SetMotor(IDevice device, byte forceX, byte forceY, HIDDevice.WriteCallback callback)
        {
            if (__hidInterface.Generics.ContainsKey(device.ID))
            {
                //TODO check if device use sbytes for 0x80 to 0x7f (-128 to 127)
                //Couldn't figure out if forceY doing something

                byte[] data = new byte[5];
                data [0] = 0x40;
                data [1] = forceX;
                data [2] = forceY;
                data [3] = 0x00;
                data [4] = 0x00;

                __hidInterface.Write(data, device.ID, callback);
                //__hidInterface.Generics[device].Write(data, callback);
            }
        }
 public void Write(object data, string id, HIDDevice.WriteCallback callback)
 {
     __Generics [id].Write(data, callback);
 }
 public void Write(object data, string id, HIDDevice.WriteCallback callback, int timeout)
 {
     throw new NotImplementedException();
 }
예제 #8
0
 public override void Write(object data, HIDDevice.WriteCallback callback)
 {
     this.Write((byte[])data, callback, 0);
 }
예제 #9
0
 public override void Write(object data, HIDDevice.WriteCallback callback, int timeout)
 {
     _listener.WriteComplete = callback;
     _device.Call("write", (byte[])data, _listener, timeout);
 }
예제 #10
0
 public void Write(object data, string id, HIDDevice.WriteCallback callback, int timeout)
 {
     this.__Generics[id].Write(data, callback, timeout);
 }
 public void Write(object data, int device, HIDDevice.WriteCallback callback)
 {
     throw new NotImplementedException();
 }
예제 #12
0
 public void StopMotor(HIDDevice.WriteCallback callback)
 {
     ((ThrustMasterDriver)this.driver).StopMotor(this, callback);
 }
예제 #13
0
 /// <summary>
 /// Move FFD motor of the wheel left or right
 /// </summary>
 /// <param name="forces">0xFF - 0xA7(left) and 0x00-0x64(rights) are measurable by feeling </param>
 public void SetMotor(byte forceX, byte forceY, HIDDevice.WriteCallback callback)
 {
     ((ThrustMasterDriver)this.driver).SetMotor(this, forceX, forceY, callback);
 }