Browse Source

合并modify 文件

feature/protocol-log-Perfect
root 4 months ago
parent
commit
018d1246f0
  1. 90
      CoreAgent.API/Controllers/RanAPIController.cs
  2. 25
      CoreAgent.Application/Commands/RanAPI/SetAllTxGainCommand.cs
  3. 25
      CoreAgent.Application/Commands/RanAPI/SetTxGainCommand.cs
  4. 3
      CoreAgent.Application/Handlers/CellularNetwork/StartCellularNetworkCommandHandler.cs
  5. 11
      CoreAgent.Application/Handlers/CellularNetwork/StartGeneralCellularNetworkCommandHandler.cs
  6. 73
      CoreAgent.Application/Handlers/RanAPI/SetAllTxGainCommandHandler.cs
  7. 73
      CoreAgent.Application/Handlers/RanAPI/SetTxGainCommandHandler.cs
  8. 39
      CoreAgent.Domain/Interfaces/Common/IServiceScopeManager.cs
  9. 83
      CoreAgent.Domain/Interfaces/Network/IRanAPICommandHandler.cs
  10. 22
      CoreAgent.Domain/Interfaces/Network/IRanAPICommandHandlerFactory.cs
  11. 38
      CoreAgent.Domain/Interfaces/Network/IRanGainControlHandler.cs
  12. 8
      CoreAgent.Infrastructure/Extensions/ServiceCollection/CommandServiceExtensions.cs
  13. 325
      CoreAgent.Infrastructure/Handlers/API/RanAPICommandHandler.cs
  14. 49
      CoreAgent.Infrastructure/Handlers/API/RanAPICommandHandlerFactory.cs
  15. 130
      CoreAgent.Infrastructure/Services/Common/ServiceScopeManager.cs
  16. 91
      CoreAgent.Infrastructure/Services/Network/GeneralCellularNetworkService.cs
  17. 5
      CoreAgent.Infrastructure/Services/Network/ProtocolClientConfigFactory.cs
  18. 10
      CoreAgent.Infrastructure/Services/Network/ProtocolWsClientManager.cs
  19. 5
      CoreAgent.ProtocolClient/Interfaces/IProtocolWsClientManager.cs
  20. 2
      CoreAgent.ProtocolClient/Models/ProtocolClientConfig.cs
  21. 7219
      modify.md

90
CoreAgent.API/Controllers/RanAPIController.cs

@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using CoreAgent.Application.Commands.RanAPI;
using CoreAgent.Domain.Models.Common;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace CoreAgent.API.Controllers;
/// <summary>
/// RAN API 控制器
/// 负责处理RAN相关的API操作
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class RanAPIController : BaseApiController
{
private readonly ILogger<RanAPIController> _logger;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="mediator">MediatR中介者</param>
/// <param name="logger">日志记录器</param>
public RanAPIController(
IMediator mediator,
ILogger<RanAPIController> logger) : base(mediator, logger)
{
_logger = logger;
}
/// <summary>
/// 设置发送增益
/// </summary>
/// <param name="gainSettings">增益设置字典,key为端口号(int),value为增益值(double)</param>
/// <returns>设置结果</returns>
[HttpPost("set-tx-gain")]
public async Task<IActionResult> SetTxGain([FromBody] Dictionary<int, double> gainSettings)
{
try
{
_logger.LogInformation("收到设置发送增益请求,端口数量: {PortCount}", gainSettings?.Count);
var command = new SetTxGainCommand(gainSettings);
var result = await _mediator.Send(command);
_logger.LogInformation("设置发送增益请求处理完成");
return result;
}
catch (Exception ex)
{
_logger.LogError(ex, "处理设置发送增益请求时发生异常");
return ApiActionResult<bool>.Error(
$"处理请求失败: {ex.Message}",
"INTERNAL_ERROR",
System.Net.HttpStatusCode.InternalServerError);
}
}
/// <summary>
/// 设置所有端口发送增益
/// </summary>
/// <param name="gainValues">所有端口的增益值数组,按端口顺序排列</param>
/// <returns>设置结果</returns>
[HttpPost("set-all-tx-gain")]
public async Task<IActionResult> SetAllTxGain([FromBody] double[] gainValues)
{
try
{
_logger.LogInformation("收到设置所有端口发送增益请求,端口数量: {PortCount}", gainValues?.Length);
var command = new SetAllTxGainCommand(gainValues);
var result = await _mediator.Send(command);
_logger.LogInformation("设置所有端口发送增益请求处理完成");
return result;
}
catch (Exception ex)
{
_logger.LogError(ex, "处理设置所有端口发送增益请求时发生异常");
return ApiActionResult<bool>.Error(
$"处理请求失败: {ex.Message}",
"INTERNAL_ERROR",
System.Net.HttpStatusCode.InternalServerError);
}
}
}

25
CoreAgent.Application/Commands/RanAPI/SetAllTxGainCommand.cs

@ -0,0 +1,25 @@
using System;
using CoreAgent.Domain.Models.Common;
using MediatR;
namespace CoreAgent.Application.Commands.RanAPI;
/// <summary>
/// 设置所有端口发送增益命令
/// </summary>
public class SetAllTxGainCommand : IRequest<ApiActionResult<bool>>
{
/// <summary>
/// 所有端口的增益值数组,按端口顺序排列
/// </summary>
public double[] GainValues { get; }
/// <summary>
/// 构造函数
/// </summary>
/// <param name="gainValues">所有端口的增益值数组</param>
public SetAllTxGainCommand(double[] gainValues)
{
GainValues = gainValues ?? throw new ArgumentNullException(nameof(gainValues));
}
}

25
CoreAgent.Application/Commands/RanAPI/SetTxGainCommand.cs

@ -0,0 +1,25 @@
using System;
using CoreAgent.Domain.Models.Common;
using MediatR;
namespace CoreAgent.Application.Commands.RanAPI;
/// <summary>
/// 设置发送增益命令
/// </summary>
public class SetTxGainCommand : IRequest<ApiActionResult<bool>>
{
/// <summary>
/// 增益设置字典,key为端口号(int),value为增益值(double)
/// </summary>
public Dictionary<int, double> GainSettings { get; }
/// <summary>
/// 构造函数
/// </summary>
/// <param name="gainSettings">增益设置字典</param>
public SetTxGainCommand(Dictionary<int, double> gainSettings)
{
GainSettings = gainSettings ?? throw new ArgumentNullException(nameof(gainSettings));
}
}

