From df70f6dd65fb22d091fa225adfd350d938973a62 Mon Sep 17 00:00:00 2001
From: rszn <645583145@qq.com>
Date: Tue, 18 Jun 2024 12:07:42 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=97=A5=E5=BF=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
WebStarter/Controllers/TBoxController.cs | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/WebStarter/Controllers/TBoxController.cs b/WebStarter/Controllers/TBoxController.cs
index c62d436..3a4ecc2 100644
--- a/WebStarter/Controllers/TBoxController.cs
+++ b/WebStarter/Controllers/TBoxController.cs
@@ -22,7 +22,7 @@ public class TBoxController : ControllerBase
[HttpGet("/connect/{carNo}")]
public bool Connect(string carNo)
{
- Log.Info($"Connect-{carNo}");
+ Log.Info($"Connect {carNo}");
TBoxServerMgr.Server.StartSendVin(carNo);
return TBoxServerMgr.Server != null && TBoxServerMgr.Server.Connected;
}
@@ -35,7 +35,7 @@ public class TBoxController : ControllerBase
[HttpGet("/lock/{carNo}")]
public int Lock(string carNo)
{
- Log.Info($"Lock");
+ Log.Info($"Lock {carNo}");
TBoxServerMgr.Server?.StartSendLock(1);
return TBoxServerMgr.Server?.LockStatusMsg?.LockStatus ?? 100;
}
@@ -58,9 +58,9 @@ public class TBoxController : ControllerBase
///
///
[HttpGet("/getCarInfo/{carNo}")]
- public TBoxInfo GetCarInfo()
+ public TBoxInfo GetCarInfo(string carNo)
{
- Log.Info($"Restart");
+ Log.Info($"DisConnect {carNo}");
TBoxInfo result = new TBoxInfo()
{
BatteryOneSn = TBoxServerMgr.Server?.BatteryOneSn,
@@ -92,8 +92,9 @@ public class TBoxController : ControllerBase
[HttpGet("/disConnect/{carNo}")]
public bool DisConnect(string carNo)
{
+ Log.Info($"DisConnect {carNo}");
TBoxServerMgr.Server?.StartSendLock(0);
- return true;
+ return TBoxServerMgr.Server != null && !TBoxServerMgr.Server.Connected;
}
///
@@ -104,6 +105,7 @@ public class TBoxController : ControllerBase
[HttpGet("/reset")]
public bool Reset()
{
+ Log.Info($"Reset ");
TBoxServerMgr.Server?.Reset();
return true;
}