bool _checkSerialNumber(Dut.IPCamera <U> camera, string vnpt_product_number, string vnpt_mac_code, out string serial_number)
        {
            var    prop_logsystem = uploadInfo.GetType().GetProperty("logSystem");
            string log_value      = (string)prop_logsystem.GetValue(uploadInfo);

            bool ret   = false;
            int  count = 0;

RE:
            count++;

            //đọc serial number
            serial_number = camera.getSerialNumber();
            serial_number = serial_number.Replace("[", "")
                            .Replace("]", "")
                            .Replace("\n", "")
                            .Replace("\r", "")
                            .Replace("~ #", "")
                            .Trim();

            log_value += string.Format("...đọc serial number: {0}\n", serial_number);
            prop_logsystem.SetValue(uploadInfo, log_value);

            //check header
            ret        = serial_number.ToLower().Substring(0, vnpt_product_number.Length).Contains(vnpt_product_number.ToLower());
            log_value += string.Format("...check header: {0}\n", ret);
            prop_logsystem.SetValue(uploadInfo, log_value);
            if (!ret)
            {
                if (count < 3)
                {
                    goto RE;
                }
                else
                {
                    goto END;
                }
            }

            //check trùng khớp với mac
            string mac = camera.getMacEthernet();

            ret        = mac.ToLower().Substring(6, 6).Equals(serial_number.ToLower().Substring(9, 6));
            log_value += string.Format("...check trùng khớp với mac {0}: {1}\n", mac, ret);
            prop_logsystem.SetValue(uploadInfo, log_value);
            if (!ret)
            {
                if (count < 3)
                {
                    goto RE;
                }
                else
                {
                    goto END;
                }
            }

            //check mac code
            ret        = Parse.IsMatchingMacCode(serial_number, mac, vnpt_mac_code);
            log_value += string.Format("...check trùng khớp với mac header {0}: {1}\n", mac, ret);
            prop_logsystem.SetValue(uploadInfo, log_value);
            if (!ret)
            {
                if (count < 3)
                {
                    goto RE;
                }
                else
                {
                    goto END;
                }
            }

END:
            return(ret);
        }
        //ghi sn qua cong telnet
        public bool excuteTelnet()
        {
            bool ret = false;
            var  prop_serialresult = testingInfo.GetType().GetProperty("serialResult");

            prop_serialresult.SetValue(testingInfo, "Waiting...");

            //get logsytem
            var    prop_logsystem = testingInfo.GetType().GetProperty("logSystem");
            string log_value      = (string)prop_logsystem.GetValue(testingInfo);

            try {
                if (!camera.IsConnected())
                {
                    goto END;
                }

                int count = 0;
RE:
                count++;
                //set serial
                log_value += string.Format("...ghi serial number \"{0}\" vào camera.\n", std_value);
                prop_logsystem.SetValue(testingInfo, log_value);

                ret = camera.setSerialNumber(std_value);
                if (!ret)
                {
                    if (count < retry_time)
                    {
                        goto RE;
                    }
                    else
                    {
                        goto END;
                    }
                }

                //verify serial after set
                ret        = false;
                log_value += string.Format("...đọc giá trị serial number sau khi ghi\n");
                prop_logsystem.SetValue(testingInfo, log_value);

                string data = camera.getSerialNumber();
                log_value += data;
                prop_logsystem.SetValue(testingInfo, log_value);

                if (data != null)
                {
                    ret = data.ToUpper().Contains(std_value.ToUpper());
                }
                if (!ret)
                {
                    if (count < retry_time)
                    {
                        goto RE;
                    }
                }
            }
            catch (Exception ex) {
                log_value += ex.ToString();
                prop_logsystem.SetValue(testingInfo, log_value);
                goto END;
            }

END:
            prop_serialresult.SetValue(testingInfo, ret ? "Passed" : "Failed");
            return(ret);
        }