Beispiel #1
0
            public FireShock3Device(string path, Kernel32.SafeObjectHandle handle, int index) : base(path, handle,
                                                                                                     index)
            {
                DeviceType = DualShockDeviceType.DualShock3;

                Log.Information("Device is {DeviceType} " +
                                "with address {ClientAddress} " +
                                "currently paired to {HostAddress}",
                                DeviceType, ClientAddress.AsFriendlyName(), HostAddress.AsFriendlyName());

                if (index >= 0 && index < 4)
                {
                    HidOutputReport[9] = _ledOffsets[index];
                }
            }
Beispiel #2
0
        public override bool Start()
        {
            Model = DsModel.DS4;

            // skip repairing if disabled in global configuration
            if (!GlobalConfiguration.Instance.Repair)
            {
                return(base.Start());
            }

            var transfered = 0;

            var hostMac = HostAddress.GetAddressBytes();

            byte[] buffer =
            {
                0x13, hostMac[5], hostMac[4], hostMac[3], hostMac[2], hostMac[1], hostMac[0],
                0x00,       0x00,       0x00,       0x00,       0x00,       0x00,       0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
            };

            Buffer.BlockCopy(GlobalConfiguration.Instance.BdLink, 0, buffer, 7,
                             GlobalConfiguration.Instance.BdLink.Length);

            if (SendTransfer(UsbHidRequestType.HostToDevice, UsbHidRequest.SetReport, 0x0313, buffer, ref transfered))
            {
                Log.DebugFormat("++ Repaired DS4 [{0}] Link Key For BTH Dongle [{1}]", DeviceAddress.AsFriendlyName(), HostAddress.AsFriendlyName());
            }
            else
            {
                Log.DebugFormat("++ Repair DS4 [{0}] Link Key For BTH Dongle [{1}] Failed!", DeviceAddress.AsFriendlyName(), HostAddress.AsFriendlyName());
            }

            return(base.Start());
        }