Example #1
0
        public ExcesoVelocidad(byte[] buffer, int pos)
        {
            PDU this_pdu = this;

            Entrante = true;
            UrbetrackCodec.DecodeHeaders(buffer, ref this_pdu, ref pos);
            switch (CL)
            {
            case 0x10:
            {
                var d = Devices.I().FindById(IdDispositivo);
                PosicionDeAviso          = null;
                PosicionDeTicket         = d.SupportsGPSPointEx ? UrbetrackCodec.DecodeGPSPointEx(buffer, ref pos, d) : UrbetrackCodec.DecodeGPSPoint(buffer, ref pos);
                PosicionFinal            = d.SupportsGPSPointEx ? UrbetrackCodec.DecodeGPSPointEx(buffer, ref pos, d) : UrbetrackCodec.DecodeGPSPoint(buffer, ref pos);
                VelocidadMaximaPermitida = UrbetrackCodec.DecodeFloat(buffer, ref pos);
                VelocidadMaximaAlcanzada = UrbetrackCodec.DecodeFloat(buffer, ref pos);
            }
            break;

            case 0x11:
            {
                var d = Devices.I().FindById(IdDispositivo);
                PosicionDeAviso          = UrbetrackCodec.DecodeGPSPointEx(buffer, ref pos, d);
                PosicionDeTicket         = UrbetrackCodec.DecodeGPSPointEx(buffer, ref pos, d);
                PosicionFinal            = UrbetrackCodec.DecodeGPSPointEx(buffer, ref pos, d);
                VelocidadMaximaPermitida = UrbetrackCodec.DecodeFloat(buffer, ref pos);
                VelocidadMaximaAlcanzada = UrbetrackCodec.DecodeFloat(buffer, ref pos);
                RiderIdentifier          = Encoding.ASCII.GetString(UrbetrackCodec.DecodeBytes(buffer, ref pos, 10));
            }
            break;
            }
        }