3
CoreAgent.Application/Handlers/CellularNetwork/StartCellularNetworkCommandHandler.cs

@ -15,7 +15,7 @@ public class StartCellularNetworkCommandHandler : IRequestHandler<StartCellularN
{
private readonly ICellularNetworkService _cellularNetworkService;
private readonly ILogger<StartCellularNetworkCommandHandler> _logger;
public StartCellularNetworkCommandHandler(
ICellularNetworkService cellularNetworkService,
ILogger<StartCellularNetworkCommandHandler> logger)
@ -32,7 +32,6 @@ public class StartCellularNetworkCommandHandler : IRequestHandler<StartCellularN
// 启动网络
var result = await _cellularNetworkService.StartAsync(request.Key);
if (result.IsSuccess)
{
_logger.LogInformation("蜂窝网络配置 {ConfigKey} 启动成功", request.Key);

11
CoreAgent.Application/Handlers/CellularNetwork/StartGeneralCellularNetworkCommandHandler.cs

@ -14,11 +14,12 @@ namespace CoreAgent.Application.Handlers.CellularNetwork;
public class StartGeneralCellularNetworkCommandHandler : IRequestHandler<StartGeneralCellularNetworkCommand, ApiActionResult<NetworkStatus>>
{
private readonly IGeneralCellularNetworkService _cellularNetworkService;
private readonly ILogger<StartCellularNetworkCommandHandler> _logger;
private readonly ILogger<StartGeneralCellularNetworkCommandHandler> _logger;
public StartGeneralCellularNetworkCommandHandler(
IGeneralCellularNetworkService cellularNetworkService,
ILogger<StartCellularNetworkCommandHandler> logger)
ILogger<StartGeneralCellularNetworkCommandHandler> logger)
{
_cellularNetworkService = cellularNetworkService;
_logger = logger;
@ -29,10 +30,10 @@ public class StartGeneralCellularNetworkCommandHandler : IRequestHandler<StartGe
try
{
_logger.LogInformation("正在启动蜂窝网络配置: {ConfigKey}", request?.CellularNetwork?.RuntimeCode);
// 启动网络
var result = await _cellularNetworkService.StartAsync(request.CellularNetwork);
if (result.IsSuccess)
{
_logger.LogInformation("蜂窝网络配置 {ConfigKey} 启动成功", request?.CellularNetwork?.RuntimeCode);
@ -56,4 +57,4 @@ public class StartGeneralCellularNetworkCommandHandler : IRequestHandler<StartGe
HttpStatusCode.InternalServerError);
}
}
}
}

73
CoreAgent.Application/Handlers/RanAPI/SetAllTxGainCommandHandler.cs

@ -0,0 +1,73 @@
using System;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using CoreAgent.Application.Commands.RanAPI;
using CoreAgent.Domain.Interfaces.Network;
using CoreAgent.Domain.Models.Common;
using MediatR;
using Microsoft.Extensions.Logging;
namespace CoreAgent.Application.Handlers.RanAPI;
/// <summary>
/// 设置所有端口发送增益命令处理器
/// </summary>
public class SetAllTxGainCommandHandler : IRequestHandler<SetAllTxGainCommand, ApiActionResult<bool>>
{
private readonly IRanAPICommandHandlerFactory _ranAPICommandHandlerFactory;
private readonly ILogger<SetAllTxGainCommandHandler> _logger;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="ranAPICommandHandlerFactory">RAN API命令处理器工厂</param>
/// <param name="logger">日志记录器</param>
public SetAllTxGainCommandHandler(
IRanAPICommandHandlerFactory ranAPICommandHandlerFactory,
ILogger<SetAllTxGainCommandHandler> logger)
{
_ranAPICommandHandlerFactory = ranAPICommandHandlerFactory ?? throw new ArgumentNullException(nameof(ranAPICommandHandlerFactory));
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
}
/// <summary>
/// 处理设置所有端口发送增益命令
/// </summary>
/// <param name="request">设置所有端口发送增益命令</param>
/// <param name="cancellationToken">取消令牌</param>
/// <returns>设置所有端口发送增益结果</returns>
public async Task<ApiActionResult<bool>> Handle(SetAllTxGainCommand request, CancellationToken cancellationToken)
{
try
{
_logger.LogInformation("正在设置所有端口发送增益,端口数量: {PortCount}", request.GainValues?.Length);
// 通过工厂获取RAN增益控制处理器并执行操作
var ranGainControlHandler = _ranAPICommandHandlerFactory.CreateGainControlHandler();
var result = await ranGainControlHandler.SetAllTxGainAsync(request.GainValues);
if (result)
{
_logger.LogInformation("所有端口发送增益设置成功");
return ApiActionResult<bool>.Ok(true, "所有端口发送增益设置成功");
}
else
{
_logger.LogWarning("所有端口发送增益设置失败");
return ApiActionResult<bool>.Error(
"所有端口发送增益设置失败",
"ALL_TX_GAIN_SET_FAILED",
HttpStatusCode.BadRequest);
}
}
catch (Exception ex)
{
_logger.LogError(ex, "设置所有端口发送增益失败");
return ApiActionResult<bool>.Error(
$"设置所有端口发送增益失败: {ex.Message}",
"INTERNAL_ERROR",
HttpStatusCode.InternalServerError);
}
}
}

73
CoreAgent.Application/Handlers/RanAPI/SetTxGainCommandHandler.cs

