Ejemplo n.º 1
0
        public static void SendSpeedControl(this NetState ns, SpeedControlSetting speedControl)
        {
            if (ns == null || !ns.GetSendBuffer(out var buffer))
            {
                return;
            }

            var writer = new CircularBufferWriter(buffer);

            writer.Write((byte)0xBF);   // Packet ID
            writer.Write((ushort)06);
            writer.Write((ushort)0x26); // Subpacket
            writer.Write((byte)speedControl);

            ns.Send(ref buffer, writer.Position);
        }
Ejemplo n.º 2
0
 public static void SendSpeedControl(this NetState ns, SpeedControlSetting speedControl) =>
 ns?.Send(stackalloc byte[] { 0xBF, 0x00, 0x6, 0x00, 0x26, (byte)speedControl });