using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CoreAgent.ProtocolClient.Models { /// /// LTE协议能力信息模型 /// 用于存储用户设备(UE)的LTE协议栈能力信息,包括频段支持、UE类别等 /// public class ProtocolCaps { /// /// 用户设备唯一标识符 /// public int UeId { get; set; } /// /// 支持的LTE频段列表 /// public List Bands { get; set; } = new List(); /// /// UE类别(可选) /// public int? Category { get; set; } /// /// 下行UE类别(可选) /// public int? CategoryDl { get; set; } /// /// 上行UE类别(可选) /// public int? CategoryUl { get; set; } /// /// 协议能力数据列表 /// public List Data { get; set; } = new List(); /// /// 数据项计数 /// public int Count { get; set; } = 0; /// /// 频段组合列表 /// public List BandComb { get; set; } = new List(); /// /// ASN.1编码数据列表 /// public List Asn1 { get; set; } = new List(); } /// /// ProtocolCaps扩展方法类 /// 提供ProtocolCaps相关的工具方法和扩展功能 /// public static class ProtocolCapsExtensions { /// /// UE能力MIMO层数映射字典 /// 定义不同MIMO配置对应的层数 /// private static readonly Dictionary UE_CAPS_MIMO = new Dictionary { { "twoLayers", 2 }, { "fourLayers", 4 }, { "eightLayers", 8 } }; /// /// 获取UE类别信息的字符串表示 /// 优先返回DL/UL类别组合,如果没有则返回通用类别 /// /// 协议能力信息对象 /// 格式化的类别信息字符串 public static string GetCategory(this ProtocolCaps caps) { List categories = new List(); if (caps.CategoryDl.HasValue) { categories.Add($"DL={caps.CategoryDl.Value}"); } if (caps.CategoryUl.HasValue) { categories.Add($"UL={caps.CategoryUl.Value}"); } if (categories.Count > 0) { return string.Join(",", categories); } if (caps.Category.HasValue) { return caps.Category.Value.ToString(); } return string.Empty; } } }