예제 #1
0
파일: Client.cs 프로젝트: Kodesiana/UNBKGo
        protected override void OnMessageReceived(MessageFrame message)
        {
            switch (message.Command)
            {
            case Command.Identify:
                SendCommand(Command.Identify, "ff:ghg");
                break;

            case Command.Sync:
                SendCommand(Command.Sync, null);
                OnSync(new ClientSyncEventArgs {
                    Profile = (AppProfile)message.State
                });
                break;

            case Command.StartExambro:
                OnStart();
                break;

            case Command.SequentialConfig:
                OnSetup(new ClientSetupEventArgs {
                    Profile = (NetworkProfile)message.State
                });
                break;

            case Command.TurnOff:
                OnShutdown();
                break;
            }
        }
예제 #2
0
        protected void SendCommand(Command command, object parameter)
        {
            var msg = new MessageFrame(command, parameter);

            Stream.Write(msg);
            Stream.Flush();
            Thread.Sleep(1000);
        }
예제 #3
0
파일: Node.cs 프로젝트: Kodesiana/UNBKGo
        protected override void OnMessageReceived(MessageFrame message)
        {
            switch (message.Command)
            {
            case Command.Identify:
                MacAddress = message.State.ToString();
                break;

            case Command.Ready:
                Status = NodeStatus.Connected;
                break;

            case Command.Sync:
                Status = NodeStatus.Syncing;
                break;
            }
        }
예제 #4
0
 protected abstract void OnMessageReceived(MessageFrame message);