示例#1
0
        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);