Ejemplo n.º 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;
            }
        }
Ejemplo n.º 2
0
        protected void SendCommand(Command command, object parameter)
        {
            var msg = new MessageFrame(command, parameter);

            Stream.Write(msg);
            Stream.Flush();
            Thread.Sleep(1000);
        }
Ejemplo n.º 3
0
        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;
            }
        }
Ejemplo n.º 4
0
 protected abstract void OnMessageReceived(MessageFrame message);