Browse Source

优化: 使用 is 模式匹配优化 CellularNetworkService 中的配置类型判断

master
root 2 days ago
parent
commit
bc4b8dea7d
  1. 4
      CoreAgent.Infrastructure/Services/Network/CellularNetworkService.cs

4
CoreAgent.Infrastructure/Services/Network/CellularNetworkService.cs

@ -180,8 +180,8 @@ public class CellularNetworkService : ICellularNetworkService
return CellularNetworkOperationResult.Success(NetworkStatus.Disconnected);
}
// 2. 检查 RAN 退出状态(仅当配置类型为 BothRagAndCore 时)
if (_context.CurrentConfigType == NetworkConfigType.BothRagAndCore)
// 2. 检查 RAN 退出状态(仅当配置类型为 BothRagAndCore 或 RagOnly 时)
if (_context.CurrentConfigType is NetworkConfigType.BothRagAndCore or NetworkConfigType.RagOnly)
{
var isRanQuit = await _statusMonitor.CheckRanQuitAsync(_context.NetworkIPEndPointManager.GetRanEndPoint());
if (!isRanQuit)

Loading…
Cancel
Save