Example #1
0
        public bool Update(XinputReport reportobj)
        {
            Byte[] input  = reportobj.ToBytes();
            Byte[] rumble = new Byte[8];
            Byte[] report = new Byte[28];

            bus.Parse(input, report);

            if (bus.Report(report, rumble))
            {
                if (rumble[1] == 0x08)
                {
                    Byte big   = (Byte)(rumble[3]);
                    Byte small = (Byte)(rumble[4]);

                    if (OnRumble != null)
                    {
                        OnRumble(big, small);
                    }
                }
                return(true);
            }

            return(false);
        }
Example #2
0
        public bool Update(XinputReport reportobj)
        {
            Byte[] input = reportobj.ToBytes();
            Byte[] rumble = new Byte[8];
            Byte[] report = new Byte[28];

            bus.Parse(input, report);

            if (bus.Report(report, rumble))
            {
                if (rumble[1] == 0x08)
                {
                    Byte big = (Byte)(rumble[3]);
                    Byte small = (Byte)(rumble[4]);

                    if (OnRumble != null)
                    {
                        OnRumble(big, small);
                    }
                }
                return true;
            }

            return false;
        }
Example #3
0
 public bool connect()
 {
     this.disconnect();
     device           = new XinputDevice(xinputBus, (int)id);
     report           = new XinputReport((int)id);
     device.OnRumble += device_OnRumble;
     return(device.Connect());
 }
Example #4
0
 public bool reset()
 {
     report = new XinputReport((int)id);
     return(true);
 }