@ -0,0 +1,73 @@
using System;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using CoreAgent.Application.Commands.RanAPI;
using CoreAgent.Domain.Interfaces.Network;
using CoreAgent.Domain.Models.Common;
using MediatR;
using Microsoft.Extensions.Logging;
namespace CoreAgent.Application.Handlers.RanAPI;
/// <summary>
/// 设置发送增益命令处理器
/// </summary>
public class SetTxGainCommandHandler : IRequestHandler<SetTxGainCommand, ApiActionResult<bool>>
{
private readonly IRanAPICommandHandlerFactory _ranAPICommandHandlerFactory;
private readonly ILogger<SetTxGainCommandHandler> _logger;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="ranAPICommandHandlerFactory">RAN API命令处理器工厂</param>
/// <param name="logger">日志记录器</param>
public SetTxGainCommandHandler(
IRanAPICommandHandlerFactory ranAPICommandHandlerFactory,
ILogger<SetTxGainCommandHandler> logger)
{
_ranAPICommandHandlerFactory = ranAPICommandHandlerFactory ?? throw new ArgumentNullException(nameof(ranAPICommandHandlerFactory));
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
}
/// <summary>
/// 处理设置发送增益命令
/// </summary>
/// <param name="request">设置发送增益命令</param>
/// <param name="cancellationToken">取消令牌</param>
/// <returns>设置发送增益结果</returns>
public async Task<ApiActionResult<bool>> Handle(SetTxGainCommand request, CancellationToken cancellationToken)
{
try
{
_logger.LogInformation("正在设置发送增益,端口数量: {PortCount}", request.GainSettings?.Count);
// 通过工厂获取RAN增益控制处理器并执行操作
var ranGainControlHandler = _ranAPICommandHandlerFactory.CreateGainControlHandler();
var result = await ranGainControlHandler.SetTxGainAsync(request.GainSettings);
if (result)
{
_logger.LogInformation("发送增益设置成功");
return ApiActionResult<bool>.Ok(true, "发送增益设置成功");
}
else
{
_logger.LogWarning("发送增益设置失败");
return ApiActionResult<bool>.Error(
"发送增益设置失败",
"TX_GAIN_SET_FAILED",
HttpStatusCode.BadRequest);
}
}
catch (Exception ex)
{
_logger.LogError(ex, "设置发送增益失败");
return ApiActionResult<bool>.Error(
$"设置发送增益失败: {ex.Message}",
"INTERNAL_ERROR",
HttpStatusCode.InternalServerError);
}
}
}

39
CoreAgent.Domain/Interfaces/Common/IServiceScopeManager.cs

@ -0,0 +1,39 @@
using Microsoft.Extensions.DependencyInjection;
namespace CoreAgent.Domain.Interfaces.Common;
/// <summary>
/// 服务作用域管理器接口
/// 用于在单例服务中创建瞬时服务
/// </summary>
public interface IServiceScopeManager
{
/// <summary>
/// 在作用域中执行操作
/// </summary>
/// <typeparam name="T">返回类型</typeparam>
/// <param name="operation">要执行的操作</param>
/// <returns>操作结果</returns>
Task<T> ExecuteInScopeAsync<T>(Func<IServiceProvider, Task<T>> operation);
/// <summary>
/// 在作用域中执行操作(无返回值)
/// </summary>
/// <param name="operation">要执行的操作</param>
/// <returns>任务</returns>
Task ExecuteInScopeAsync(Func<IServiceProvider, Task> operation);
/// <summary>
/// 在作用域中执行操作(同步)
/// </summary>
/// <typeparam name="T">返回类型</typeparam>
/// <param name="operation">要执行的操作</param>
/// <returns>操作结果</returns>
T ExecuteInScope<T>(Func<IServiceProvider, T> operation);
/// <summary>
/// 在作用域中执行操作(同步,无返回值)
/// </summary>
/// <param name="operation">要执行的操作</param>
void ExecuteInScope(Action<IServiceProvider> operation);
}

83
CoreAgent.Domain/Interfaces/Network/IRanAPICommandHandler.cs

@ -0,0 +1,83 @@
using CoreAgent.Domain.Interfaces.System.Command;
using CoreAgent.Domain.Models.Network;
using CoreAgent.Domain.Models.System;
namespace CoreAgent.Domain.Interfaces.Network;
/// <summary>
/// RAN API 命令处理器基础接口
/// 负责处理各种RAN相关的API操作命令
/// </summary>
public interface IRanAPICommandHandler
{
/// <summary>
/// 设置 BCCH 日志状态
/// </summary>
/// <param name="enableBcch">是否启用BCCH日志</param>
/// <returns>是否成功设置BCCH日志状态</returns>
Task<bool> SetBcchLogStatusAsync(bool enableBcch);
}
/// <summary>
/// RAN API 命令处理器抽象基类
/// 提供通用的命令执行逻辑
/// </summary>
public abstract class RanAPICommandHandlerBase : IRanAPICommandHandler
{
protected readonly ISystemCommandExecutor _commandExecutor;
protected readonly AppSettings _appSettings;
protected RanAPICommandHandlerBase(ISystemCommandExecutor commandExecutor, AppSettings appSettings)
{
_commandExecutor = commandExecutor ?? throw new ArgumentNullException(nameof(commandExecutor));
_appSettings = appSettings ?? throw new ArgumentNullException(nameof(appSettings));
}
/// <summary>
/// 执行命令的通用方法
/// </summary>
/// <param name="command">要执行的命令</param>
/// <param name="operationName">操作名称,用于日志记录</param>
/// <param name="parameters">操作参数,用于日志记录</param>
/// <returns>命令执行结果</returns>
protected async Task<CommandExecutionResult> ExecuteCommandAsync(string command, string operationName, object parameters = null)
{
try
{
var result = await _commandExecutor.ExecuteCommandAsync(command, new CancellationTokenSource());
return result;
}
catch (Exception ex)
{
// 这里可以添加通用的异常处理逻辑
throw new InvalidOperationException($"执行{operationName}命令时发生异常: {ex.Message}", ex);
}
}
/// <summary>
/// 构建命令前缀
/// </summary>
/// <param name="ranEndPoint">RAN 端点信息</param>
/// <returns>命令前缀</returns>
protected string BuildCommandPrefix(RanIPEndPoint ranEndPoint)
{
return $"{_appSettings.WebSocketJsPath} {ranEndPoint.ComAddr}";
}
/// <summary>
/// 验证RAN端点
/// </summary>
/// <param name="ranEndPoint">RAN 端点信息</param>
/// <returns>是否有效</returns>
protected bool ValidateRanEndPoint(RanIPEndPoint ranEndPoint)
{
return ranEndPoint != null;
}
/// <summary>
/// 设置 BCCH 日志状态
/// </summary>
/// <param name="enableBcch">是否启用BCCH日志</param>
/// <returns>是否成功设置BCCH日志状态</returns>
public abstract Task<bool> SetBcchLogStatusAsync(bool enableBcch);
}

22
CoreAgent.Domain/Interfaces/Network/IRanAPICommandHandlerFactory.cs

