/// <summary> /// Full Constructor with all options /// </summary> /// <param name="bdAddr">Bluetooth device address</param> /// <param name="latencyMode">Latency mode</param> /// <param name="autoDisconnectTime">Auto disconnect time</param> public ButtonConnectionChannel(Bdaddr bdAddr, LatencyMode latencyMode, short autoDisconnectTime) { if (bdAddr == null) { throw new ArgumentNullException(nameof(bdAddr)); } BdAddr = bdAddr; _latencyMode = latencyMode; _autoDisconnectTime = autoDisconnectTime; }
public TCPRawClient(IPAddress remote_ip, ushort remote_port, PacketCalculateEvent calc_event, int header_size, int maxPacketSize = 64 * 1024, int outputStreamMultiply = 64, LatencyMode mode = LatencyMode.Normal) { remoteIp = remote_ip; remotePort = remote_port; _maxPacketSize = maxPacketSize; this.mode = mode; if (calc_event == null) { throw new ArgumentNullException(nameof(calc_event)); } packetHeaderSize = header_size; CalculatePacketSize = calc_event; workerStarted = 0; _outputStream = new ConcurrentMemoryStream(_maxPacketSize * outputStreamMultiply); rcvBuff = new byte[maxPacketSize]; }
public void SetLatencyMode(LatencyMode mode) { this.mode = mode; }