Beispiel #1
0
        private bool Authenticate()
        {
            bool result = false;

            try
            {
                double fixedMsec = 500;

                DateTime begin = DateTime.Now;
                result = (ProtoController.Authenticate() == 1);
                //SimpleConsole.Write(string.Format(" try time {0},result {1}", 5 - tryTimes, result));

                DateTime end        = DateTime.Now;
                double   totalMsecs = (end - begin).TotalMilliseconds;

                fixedMsec = fixedMsec - totalMsecs;

                Thread.Sleep((int)fixedMsec);

                SimpleConsole.WriteLine("RID Use Time:" + totalMsecs);
            }
            catch (Exception exception)
            {
                SimpleConsole.Write(exception);
            }
            return(result);
        }
Beispiel #2
0
        private string GetSamId()
        {
            string result;

            try
            {
                result = ProtoController.GetSAMID();
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(result);
        }
Beispiel #3
0
        private int Realase()
        {
            int result;

            try
            {
                result = ProtoController.CloseComm();
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(result);
        }
Beispiel #4
0
        private int InitCommExt()
        {
            int result;

            try
            {
                result = ProtoController.InitCommExt();
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(result);
        }
Beispiel #5
0
        private int Init(int serialPort = 1001)
        {
            int result = 0;

            try
            {
                result = ProtoController.InitComm(serialPort);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(result);
        }
Beispiel #6
0
        private int GetContentItem()
        {
            int result = -999;

            try
            {
                result = ProtoController.Read_Content_Path(ProtoController.Dir, 1);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(result);
        }