@ -0,0 +1,22 @@
using CoreAgent.Domain.Models.Network;
namespace CoreAgent.Domain.Interfaces.Network;
/// <summary>
/// RAN API 命令处理器工厂接口
/// 负责创建和管理RAN API命令处理器实例
/// </summary>
public interface IRanAPICommandHandlerFactory
{
/// <summary>
/// 创建RAN API命令处理器
/// </summary>
/// <returns>RAN API命令处理器实例</returns>
IRanAPICommandHandler CreateHandler();
/// <summary>
/// 创建RAN增益控制处理器
/// </summary>
/// <returns>RAN增益控制处理器实例</returns>
IRanGainControlHandler CreateGainControlHandler();
}

38
CoreAgent.Domain/Interfaces/Network/IRanGainControlHandler.cs

@ -0,0 +1,38 @@
using CoreAgent.Domain.Models.Network;
namespace CoreAgent.Domain.Interfaces.Network;
/// <summary>
/// RAN API 增益控制接口
/// 负责处理发送和接收增益相关的操作
/// </summary>
public interface IRanGainControlHandler
{
/// <summary>
/// 设置发送增益
/// </summary>
/// <param name="gainSettings">增益设置字典,key为端口号(int),value为增益值(double)</param>
/// <returns>是否成功设置增益</returns>
Task<bool> SetTxGainAsync(Dictionary<int, double> gainSettings);
/// <summary>
/// 设置接收增益
/// </summary>
/// <param name="gainSettings">增益设置字典,key为端口号(int),value为增益值(double)</param>
/// <returns>是否成功设置增益</returns>
Task<bool> SetRxGainAsync(Dictionary<int, double> gainSettings);
/// <summary>
/// 设置所有端口的发送增益
/// </summary>
/// <param name="gainValues">所有端口的增益值数组,按端口顺序排列</param>
/// <returns>是否成功设置增益</returns>
Task<bool> SetAllTxGainAsync(double[] gainValues);
/// <summary>
/// 设置所有端口的接收增益
/// </summary>
/// <param name="gainValues">所有端口的增益值数组,按端口顺序排列</param>
/// <returns>是否成功设置增益</returns>
Task<bool> SetAllRxGainAsync(double[] gainValues);
}

8
CoreAgent.Infrastructure/Extensions/ServiceCollection/CommandServiceExtensions.cs

