예제 #1
0
        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();
        }
예제 #2
0
 public void SetControlUnit(ControlUnit controlUnit)
 {
     _controlUnit = controlUnit;
 }