feat: 完成debugger前后端交互

This commit is contained in:
2025-07-29 19:10:21 +08:00
parent 23d4459406
commit 3da0f284f3
5 changed files with 359 additions and 17 deletions

View File

@@ -58,15 +58,20 @@ public class DebuggerController : ControllerBase
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
public async Task<IActionResult> SetMode([FromBody] CaptureMode mode)
public async Task<IActionResult> SetMode(int channelNum, CaptureMode mode)
{
if (channelNum > 0x0F)
{
return BadRequest($"最多只能建立16个通道");
}
try
{
var debugger = GetDebugger();
if (debugger == null)
return BadRequest("用户未绑定有效的实验板");
var result = await debugger.SetMode(mode);
var result = await debugger.SetMode((byte)channelNum, mode);
if (!result.IsSuccessful)
{
logger.Error($"设置捕获模式失败: {result.Error}");