@ -2,12 +2,15 @@ using CoreAgent.Domain.Interfaces;
using CoreAgent.Domain.Interfaces.Network;
using CoreAgent.Domain.Interfaces.System;
using CoreAgent.Domain.Interfaces.System.Command;
using CoreAgent.Domain.Interfaces.Common;
using CoreAgent.Infrastructure.Command.Factories;
using CoreAgent.Infrastructure.Contexts;
using CoreAgent.Infrastructure.Handlers.API;
using CoreAgent.Infrastructure.Repositories;
using CoreAgent.Infrastructure.Services;
using CoreAgent.Infrastructure.Services.Network;
using CoreAgent.Infrastructure.Services.System;
using CoreAgent.Infrastructure.Services.Common;
using CoreAgent.ProtocolClient.Interfaces;
using CoreAgent.ProtocolClient.ProtocolEngineCore;
using Microsoft.Extensions.DependencyInjection;
@ -45,6 +48,9 @@ public static class CommandServiceExtensions
services.AddSingleton<ISystemCommandExecutorFactory, SystemCommandExecutorFactory>();
services.AddSingleton<IProtocolLogObserver, NetworkProtocolLogObserver>();
services.AddSingleton<IProtocolWsClientManager, ProtocolWsClientManager>();
// 注册服务作用域管理器(单例)
services.AddSingleton<IServiceScopeManager, ServiceScopeManager>();
// 注册命令执行器(瞬时)
services.AddTransient<ISystemCommandExecutor>(sp =>
{
@ -61,6 +67,8 @@ public static class CommandServiceExtensions
services.AddScoped<INetworkStatusMonitor, NetworkStatusMonitor>();
services.AddScoped<ICellularNetworkService, CellularNetworkService>();
// 注册API处理器工厂
services.AddScoped<IRanAPICommandHandlerFactory, RanAPICommandHandlerFactory>();
// 注册系统服务
services.AddScoped<IDeviceService, DeviceService>();

325
CoreAgent.Infrastructure/Handlers/API/RanAPICommandHandler.cs

@ -0,0 +1,325 @@
using CoreAgent.Domain.Interfaces.Network;
using CoreAgent.Domain.Interfaces.System.Command;
using CoreAgent.Domain.Models.Network;
using CoreAgent.Domain.Models.System;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace CoreAgent.Infrastructure.Handlers.API;
/// <summary>
/// RAN API 命令处理器实现
/// 负责处理各种RAN相关的API操作命令
/// </summary>
public class RanAPICommandHandler : RanAPICommandHandlerBase, IRanGainControlHandler
{
private readonly ILogger<RanAPICommandHandler> _logger;
private readonly ICellularNetworkContext _context;
public RanAPICommandHandler(
ILogger<RanAPICommandHandler> logger,
ISystemCommandExecutor commandExecutor,
IOptions<AppSettings> appSettings,
ICellularNetworkContext context)
: base(commandExecutor, appSettings.Value)
{
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_context = context ?? throw new ArgumentNullException(nameof(context));
}
/// <summary>
/// 设置 BCCH 日志状态
/// </summary>
/// <param name="enableBcch">是否启用BCCH日志</param>
/// <returns>是否成功设置BCCH日志状态</returns>
public override async Task<bool> SetBcchLogStatusAsync(bool enableBcch)
{
var ranEndPoint = _context.NetworkIPEndPointManager.GetRanEndPoint();
if (!ValidateRanEndPoint(ranEndPoint))
{
_logger.LogWarning("RAN 端点未配置");
return false;
}
try
{
var configCommand = $@"{{""message"":""config_set"",""logs"":{{""bcch"":{enableBcch.ToString().ToLower()}}}}}";
var command = $"{BuildCommandPrefix(ranEndPoint)} '{configCommand}'";
_logger.LogInformation("开始设置BCCH日志状态,地址: {ComAddr}, 启用BCCH: {EnableBcch}", ranEndPoint.ComAddr, enableBcch);
var result = await ExecuteCommandAsync(command, "BCCH日志状态设置");
if (result.IsSuccess)
{
_logger.LogInformation("BCCH日志状态设置成功,地址: {ComAddr}, 启用BCCH: {EnableBcch}", ranEndPoint.ComAddr, enableBcch);
return true;
}
else
{
_logger.LogWarning("BCCH日志状态设置失败,地址: {ComAddr}, 启用BCCH: {EnableBcch}, 错误: {Error}",
ranEndPoint.ComAddr, enableBcch, result.Error);
return false;
}
}
catch (Exception ex)
{
_logger.LogError(ex, "设置BCCH日志状态时发生异常,地址: {ComAddr}, 启用BCCH: {EnableBcch}", ranEndPoint.ComAddr, enableBcch);
return false;
}
}
#region 增益控制方法
/// <summary>
/// 设置发送增益
/// </summary>
/// <param name="gainSettings">增益设置字典,key为端口号(int),value为增益值(double)</param>
/// <returns>是否成功设置增益</returns>
public async Task<bool> SetTxGainAsync(Dictionary<int, double> gainSettings)
{
var ranEndPoint = _context.NetworkIPEndPointManager.GetRanEndPoint();
if (!ValidateRanEndPoint(ranEndPoint))
{
_logger.LogWarning("RAN 端点未配置");
return false;
}
if (gainSettings == null || gainSettings.Count == 0)
{
_logger.LogWarning("增益设置字典为空或无效");
return false;
}
try
{
var successCount = 0;
var totalCount = gainSettings.Count;
_logger.LogInformation("开始批量设置发送增益,地址: {ComAddr}, 端口数量: {PortCount}", ranEndPoint.ComAddr, totalCount);
foreach (var setting in gainSettings)
{
var port = setting.Key;
var setGain = setting.Value;
var configCommand = $@"{{""message"":""rf"",""tx_gain"":{setGain},""tx_channel_index"":{port}}}";
var command = $"{BuildCommandPrefix(ranEndPoint)} '{configCommand}'";
_logger.LogDebug("设置端口 {Port} 的发送增益值为 {SetGain}", port, setGain);
var result = await ExecuteCommandAsync(command, "发送增益设置");
if (result.IsSuccess)
{
successCount++;
_logger.LogDebug("端口 {Port} 发送增益设置成功,增益值: {SetGain}", port, setGain);
}
else
{
_logger.LogWarning("端口 {Port} 发送增益设置失败,增益值: {SetGain}, 错误: {Error}",
port, setGain, result.Error);
}
}
var allSuccess = successCount == totalCount;
if (allSuccess)
{
_logger.LogInformation("所有端口发送增益设置成功,地址: {ComAddr}, 成功数量: {SuccessCount}/{TotalCount}",
ranEndPoint.ComAddr, successCount, totalCount);
}
else
{
_logger.LogWarning("部分端口发送增益设置失败,地址: {ComAddr}, 成功数量: {SuccessCount}/{TotalCount}",
ranEndPoint.ComAddr, successCount, totalCount);
}
return allSuccess;
}
catch (Exception ex)
{
_logger.LogError(ex, "批量设置发送增益时发生异常,地址: {ComAddr}", ranEndPoint.ComAddr);
return false;
}
}
/// <summary>
/// 设置接收增益
/// </summary>
/// <param name="gainSettings">增益设置字典,key为端口号(int),value为增益值(double)</param>
/// <returns>是否成功设置增益</returns>
public async Task<bool> SetRxGainAsync(Dictionary<int, double> gainSettings)
{
var ranEndPoint = _context.NetworkIPEndPointManager.GetRanEndPoint();
if (!ValidateRanEndPoint(ranEndPoint))
{
_logger.LogWarning("RAN 端点未配置");
return false;
}
if (gainSettings == null || gainSettings.Count == 0)
{
_logger.LogWarning("增益设置字典为空或无效");
return false;
}
try
{
var successCount = 0;
var totalCount = gainSettings.Count;
_logger.LogInformation("开始批量设置接收增益,地址: {ComAddr}, 端口数量: {PortCount}", ranEndPoint.ComAddr, totalCount);
foreach (var setting in gainSettings)
{
var port = setting.Key;
var setGain = setting.Value;
var configCommand = $@"{{""message"":""rf"",""rx_gain"":{setGain},""rx_channel_index"":{port}}}";
var command = $"{BuildCommandPrefix(ranEndPoint)} '{configCommand}'";
_logger.LogDebug("设置端口 {Port} 的接收增益值为 {SetGain}", port, setGain);
var result = await ExecuteCommandAsync(command, "接收增益设置");
if (result.IsSuccess)
{
successCount++;
_logger.LogDebug("端口 {Port} 接收增益设置成功,增益值: {SetGain}", port, setGain);
}
else
{
_logger.LogWarning("端口 {Port} 接收增益设置失败,增益值: {SetGain}, 错误: {Error}",
port, setGain, result.Error);
}
}
var allSuccess = successCount == totalCount;
if (allSuccess)
{
_logger.LogInformation("所有端口接收增益设置成功,地址: {ComAddr}, 成功数量: {SuccessCount}/{TotalCount}",
ranEndPoint.ComAddr, successCount, totalCount);
}
else
{
_logger.LogWarning("部分端口接收增益设置失败,地址: {ComAddr}, 成功数量: {SuccessCount}/{TotalCount}",
ranEndPoint.ComAddr, successCount, totalCount);
}
return allSuccess;
}
catch (Exception ex)
{
_logger.LogError(ex, "批量设置接收增益时发生异常,地址: {ComAddr}", ranEndPoint.ComAddr);
return false;
}
}
/// <summary>
/// 设置所有端口的发送增益
/// </summary>
/// <param name="gainValues">所有端口的增益值数组,按端口顺序排列</param>
/// <returns>是否成功设置增益</returns>
public async Task<bool> SetAllTxGainAsync(double[] gainValues)
{
var ranEndPoint = _context.NetworkIPEndPointManager.GetRanEndPoint();
if (!ValidateRanEndPoint(ranEndPoint))
{
_logger.LogWarning("RAN 端点未配置");
return false;
}
if (gainValues == null || gainValues.Length == 0)
{
_logger.LogWarning("增益值数组为空或无效");
return false;
}
try
{
var gainArrayJson = $"[{string.Join(",", gainValues)}]";
var configCommand = $@"{{""message"":""rf"",""tx_gain"":{gainArrayJson}}}";
var command = $"{BuildCommandPrefix(ranEndPoint)} '{configCommand}'";
_logger.LogInformation("开始设置所有端口发送增益,地址: {ComAddr}, 端口数量: {PortCount}, 增益值: {GainValues}",
ranEndPoint.ComAddr, gainValues.Length, string.Join(",", gainValues));
var result = await ExecuteCommandAsync(command, "所有端口发送增益设置");
if (result.IsSuccess)
{
_logger.LogInformation("所有端口发送增益设置成功,地址: {ComAddr}, 端口数量: {PortCount}",
ranEndPoint.ComAddr, gainValues.Length);
return true;
}
else
{
_logger.LogWarning("所有端口发送增益设置失败,地址: {ComAddr}, 端口数量: {PortCount}, 错误: {Error}",
ranEndPoint.ComAddr, gainValues.Length, result.Error);
return false;
}
}
catch (Exception ex)
{
_logger.LogError(ex, "设置所有端口发送增益时发生异常,地址: {ComAddr}, 端口数量: {PortCount}",
ranEndPoint.ComAddr, gainValues?.Length ?? 0);
return false;
}
}
/// <summary>
/// 设置所有端口的接收增益
/// </summary>
/// <param name="gainValues">所有端口的增益值数组,按端口顺序排列</param>
/// <returns>是否成功设置增益</returns>
public async Task<bool> SetAllRxGainAsync(double[] gainValues)
{
var ranEndPoint = _context.NetworkIPEndPointManager.GetRanEndPoint();
if (!ValidateRanEndPoint(ranEndPoint))
{
_logger.LogWarning("RAN 端点未配置");
return false;
}
if (gainValues == null || gainValues.Length == 0)
{
_logger.LogWarning("增益值数组为空或无效");
return false;
}
try
{
var gainArrayJson = $"[{string.Join(",", gainValues)}]";
var configCommand = $@"{{""message"":""rf"",""rx_gain"":{gainArrayJson}}}";
var command = $"{BuildCommandPrefix(ranEndPoint)} '{configCommand}'";
_logger.LogInformation("开始设置所有端口接收增益,地址: {ComAddr}, 端口数量: {PortCount}, 增益值: {GainValues}",
ranEndPoint.ComAddr, gainValues.Length, string.Join(",", gainValues));
var result = await ExecuteCommandAsync(command, "所有端口接收增益设置");
if (result.IsSuccess)
{
_logger.LogInformation("所有端口接收增益设置成功,地址: {ComAddr}, 端口数量: {PortCount}",
ranEndPoint.ComAddr, gainValues.Length);
return true;
}
else
{
_logger.LogWarning("所有端口接收增益设置失败,地址: {ComAddr}, 端口数量: {PortCount}, 错误: {Error}",
ranEndPoint.ComAddr, gainValues.Length, result.Error);
return false;
}
}
catch (Exception ex)
{
_logger.LogError(ex, "设置所有端口接收增益时发生异常,地址: {ComAddr}, 端口数量: {PortCount}",
ranEndPoint.ComAddr, gainValues?.Length ?? 0);
return false;
}
}
#endregion
}

49
CoreAgent.Infrastructure/Handlers/API/RanAPICommandHandlerFactory.cs

@ -0,0 +1,49 @@
using CoreAgent.Domain.Interfaces.Network;
using CoreAgent.Domain.Interfaces.System.Command;
using CoreAgent.Domain.Models.System;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace CoreAgent.Infrastructure.Handlers.API;
/// <summary>
/// RAN API 命令处理器工厂实现
/// 负责创建和管理RAN API命令处理器实例
/// </summary>
public class RanAPICommandHandlerFactory : IRanAPICommandHandlerFactory
{
private readonly ILogger<RanAPICommandHandler> _logger;
private readonly ISystemCommandExecutor _commandExecutor;
private readonly IOptions<AppSettings> _appSettings;
private readonly ICellularNetworkContext _context;
public RanAPICommandHandlerFactory(
ILogger<RanAPICommandHandler> logger,
ISystemCommandExecutor commandExecutor,
IOptions<AppSettings> appSettings,
ICellularNetworkContext context)
{
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_commandExecutor = commandExecutor ?? throw new ArgumentNullException(nameof(commandExecutor));
_appSettings = appSettings ?? throw new ArgumentNullException(nameof(appSettings));
_context = context ?? throw new ArgumentNullException(nameof(context));
}
/// <summary>
/// 创建RAN API命令处理器
/// </summary>
/// <returns>RAN API命令处理器实例</returns>
public IRanAPICommandHandler CreateHandler()
{
return new RanAPICommandHandler(_logger, _commandExecutor, _appSettings, _context);
}
/// <summary>
/// 创建RAN增益控制处理器
/// </summary>
/// <returns>RAN增益控制处理器实例</returns>
public IRanGainControlHandler CreateGainControlHandler()
{
return new RanAPICommandHandler(_logger, _commandExecutor, _appSettings, _context);
}
}

130
CoreAgent.Infrastructure/Services/Common/ServiceScopeManager.cs

@ -0,0 +1,130 @@
using CoreAgent.Domain.Interfaces.Common;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace CoreAgent.Infrastructure.Services.Common;
/// <summary>
/// 服务作用域管理器实现
/// 用于在单例服务中创建瞬时服务
/// </summary>
public class ServiceScopeManager : IServiceScopeManager
{
private readonly IServiceScopeFactory _scopeFactory;
private readonly ILogger<ServiceScopeManager> _logger;
public ServiceScopeManager(
IServiceScopeFactory scopeFactory,
ILogger<ServiceScopeManager> logger)
{
_scopeFactory = scopeFactory ?? throw new ArgumentNullException(nameof(scopeFactory));
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
}
/// <summary>
/// 在作用域中执行异步操作
/// </summary>
/// <typeparam name="T">返回类型</typeparam>
/// <param name="operation">要执行的操作</param>
/// <returns>操作结果</returns>
public async Task<T> ExecuteInScopeAsync<T>(Func<IServiceProvider, Task<T>> operation)
{
if (operation == null)
throw new ArgumentNullException(nameof(operation));
using var scope = _scopeFactory.CreateScope();
var serviceProvider = scope.ServiceProvider;
try
{
_logger.LogDebug("开始在执行作用域中执行异步操作");
var result = await operation(serviceProvider);
_logger.LogDebug("在执行作用域中执行异步操作完成");
return result;
}
catch (Exception ex)
{
_logger.LogError(ex, "在执行作用域中执行异步操作时发生异常");
throw;
}
}
/// <summary>
/// 在作用域中执行异步操作(无返回值)
/// </summary>
/// <param name="operation">要执行的操作</param>
/// <returns>任务</returns>
public async Task ExecuteInScopeAsync(Func<IServiceProvider, Task> operation)
{
if (operation == null)
throw new ArgumentNullException(nameof(operation));
using var scope = _scopeFactory.CreateScope();
var serviceProvider = scope.ServiceProvider;
try
{
_logger.LogDebug("开始在执行作用域中执行异步操作");
await operation(serviceProvider);
_logger.LogDebug("在执行作用域中执行异步操作完成");
}
catch (Exception ex)
{
_logger.LogError(ex, "在执行作用域中执行异步操作时发生异常");
throw;
}
}
/// <summary>
/// 在作用域中执行同步操作
/// </summary>
/// <typeparam name="T">返回类型</typeparam>
/// <param name="operation">要执行的操作</param>
/// <returns>操作结果</returns>
public T ExecuteInScope<T>(Func<IServiceProvider, T> operation)
{
if (operation == null)
throw new ArgumentNullException(nameof(operation));
using var scope = _scopeFactory.CreateScope();
var serviceProvider = scope.ServiceProvider;
try
{
_logger.LogDebug("开始在执行作用域中执行同步操作");
var result = operation(serviceProvider);
_logger.LogDebug("在执行作用域中执行同步操作完成");
return result;
}
catch (Exception ex)
{
_logger.LogError(ex, "在执行作用域中执行同步操作时发生异常");
throw;
}
}
/// <summary>
/// 在作用域中执行同步操作(无返回值)
/// </summary>
/// <param name="operation">要执行的操作</param>
public void ExecuteInScope(Action<IServiceProvider> operation)
{
if (operation == null)
throw new ArgumentNullException(nameof(operation));
using var scope = _scopeFactory.CreateScope();
var serviceProvider = scope.ServiceProvider;
try
{
_logger.LogDebug("开始在执行作用域中执行同步操作");
operation(serviceProvider);
_logger.LogDebug("在执行作用域中执行同步操作完成");
}
catch (Exception ex)
{
_logger.LogError(ex, "在执行作用域中执行同步操作时发生异常");
throw;
}
}
}

91
CoreAgent.Infrastructure/Services/Network/GeneralCellularNetworkService.cs

@ -12,6 +12,9 @@ using CoreAgent.ProtocolClient.Interfaces;
using CoreAgent.ProtocolClient.ProtocolEngineCore;
using CoreAgent.WebSocketTransport.Interfaces;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.DependencyInjection;
using CoreAgent.Domain.Interfaces.Common;
using CoreAgent.Infrastructure.Handlers.API;
namespace CoreAgent.Infrastructure.Services.Network
{
@ -22,19 +25,17 @@ namespace CoreAgent.Infrastructure.Services.Network
{
private readonly ILogger<CellularNetworkService> _logger;
private readonly ILoggerFactory _loggerFactory;
private readonly ISystemCommandExecutor _commandExecutor;
private readonly INetworkConfigurationService _configService;
private readonly ICellularNetworkContext _context;
private readonly INetworkConfigCopier _configCopier;
private readonly INetworkInterfaceManager _interfaceManager;
private readonly INetworkStatusMonitor _statusMonitor;
private readonly IWebSocketTransport _webSocketTransport;
private readonly IProtocolLogObserver _protocolLogObserver;
private readonly IProtocolWsClientManager _protocolWsClientManager;
private readonly IServiceScopeManager _serviceScopeManager;
private readonly IRanAPICommandHandlerFactory _ranAPICommandHandlerFactory;
private static readonly SemaphoreSlim _startLock = new(1, 1);
private const int LockTimeoutSeconds = 60;
public GeneralCellularNetworkService(
ILogger<CellularNetworkService> logger,
ILoggerFactory loggerFactory,
@ -46,19 +47,20 @@ namespace CoreAgent.Infrastructure.Services.Network
INetworkStatusMonitor statusMonitor,
IWebSocketTransport webSocketTransport,
IProtocolLogObserver protocolLogObserver,
IProtocolWsClientManager protocolWsClientManager)
IProtocolWsClientManager protocolWsClientManager,
IServiceScopeManager serviceScopeManager,
IRanAPICommandHandlerFactory ranAPICommandHandlerFactory)
{
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
_commandExecutor = commandExecutor ?? throw new ArgumentNullException(nameof(commandExecutor));
_configService = configService ?? throw new ArgumentNullException(nameof(configService));
_context = context ?? throw new ArgumentNullException(nameof(context));
_configCopier = configCopier ?? throw new ArgumentNullException(nameof(configCopier));
_interfaceManager = interfaceManager ?? throw new ArgumentNullException(nameof(interfaceManager));
_statusMonitor = statusMonitor;
_webSocketTransport = webSocketTransport ?? throw new ArgumentNullException(nameof(webSocketTransport));
_protocolLogObserver = protocolLogObserver ?? throw new ArgumentNullException(nameof(protocolLogObserver));
_protocolWsClientManager = protocolWsClientManager ?? throw new ArgumentNullException(nameof(protocolWsClientManager));
_serviceScopeManager = serviceScopeManager ?? throw new ArgumentNullException(nameof(serviceScopeManager));
_ranAPICommandHandlerFactory = ranAPICommandHandlerFactory ?? throw new ArgumentNullException(nameof(ranAPICommandHandlerFactory));
}
/// <summary>
@ -197,7 +199,7 @@ namespace CoreAgent.Infrastructure.Services.Network
// 只有步骤1成功才继续执行后续步骤
var result = await ExecuteRemainingStepsAsync(config, key, startTime);
// 删除临时配置文件 - 无论成功还是失败都需要执行
var deleteResult = _configCopier.DeleteCellularNetworkConfigurationFile(config);
if (!deleteResult.IsSuccess)
@ -209,7 +211,7 @@ namespace CoreAgent.Infrastructure.Services.Network
{
_logger.LogInformation("临时配置文件删除成功");
}
return result;
}
@ -382,15 +384,14 @@ namespace CoreAgent.Infrastructure.Services.Network
{
return result;
}
var step12Duration = (DateTime.UtcNow - step12Start).TotalMilliseconds;
_logger.LogDebug("步骤12完成:启动所有协议客户端,耗时: {Duration}ms", step12Duration.ToString("F2"));
await SetBcchLogStatusAsync();
var endTime = DateTime.UtcNow;
var duration = endTime - startTime;
_logger.LogInformation("蜂窝网络配置 {ConfigKey} 启动成功,当前状态: {Status},总耗时: {Duration}ms",
key, state.CurrentStatus, duration.TotalMilliseconds.ToString("F2"));
return CellularNetworkOperationResult.Success(state.CurrentStatus);
}
@ -423,7 +424,7 @@ namespace CoreAgent.Infrastructure.Services.Network
try
{
_logger.LogInformation("开始恢复网络状态");
// 1. 关闭WebSocket传输连接
try
{
@ -472,7 +473,7 @@ namespace CoreAgent.Infrastructure.Services.Network
try
{
_logger.LogInformation("开始启动所有协议客户端");
// 获取协议客户端配置
var protocolConfigs = protocolConfigFactory.GetAllConfigs();
if (protocolConfigs == null || protocolConfigs.Length == 0)
@ -481,10 +482,12 @@ namespace CoreAgent.Infrastructure.Services.Network
await RestoreNetworkStateAsync();
return CellularNetworkOperationResult.Failure("没有可用的协议客户端配置");
}
_logger.LogInformation("获取到 {ConfigCount} 个协议客户端配置", protocolConfigs.Length);
_protocolWsClientManager.StartAllClientsAsync(protocolConfigs);
// 启动所有协议客户端
//var startResult = _protocolWsClientManager.CheckAllClientsConnection(10);
//StartAllClients
var startResult = _protocolWsClientManager.StartAllClients(protocolConfigs);
if (!startResult)
{
@ -492,9 +495,9 @@ namespace CoreAgent.Infrastructure.Services.Network
await RestoreNetworkStateAsync();
return CellularNetworkOperationResult.Failure("部分协议客户端启动失败");
}
_logger.LogInformation("所有协议客户端启动完成,开始检查连接状态");
// 检查连接状态(使用默认10秒超时)
var connectionResult = _protocolWsClientManager.CheckAllClientsConnection();
if (!connectionResult)
@ -503,7 +506,7 @@ namespace CoreAgent.Infrastructure.Services.Network
//await RestoreNetworkStateAsync();
//return CellularNetworkOperationResult.Failure("协议客户端连接状态检查失败,部分客户端可能未连接");
}
_logger.LogInformation("所有协议客户端启动并连接成功");
return CellularNetworkOperationResult.Success(NetworkStatus.Connected);
}
@ -515,5 +518,53 @@ namespace CoreAgent.Infrastructure.Services.Network
}
}
/// <summary>
/// 设置BCCH日志状态
/// </summary>
/// <returns>任务</returns>
private async Task SetBcchLogStatusAsync()
{
try
{
// 使用工厂创建处理器实例
var ranApiCommandHandler = _ranAPICommandHandlerFactory.CreateHandler();
// 设置BCCH日志状态为true
_logger.LogInformation("开始设置BCCH日志状态为true");
var setTrueResult = await ranApiCommandHandler.SetBcchLogStatusAsync(true);
if (setTrueResult)
{
_logger.LogInformation("BCCH日志状态设置为true成功");
// 等待200秒
_logger.LogInformation("等待200秒后设置BCCH日志状态为false");
await Task.Delay(TimeSpan.FromMilliseconds(200));
// 设置BCCH日志状态为false
_logger.LogInformation("200秒后开始设置BCCH日志状态为false");
var setFalseResult = await ranApiCommandHandler.SetBcchLogStatusAsync(false);
if (setFalseResult)
{
_logger.LogInformation("BCCH日志状态设置为false成功");
}
else
{
_logger.LogWarning("BCCH日志状态设置为false失败");
}
}
else
{
_logger.LogWarning("BCCH日志状态设置为true失败");
}
}
catch (Exception ex)
{
_logger.LogError(ex, "设置BCCH日志状态时发生异常");
}
}
}
}

