Ejemplo n.º 1
0
        public static P3bbleMessage CreateMessage(P3bbleEndpoint endpoint, List <byte> payload)
        {
            P3bbleMessage frame = null;

            switch (endpoint)
            {
            case P3bbleEndpoint.Ping:
                frame = new PingMessage();
                break;

            case P3bbleEndpoint.Version:
                frame = new VersionMessage();
                break;

            case P3bbleEndpoint.Time:
                frame = new TimeMessage();
                break;

            case P3bbleEndpoint.Logs:
                frame = new LogsMessage();
                break;

            default:
                frame = new P3bbleMessage(endpoint);
                break;
            }

            frame.GetContentFromMessage(payload);
            return(frame);
        }
Ejemplo n.º 2
0
        public static P3bbleMessage CreateMessage(P3bbleEndpoint endpoint, List<byte> payload)
        {
            P3bbleMessage frame = null;

            switch (endpoint)
            {
                case P3bbleEndpoint.Ping:
                    frame = new PingMessage();
                    break;
                case P3bbleEndpoint.Version:
                    frame = new VersionMessage();
                    break;
                case P3bbleEndpoint.Time:
                    frame = new TimeMessage();
                    break;
                case P3bbleEndpoint.Logs:
                    frame = new LogsMessage();
                    break;

                default:
                    frame =  new P3bbleMessage(endpoint);
                    break;
            }

            frame.GetContentFromMessage(payload);
            return frame;
        }