public BasicControlUnitProtocol(ControlUnit controlUnit) { ControlUnit = controlUnit; State = ProtocolState.DisconnectedState; _webSocket = new WebSocket(_webSocketUrl); _webSocket.OnMessage += (sender, e) => Decode(e.Data); _webSocket.OnClose += ConnectionClosedThreaded; _webSocket.OnError += ConnectionClosedThreaded; _webSocket.OnOpen += ConnectionOpenedThreaded; ConnectToWebSocket(); }
public void SetControlUnit(ControlUnit controlUnit) { _controlUnit = controlUnit; }