5
CoreAgent.Infrastructure/Services/Network/ProtocolClientConfigFactory.cs

@ -150,8 +150,9 @@ namespace CoreAgent.Infrastructure.Services.Network
Ssl = ssl,
Logs = new ProtocolClientLogsConfig
{
Signal = false,
Cch = false,
Signal = model == "RAN" ? true : null,
Cch = model == "RAN" ? true : null,
Bcch = model == "RAN" ? false : null,
Layers = getLayers()
},
Model = model

10
CoreAgent.Infrastructure/Services/Network/ProtocolWsClientManager.cs

@ -125,6 +125,16 @@ namespace CoreAgent.Infrastructure.Services.Network
}
}
/// <summary>
/// 异步启动所有协议客户端
/// </summary>
/// <param name="configs">协议客户端配置数组</param>
/// <returns>异步任务,返回是否所有客户端都成功启动</returns>
public void StartAllClientsAsync(ProtocolClientConfig[] configs)
{
_= Task.Run(() => StartAllClients(configs));
}
/// <summary>
/// 检查所有协议客户端连接状态
/// </summary>

5
CoreAgent.ProtocolClient/Interfaces/IProtocolWsClientManager.cs

@ -15,6 +15,11 @@ namespace CoreAgent.ProtocolClient.Interfaces
/// <returns>是否所有客户端都成功启动</returns>
bool StartAllClients(ProtocolClientConfig[] configs);
/// <summary>
/// 即发即忘"模式
/// </summary>
/// <param name="configs"></param>
void StartAllClientsAsync(ProtocolClientConfig[] configs);
/// <summary>
/// 检查所有协议客户端连接状态
/// </summary>

2
CoreAgent.ProtocolClient/Models/ProtocolClientConfig.cs

@ -79,6 +79,8 @@ namespace CoreAgent.ProtocolClient.Models
/// 是否启用控制信道日志
/// </summary>
public bool? Cch { get; set; }
public bool? Bcch { get; set; }
}

7219
modify.md

File diff suppressed because it is too large
Loading…
Cancel
Save