示例#1
0
文件: USBBot.cs 项目: val7x/NHSE
        public void WriteBytes(byte[] data, uint offset)
        {
            lock (_sync)
            {
                SendInternal(SwitchCommand.PokeRaw(offset, data));

                // give it time to push data back
                Thread.Sleep((data.Length / 256) + 100);
            }
        }
示例#2
0
        public void WriteBytes(byte[] data, uint offset)
        {
            lock (_sync)
            {
                AndroidUSBUtils.CurrentInstance.WriteToEndpoint(SwitchCommand.PokeRaw(offset, data));

                // give it time to push data back
                Thread.Sleep((data.Length / 256) + 100);
            }
        }
示例#3
0
        public void WriteBytes(byte[] data, uint offset)
        {
            if (data.Length > MaximumTransferSize)
            {
                WriteBytesLarge(data, offset);
            }
            lock (_sync)
            {
                SendInternal(SwitchCommand.PokeRaw(offset, data));

                // give it time to push data back
                Thread.Sleep((data.Length / 256) + UI_Settings.GetThreadSleepTime());
            }
        }
示例#4
0
        public static byte[] GetPokeCommand(ulong offset, byte[] data, RWMethod method, bool usb)
        {
            switch (method)
            {
            case RWMethod.Heap when !usb: return(SwitchCommand.Poke((uint)offset, data));

            case RWMethod.Heap when usb: return(SwitchCommand.PokeRaw((uint)offset, data));

            case RWMethod.Main: return(SwitchCommand.PokeMain(offset, data));

            case RWMethod.Absolute: return(SwitchCommand.PokeAbsolute(offset, data));

            default: return(SwitchCommand.Poke((uint)offset, data));
            }
        }
        public void WriteBytes(byte[] data, uint offset)
        {
            if (data.Length > MaximumTransferSize)
            {
                WriteBytesLarge(data, offset);
            }
            else
            {
                lock (_sync)
                {
                    AndroidUSBUtils.CurrentInstance.WriteToEndpoint(SwitchCommand.PokeRaw(offset, data));

                    // give it time to push data back
                    Thread.Sleep((data.Length / 256) + UI_Settings.GetThreadSleepTime());
                }
            }
        }