Esempio n. 1
0
        /// <summary>
        /// 将当前的动态配置发送给主机 动态配置的属性是  shareAction1P 和 shareAction2P
        /// </summary>
        /// <returns></returns>
        public bool UpdateDynamicConf()
        {
            ConfigureCommandRequest request = new ConfigureCommandRequest(handshakeRespone, shareAction1P, shareAction2P);

            request.SetChannel(channel);
            var postdata = request.GetFinalArray();

            TryWrite(postdata, 0, 21);
            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// 初始化主机配置包含 频率 信道等可以多次设置 ,但因为一般在一个生存周期内 只会设置一次 所以标识为Init
        /// </summary>
        /// <param name="conf"></param>
        /// <returns></returns>
        public bool InitConf(ConfAction conf)
        {
            ConfigureCommandRequest request = new ConfigureCommandRequest(handshakeRespone, shareAction1P, shareAction2P);

            if (conf.channel > 0)
            {
                request.SetChannel(conf.channel);
                channel = conf.channel;
            }
            if (conf.frequency != FrequencyEnum.Null)
            {
                request.SetFrequency(conf.frequency);
            }
            if (conf.date != null && conf.date > DateTime.MinValue)
            {
                request.SetDate(conf.date);
            }
            var postdata = request.GetFinalArray();

            TryWrite(postdata, 0, 21);
            return(true);
        }