コード例 #1
0
ファイル: LifxRequest.cs プロジェクト: A-KL/onecore
        public static LifxRequest Create(ILifxHub hub, LifxPacket packet)
        {
            switch (packet.Info.PacketType)
            {
                case LifxPacketType.GetStateService:
                    return new LifxServiceStateRequest(packet);

                case LifxPacketType.GetWiFiFirmwareState:
                    return new LifxWiFiFirmwareRequest(packet);

                case LifxPacketType.GetMeshFirmwareState:
                    return new LifxMeshFirmwareRequest(packet);

                case LifxPacketType.GetVersion:
                    return new LifxVersionRequest(packet);

                case LifxPacketType.GetLightState:
                    return new LifxLightStateRequest(packet);

                case LifxPacketType.SetLightState:

                    return new LifxLightStateRequest(packet);

                default:
                    return null;
                // throw new ArgumentOutOfRangeException("Protocol");
            }
        }
コード例 #2
0
ファイル: LifxRequest.cs プロジェクト: A-KL/onecore
 public static LifxRequest Create(ILifxHub hub, byte[] data)
 {
     return Create(hub, LifxPacket.Parse(data));
 }