Exemple #1
0
        public byte[]  UpdateEndRequest(string TrackerID = "")
        {
            TrackerID = "4562402706";
            List <byte> RspnStream       = new List <byte>();
            string      DevIDCombination = "";

            RspnStream.Add(0x83);
            byte[] Lnth = CommonOperation.StringToByteArray(Convert.ToString(ClntDevIDLth));
            RspnStream.Add(Lnth[0]);

            byte[] IMEIArr = CommonOperation.StringToByteArray(TrackerID);

            foreach (byte bte in IMEIArr)
            {
                RspnStream.Add(bte);
            }

            RspnStream.Add(0x01);
            RspnStream.Add(0x01);

            RspnStream.Add(0x01);
            RspnStream.Add(0x06);
            //Sequence
            RspnStream.Add(0x00);
            RspnStream.Add(0x00);

            return(new Byte[2]);
        }
Exemple #2
0
        public byte[]  TrackOnDemand(string TrackerID = "")
        {
            TrackerID = "4562402706";
            List <byte> RspnStream = new List <byte>();

            RspnStream.Add(0x83);
            // RspnStream.Add(0x05);
            byte[] Lnth = CommonOperation.StringToByteArray(Convert.ToString(ClntDevIDLth));
            RspnStream.Add(Lnth[0]);

            byte[] IMEIArr = CommonOperation.StringToByteArray(TrackerID);

            foreach (byte bte in IMEIArr)
            {
                RspnStream.Add(bte);
            }


            //Device ID
            //RspnStream.Add(0x45);
            //RspnStream.Add(0x62);
            //RspnStream.Add(0x40);
            //RspnStream.Add(0x27);
            //RspnStream.Add(0x06);

            //
            RspnStream.Add(0x01);
            RspnStream.Add(0x01);
            RspnStream.Add(0x01);

            //
            RspnStream.Add(0x07);

            //
            RspnStream.Add(0x00);
            RspnStream.Add(0x00);

            //
            RspnStream.Add(0x0A);
            //Data 8
            RspnStream.Add(0x00);
            //Data 16
            RspnStream.Add(0x00);
            RspnStream.Add(0x00);

            //Data32
            RspnStream.Add(0x00);
            RspnStream.Add(0x00);
            RspnStream.Add(0x00);
            RspnStream.Add(0x00);

            return(RspnStream.ToArray());
        }
Exemple #3
0
 public CalampParser(Byte[] ClientData, string ExceptionLogPth, string FilePth, bool WriteLgFile, bool WriteExcetionLg, string SignalRAPi, ref List <UdpClientInfo> UDPClntList, ref UdpClientInfo UDPClnt, List <string> LstALLIMEI, string ConnectionStr)
 {
     ClntData            = ClientData;
     ExceptionLogPath    = ExceptionLogPth;
     LogFilePath         = FilePth;
     SgnalRApi           = SignalRAPi;
     WriteLogFileflg     = WriteLgFile;
     WriteExceptionLgflg = WriteExcetionLg;
     ObjComnOp           = new TcpService.CommonOperation(LogFilePath, ExceptionLogPath, SgnalRApi);
     objUDPClnt          = UDPClnt;
     lstUDPClnt          = UDPClntList;
     ObjVehicleObj       = new FM_VehicleBL(ConnectionStr);
     AllIMEILst          = LstALLIMEI;
 }
Exemple #4
0
        private DateTime ParseTimeOfFix(string[] HexCollection)
        {
            string Hexvalue     = "";
            int    CounterDiff  = StdDevIDLth - ClntDevIDLth;
            int    StartCounter = 17 - (CounterDiff);
            int    EndCounter   = 20 - (CounterDiff);

            for (int counter = StartCounter; counter <= EndCounter; counter++)
            {
                Hexvalue = Hexvalue + HexCollection[counter];
            }
            Int64    UnixDateTime = CommonOperation.HexaDecimalToDecimalConversion(Hexvalue);
            DateTime dt           = ObjComnOp.UnixTimeStampToDateTime(UnixDateTime);

            return(dt);
        }
Exemple #5
0
        private double ParseHeadingDirection(string[] HexCollection)
        {
            string Hexvalue     = "";
            double Direction    = 0;
            int    CounterDiff  = StdDevIDLth - ClntDevIDLth;
            int    StartCounter = 37 - (CounterDiff);
            int    EndCounter   = 38 - (CounterDiff);

            for (int counter = StartCounter; counter <= EndCounter; counter++)
            {
                Hexvalue = Hexvalue + HexCollection[counter];
            }

            Double HexTODeciVal = CommonOperation.HexaDecimalToDecimalConversion(Hexvalue);

            return(HexTODeciVal);
        }
Exemple #6
0
        private double ParseSpeed(string[] HexCollection)
        {
            string Hexvalue     = "";
            double Speed        = 0;
            int    CounterDiff  = StdDevIDLth - ClntDevIDLth;
            int    StartCounter = 33 - (CounterDiff);
            int    EndCounter   = 36 - (CounterDiff);

            for (int counter = StartCounter; counter <= EndCounter; counter++)
            {
                Hexvalue = Hexvalue + HexCollection[counter];
            }

            Double HexTODeciVal = CommonOperation.HexaDecimalToDecimalConversion(Hexvalue);

            Speed = HexTODeciVal * 0.036;
            return(Speed);
        }
Exemple #7
0
        private double ParseAltitude(string[] HexCollection)
        {
            string Hexvalue     = "";
            double Altitude     = 0;
            int    CounterDiff  = StdDevIDLth - ClntDevIDLth;
            int    StartCounter = 29 - (CounterDiff);
            int    EndCounter   = 32 - (CounterDiff);

            for (int counter = StartCounter; counter <= EndCounter; counter++)
            {
                Hexvalue = Hexvalue + HexCollection[counter];
            }

            Double HexTODeciVal = CommonOperation.HexaDecimalToDecimalConversion(Hexvalue);

            //Altitude Parsing not completed yet
            return(Altitude);
        }