示例#1
0
        public void SetRFTime(string strToTime)
        {
            //初始化
            icdev = RFDef.rf_init(port, baud);
            if (icdev < 0)
            {
                quit();
                return;
            }

            //设置时间
            byte[] time1 = new byte[14];
            byte[] time2 = new byte[7];

            string totime = strToTime;

            time1 = Encoding.ASCII.GetBytes(totime);
            RFDef.a_hex(time1, time2, 14);
            st = RFDef.rf_settime(icdev, time2);
            if (st != 0)
            {
                quit();
                return;
            }

            //设置显示模式
            st = RFDef.rf_disp_mode(icdev, 0);
            if (st != 0)
            {
                quit();
                return;
            }

            quit();
        }