Пример #1
0
        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));
            }
        }
Пример #5
0
        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());
                }
            }
        }