示例#1
0
        /// <summary>
        /// 添加中继地址 自动设置 中继列表地址模式、中继索引、中继节点数
        /// </summary>
        /// <param name="addr"></param>
        public void Add(NetAddr addr)
        {
            if (addr == null)
            {
                throw new ArgumentNullException("addr", "addr不能为空");
            }
            if (RouteNodeNum > 6)
            {
                throw new Exception("中继地址已经超过了6个 不能再添加");
            }
            var mode = addr.AddrMode;

            InsideData.SetBits(10 + 2 * RouteNodeNum, 2, (byte)mode);
            RouteNodeNum++;
            RouteIndex++;
            RouteAddrList.Add(addr);
        }