Example #1
0
        /// <summary>
        /// 密码键盘异常时发送状态
        /// </summary>
        public static string SendZT598State()
        {
            string        port   = SysConfigHelper.readerNode("ZT598Port");
            StringBuilder info   = new StringBuilder(1024);
            int           handle = -1;

            for (int i = 1; i <= 2; i++)
            {
                handle = ZT598.TT_OpenDevice(new StringBuilder("COM" + port), new StringBuilder("9600"), new StringBuilder());
                if (handle == 0)
                {
                    break;
                }
            }
            int jubing = handle;

            if (handle == 0)
            {
                handle = ZT598.TT_GetDeviceStatus(info);
                if (handle != 0)
                {
                    return("02" + handle.ToString());
                }
            }
            else
            {
                return("02" + handle.ToString());
            }
            return(null);
        }
Example #2
0
        /// <summary>
        /// 取设备状态:0为正常
        /// </summary>
        /// <returns></returns>
        public int GetDeviceStatus()
        {
            StringBuilder statusMsg = new StringBuilder("SSS");
            int           status    = ZT598.TT_GetDeviceStatus(statusMsg);

            return(status);
        }