From 9db16bb29f106c61540f09bd606496f7cfe39b0d Mon Sep 17 00:00:00 2001 From: lxw Date: Wed, 19 Jun 2024 14:31:01 +0800 Subject: [PATCH 1/5] =?UTF-8?q?Tbox=E6=95=B4=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Api/Resp/BatteryInfo.cs | 23 +++++ Service/Api/Resp/CarInfo.cs | 26 ++++++ Service/Api/Resp/CarInfoResp.cs | 29 ++++++ Service/Api/Resp/CarStatus.cs | 28 ++++++ Service/Car/Msg/Car/Req/ElecMsg.cs | 23 +++-- Service/TBox/Service/TBoxService.cs | 108 +++++++++++++++++++++++ WebStarter/Controllers/CarController.cs | 43 +++------ WebStarter/Controllers/TBoxController.cs | 31 ++----- WebStarter/Dto/Resp/CarInfoResp.cs | 29 ------ 9 files changed, 244 insertions(+), 96 deletions(-) create mode 100644 Service/Api/Resp/BatteryInfo.cs create mode 100644 Service/Api/Resp/CarInfo.cs create mode 100644 Service/Api/Resp/CarInfoResp.cs create mode 100644 Service/Api/Resp/CarStatus.cs create mode 100644 Service/TBox/Service/TBoxService.cs delete mode 100644 WebStarter/Dto/Resp/CarInfoResp.cs diff --git a/Service/Api/Resp/BatteryInfo.cs b/Service/Api/Resp/BatteryInfo.cs new file mode 100644 index 0000000..e8bce52 --- /dev/null +++ b/Service/Api/Resp/BatteryInfo.cs @@ -0,0 +1,23 @@ +namespace Service.Api.Resp +{ + public class BatteryInfo + { + public string? BatteryNo { get; set; } + + /// + /// 电池类型 + /// + public int? BatteryType { get; set; } + + /// + /// 电池包型号 + /// + public int? BatteryPackageModel { get; set; } + + public float? Soe { get; set; } + + public float? Soc { get; set; } + + public float? Soh { get; set; } + } +} \ No newline at end of file diff --git a/Service/Api/Resp/CarInfo.cs b/Service/Api/Resp/CarInfo.cs new file mode 100644 index 0000000..f06a184 --- /dev/null +++ b/Service/Api/Resp/CarInfo.cs @@ -0,0 +1,26 @@ +namespace Service.Api.Resp; + +public class CarInfo +{ + public string? CarNo { get; set; } + + + public string? CarVin { get; set; } + + + /// + /// 车型数据 "0:无效值1:牵引车 2:搅拌车 3:自卸车" + /// + public byte? CarType { get; set; } + + /// + /// 电池数 + /// + public int BatteryNum { get; set; } + + + /// + /// 车辆电池数据 + /// + public List BatteryInfos { get; set; } +} \ No newline at end of file diff --git a/Service/Api/Resp/CarInfoResp.cs b/Service/Api/Resp/CarInfoResp.cs new file mode 100644 index 0000000..736a39e --- /dev/null +++ b/Service/Api/Resp/CarInfoResp.cs @@ -0,0 +1,29 @@ +using Service.Car.Msg.Car.Req; + +namespace Service.Api.Resp; + +/// +/// 车辆返回 +/// +public class CarInfoResp +{ + public bool Connected { get; set; } + + public string CarNo { get; set; } + + /// + /// 度电数据 + /// + /// + public ElecMsg? ElecMsg { get; set; } + + /// + /// 车辆信息 + /// + public CarInfo? CarInfo { get; set; } + + /// + /// 车辆状态信息 + /// + public CarStatus? CarStatus { get; set; } +} \ No newline at end of file diff --git a/Service/Api/Resp/CarStatus.cs b/Service/Api/Resp/CarStatus.cs new file mode 100644 index 0000000..49da968 --- /dev/null +++ b/Service/Api/Resp/CarStatus.cs @@ -0,0 +1,28 @@ +namespace Service.Api.Resp; + +public class CarStatus +{ + /// + /// 车辆档位 最小值:-1,最大值 14 ,0x0F表示无效,-1 代表倒档 R;0 代表空挡 N;大于 0 代表前进档 D; + /// + public byte? Gear { get; set; } + + /// + /// 刹车状态 "0:未拉手刹1:已拉手刹 其它值无效" + /// + public byte? Break { get; set; } + + /// + /// 钥匙状态 "0:OFF1:ACC ON 2:IG ON 其它值无效" + /// + public byte? Keys { get; set; } + + + /// + /// 0:未解锁未上锁 + /// 1:解锁成功 + /// 2:上锁成功 + /// 3:无效数据 + /// + public byte? LockStatus { get; set; } +} \ No newline at end of file diff --git a/Service/Car/Msg/Car/Req/ElecMsg.cs b/Service/Car/Msg/Car/Req/ElecMsg.cs index 89e8d5a..1756518 100644 --- a/Service/Car/Msg/Car/Req/ElecMsg.cs +++ b/Service/Car/Msg/Car/Req/ElecMsg.cs @@ -4,81 +4,78 @@ namespace Service.Car.Msg.Car.Req; public class ElecMsg : BaseMsg { + /// + /// 小计里程 0~16777215 + /// + public double? SubMile { get; set; } + + /// + /// 车辆总里程 0~16777215 + /// + public double? TotalMile { get; set; } + /// /// 车辆累计放电量 /// - [Property(248, 24, scale: 0.01, round: 2)] public double AccDischargeCount { get; set; } /// /// 车辆累计回馈电量 /// - [Property(272, 24, scale: 0.01, round: 2)] public double AccFallbackCount { get; set; } /// /// 车辆累计插枪充电量 /// - [Property(296, 24, scale: 0.01, round: 2)] public double AccChargeCount { get; set; } /// /// 5 车辆累计综合能耗 /// - [Property(320, 24, scale: 0.01, round: 2)] public double AccKgce { get; set; } /// /// 6 本次实时放电量 /// - [Property(344, 24, scale: 0.01, round: 2)] public double ThisTimeRealDischarge { get; set; } /// /// 7 上一次结算放电量 /// - [Property(368, 24, scale: 0.01, round: 2)] public double LastTimeBalanceDischarge { get; set; } /// /// 8 本次实时回馈电量 /// - [Property(392, 24, scale: 0.01, round: 2)] public double ThisTimeRealFeedbackPower { get; set; } /// /// 9 上一次结算回馈电量 /// - [Property(416, 24, scale: 0.01, round: 2)] public double LastTimeBalanceFeedbackPower { get; set; } /// /// 10 本次实时插枪充电量 /// - [Property(440, 24, scale: 0.01, round: 2)] public double ThisTimeRealChargeCount { get; set; } /// /// 11 上一次结算插枪充电量 /// - [Property(464, 24, scale: 0.01, round: 2)] public double LastTimeBalanceChargeCount { get; set; } /// /// 12 本次实时综合能耗 /// - [Property(488, 24, scale: 0.01, round: 2)] public double ThisTimeRealKgce { get; set; } /// /// 13 上一次结算综合能耗 /// - [Property(512, 24, scale: 0.01, round: 2)] public double LastTimeBalanceKgce { get; set; } /// /// 14 待结算电费电量 /// - [Property(536, 24, scale: 0.01, round: 2)] public double ElectricityToBeSettled { get; set; } } \ No newline at end of file diff --git a/Service/TBox/Service/TBoxService.cs b/Service/TBox/Service/TBoxService.cs new file mode 100644 index 0000000..9ac7071 --- /dev/null +++ b/Service/TBox/Service/TBoxService.cs @@ -0,0 +1,108 @@ +using HybirdFrameworkCore.Utils; +using HybirdFrameworkDriver.Session; +using log4net; +using Service.Api.Resp; +using Service.Car.Msg.Car.Req; +using Service.Car.Server; +using Service.TBox.Msg.TBox; +using Service.TBox.Server; + +namespace Service.TBox.Service; + +public class TBoxService +{ + private static readonly ILog Log = LogManager.GetLogger(typeof(TBoxService)); + + + /// + /// 焕能长治 + /// + /// + /// + public static CarInfoResp GetHnCZCarInfo(string carNo) + { + IoSession? ioSession = CarServerMgr.CarServer?.SessionMgr.GetSession(carNo); + CarInfoResp carInfoResp = new CarInfoResp() + { + Connected = CarServerMgr.CarServer != null && ioSession != null, + CarNo = carNo, + CarInfo = new() + { + CarNo = carNo, + CarVin = carNo, + BatteryNum = 1, + } + }; + + if (ObjUtils.IsNotNull(ioSession)) + { + ioSession.BusinessMap.TryGetValue("ElecMsg", out var elecMsg); + if (elecMsg != null) + { + carInfoResp.ElecMsg = (ElecMsg)elecMsg; + } + + ioSession.BusinessMap.TryGetValue("HeartBeatMsg", out var heartBeatMsg); + if (heartBeatMsg != null) + { + var beatMsg = (HeartBeatMsg)heartBeatMsg; + CarStatus carStatus = new CarStatus(); + carStatus.LockStatus = beatMsg.LockStatus; + carStatus.Keys = beatMsg.KeyStatus; + carInfoResp.CarStatus = carStatus; + } + } + + return carInfoResp; + } + + /// + /// 焕能阳泉 + /// + /// + public static CarInfoResp GetHnYQCarInfo(string carNo) + { + var statusMsg = TBoxServerMgr.Server?.StatusMsg; + BatteryInfo1? batteryInfo1 = TBoxServerMgr.Server?.BatteryInfo1; + StatusMsg? serverStatusMsg = TBoxServerMgr.Server?.StatusMsg; + LockStatusMsg? lockStatusMsg = TBoxServerMgr.Server?.LockStatusMsg; + CarInfoResp carInfoResp = new CarInfoResp() + { + CarNo = carNo, + Connected = TBoxServerMgr.Server != null && TBoxServerMgr.Server.Connected, + CarInfo = new() + { + CarNo = carNo, + CarVin = TBoxServerMgr.Server?.ReadVin(), + BatteryNum = 1, + CarType = statusMsg?.CarType, + BatteryInfos = new List() + { + new() + { + BatteryNo = TBoxServerMgr.Server?.BatteryNo(), + Soc = TBoxServerMgr.Server?.SocMsg?.Soc, + Soe = batteryInfo1?.Soe, + Soh = TBoxServerMgr.Server?.SohMsg.Soh, + BatteryType = batteryInfo1?.TypeCode, + BatteryPackageModel = batteryInfo1?.Reserved1 + } + } + }, + ElecMsg = new() + { + CarNo = carNo, + SubMile = TBoxServerMgr.Server?.SubMileMsg?.SubMile, + TotalMile = TBoxServerMgr.Server?.TotalMileMsg?.TotalMile, + }, + CarStatus = new() + { + Keys = serverStatusMsg?.Keys, + LockStatus = lockStatusMsg?.LockStatus, + Break = serverStatusMsg?.Break, + Gear = serverStatusMsg?.Gear + } + }; + return carInfoResp; + } +} \ No newline at end of file diff --git a/WebStarter/Controllers/CarController.cs b/WebStarter/Controllers/CarController.cs index f21993b..f0f4730 100644 --- a/WebStarter/Controllers/CarController.cs +++ b/WebStarter/Controllers/CarController.cs @@ -5,9 +5,11 @@ using HybirdFrameworkDriver.Session; using log4net; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; +using Service.Api.Resp; using Service.Car.Msg.Car.Req; using Service.Car.Msg.Host.Req; using Service.Car.Server; +using Service.TBox.Service; using WebStarter.Dto.Req; using WebStarter.Dto.Resp; @@ -18,7 +20,8 @@ namespace WebStarter.Controllers; /// [ApiController] [Route("[controller]")] -public class CarController : ControllerBase{ +public class CarController : ControllerBase +{ private static readonly ILog Log = LogManager.GetLogger(typeof(CarController)); /// @@ -28,30 +31,7 @@ public class CarController : ControllerBase{ [HttpGet("getCarInfo/{carNo}")] public CarInfoResp? GetCarInfo(string carNo) { - IoSession? ioSession = CarServerMgr.CarServer?.SessionMgr.GetSession(carNo); - CarInfoResp carInfoResp = new CarInfoResp() - { - Connected = CarServerMgr.CarServer != null && ioSession != null, - CarNo = carNo - }; - - if (ObjUtils.IsNotNull(ioSession)) - { - ioSession.BusinessMap.TryGetValue("ElecMsg", out var elecMsg); - if (elecMsg != null) - { - carInfoResp.ElecMsg = (ElecMsg)elecMsg; - } - - ioSession.BusinessMap.TryGetValue("HeartBeatMsg", out var heartBeatMsg); - if (heartBeatMsg != null) - { - carInfoResp.HeartBeatMsg = (HeartBeatMsg)heartBeatMsg; - } - } - - - return carInfoResp; + return TBoxService.GetHnCZCarInfo(carNo); } @@ -66,7 +46,6 @@ public class CarController : ControllerBase{ List sessionList = CarServerMgr.CarServer?.SessionMgr.GetSessionList(); foreach (var ioSession in sessionList) { - CarInfoResp carInfoResp = new CarInfoResp() { Connected = true, @@ -82,12 +61,16 @@ public class CarController : ControllerBase{ ioSession.BusinessMap.TryGetValue("HeartBeatMsg", out var heartBeatMsg); if (heartBeatMsg != null) { - carInfoResp.HeartBeatMsg = (HeartBeatMsg)heartBeatMsg; + var beatMsg = (HeartBeatMsg)heartBeatMsg; + CarStatus carStatus = new CarStatus(); + carStatus.LockStatus = beatMsg.LockStatus; + carStatus.Keys = beatMsg.KeyStatus; + carInfoResp.CarStatus = carStatus; } result.Add(carInfoResp); - } + return result; } @@ -202,7 +185,7 @@ public class CarController : ControllerBase{ CarServerMgr.CarServer.SetParamMsgPair.Req = setParamMsg; ioSession.Send(setParamMsg); - return CarServerMgr.CarServer.SetParamMsgPair.GetResp(TimeSpan.FromSeconds(5))?.Result ==0; + return CarServerMgr.CarServer.SetParamMsgPair.GetResp(TimeSpan.FromSeconds(5))?.Result == 0; } /// @@ -229,4 +212,4 @@ public class CarController : ControllerBase{ CarServerMgr.CarServer.Clean(); return true; } -} +} \ No newline at end of file diff --git a/WebStarter/Controllers/TBoxController.cs b/WebStarter/Controllers/TBoxController.cs index e2ef006..a60726b 100644 --- a/WebStarter/Controllers/TBoxController.cs +++ b/WebStarter/Controllers/TBoxController.cs @@ -1,6 +1,8 @@ using log4net; using Microsoft.AspNetCore.Mvc; +using Service.Api.Resp; using Service.TBox.Server; +using Service.TBox.Service; using WebStarter.Dto.Resp; namespace WebStarter.Controllers; @@ -58,30 +60,11 @@ public class TBoxController : ControllerBase /// /// [HttpGet("getCarInfo/{carNo}")] - public TBoxInfo GetCarInfo(string carNo) + public CarInfoResp GetCarInfo(string carNo) { - Log.Info($"DisConnect {carNo}"); - TBoxInfo result = new TBoxInfo() - { - BatteryOneSn = TBoxServerMgr.Server?.BatteryOneSn, - BatteryTwoSn = TBoxServerMgr.Server?.BatteryTwoSn, - BatteryThreeSn = TBoxServerMgr.Server?.BatteryThreeSn, - BatteryFourSn = TBoxServerMgr.Server?.BatteryFourSn, - BatteryInfo1 = TBoxServerMgr.Server?.BatteryInfo1, - LockStatusMsg = TBoxServerMgr.Server?.LockStatusMsg, - SocMsg = TBoxServerMgr.Server?.SocMsg, - SohMsg = TBoxServerMgr.Server?.SohMsg, - StatusMsg = TBoxServerMgr.Server?.StatusMsg, - SubMileMsg = TBoxServerMgr.Server?.SubMileMsg, - TotalMileMsg = TBoxServerMgr.Server?.TotalMileMsg, - VersionMsg = TBoxServerMgr.Server?.VersionMsg, - RestartMsg = TBoxServerMgr.Server?.RestartMsg, - Vin = TBoxServerMgr.Server?.ReadVin(), - BatteryNo = TBoxServerMgr.Server?.BatteryNo(), - CarConnected = TBoxServerMgr.Server != null && TBoxServerMgr.Server.Connected, - TBoxConnected = TBoxServerMgr.Server != null - }; - return result; + Log.Info($"getCarInfo {carNo}"); + + return TBoxService.GetHnYQCarInfo(carNo); } @@ -110,4 +93,4 @@ public class TBoxController : ControllerBase TBoxServerMgr.Server?.Reset(); return true; } -} +} \ No newline at end of file diff --git a/WebStarter/Dto/Resp/CarInfoResp.cs b/WebStarter/Dto/Resp/CarInfoResp.cs deleted file mode 100644 index b92b8d9..0000000 --- a/WebStarter/Dto/Resp/CarInfoResp.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Service.Car.Msg.Car.Req; - -namespace WebStarter.Dto.Resp; - -/// -/// 车辆数据 -/// -public class CarInfoResp -{ - /// - /// 连接状态 - /// - public bool Connected { get; set; } - - /// - /// vin码 - /// - public string? CarNo { get; set; } - - /// - /// 度电数据 - /// - public ElecMsg? ElecMsg { get; set; } - - /// - /// 状态数据 - /// - public HeartBeatMsg? HeartBeatMsg { get; set; } -} \ No newline at end of file From e8d7d901d7f2835e8972bc79c49b747af9cb5159 Mon Sep 17 00:00:00 2001 From: lxw Date: Wed, 19 Jun 2024 16:16:22 +0800 Subject: [PATCH 2/5] Tbox v1.0.2 --- WebStarter/Controllers/TBoxController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WebStarter/Controllers/TBoxController.cs b/WebStarter/Controllers/TBoxController.cs index a60726b..e4fecdd 100644 --- a/WebStarter/Controllers/TBoxController.cs +++ b/WebStarter/Controllers/TBoxController.cs @@ -35,11 +35,11 @@ public class TBoxController : ControllerBase /// vin码 /// "0:未解锁未上锁 1:解锁成功 2:上锁成功 3:无效数据 其他状态无效" [HttpGet("lock/{carNo}")] - public int Lock(string carNo) + public bool Lock(string carNo) { Log.Info($"Lock {carNo}"); TBoxServerMgr.Server?.StartSendLock(1); - return TBoxServerMgr.Server?.LockStatusMsg?.LockStatus ?? 100; + return TBoxServerMgr.Server?.LockStatusMsg?.LockStatus==2; } /// @@ -48,11 +48,11 @@ public class TBoxController : ControllerBase /// vin码 /// 发送状态 [HttpGet("unLock/{carNo}")] - public int UnLock(string carNo) + public bool UnLock(string carNo) { Log.Info($"UnLock {carNo}"); TBoxServerMgr.Server?.StartSendLock(2); - return TBoxServerMgr.Server?.LockStatusMsg?.LockStatus ?? 100; + return TBoxServerMgr.Server?.LockStatusMsg?.LockStatus ==1; } /// From a9b36c8c478e9e3bb5782a593cfff59c29fa8352 Mon Sep 17 00:00:00 2001 From: lxw Date: Wed, 19 Jun 2024 17:38:54 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebStarter/Controllers/TBoxController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebStarter/Controllers/TBoxController.cs b/WebStarter/Controllers/TBoxController.cs index e4fecdd..c5b2f1d 100644 --- a/WebStarter/Controllers/TBoxController.cs +++ b/WebStarter/Controllers/TBoxController.cs @@ -26,7 +26,7 @@ public class TBoxController : ControllerBase { Log.Info($"Connect {carNo}"); TBoxServerMgr.Server.StartSendVin(carNo); - return TBoxServerMgr.Server != null && TBoxServerMgr.Server.Connected; + return TBoxServerMgr.Server != null && TBoxServerMgr.Server.BatteryNo()!=null; } /// From f27b840e2c0d98cf2a9119f9428fb19cb0b51af0 Mon Sep 17 00:00:00 2001 From: CZ Date: Wed, 19 Jun 2024 17:46:11 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/TBox/Handler/SocMsgHandler.cs | 3 ++ Service/TBox/Server/TBoxServer.cs | 46 ++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/Service/TBox/Handler/SocMsgHandler.cs b/Service/TBox/Handler/SocMsgHandler.cs index 54fc968..bdb3b3c 100644 --- a/Service/TBox/Handler/SocMsgHandler.cs +++ b/Service/TBox/Handler/SocMsgHandler.cs @@ -3,6 +3,7 @@ using HybirdFrameworkCore.Autofac.Attribute; using log4net; using Newtonsoft.Json; using Service.TBox.Msg.TBox; +using Service.TBox.Server; namespace Service.TBox.Handler; @@ -15,5 +16,7 @@ public class SocMsgHandler : SimpleChannelInboundHandler, IBaseHandler protected override void ChannelRead0(IChannelHandlerContext ctx, SocMsg msg) { Log.Info($"receive SocMsg={JsonConvert.SerializeObject(msg)}"); + var server = TBoxServerMgr.Server; + if (server != null) server.SocMsg = msg; } } diff --git a/Service/TBox/Server/TBoxServer.cs b/Service/TBox/Server/TBoxServer.cs index fb3cb5b..c8d2395 100644 --- a/Service/TBox/Server/TBoxServer.cs +++ b/Service/TBox/Server/TBoxServer.cs @@ -191,7 +191,9 @@ public class TBoxServer : TcpServer public string? BatteryNo() { - byte leng = BatteryOneSn.Length; + #region MyRegion + + /*byte leng = BatteryOneSn.Length; if (leng > 8) { byte[] bytes = new byte[leng]; @@ -229,7 +231,7 @@ public class TBoxServer : TcpServer { bytes[i] = lstByte[i]; } - + if (BatteryOneSn.Sn1 != 0 && BatteryOneSn.Sn2 != 0 && BatteryOneSn.Sn3 != 0 && BatteryOneSn.Sn4 != 0 && BatteryOneSn.Sn5 != 0 && BatteryOneSn.Sn6 != 0 @@ -239,9 +241,45 @@ public class TBoxServer : TcpServer { return Encoding.ASCII.GetString(bytes); } - } + }*/ - return null; + #endregion + + List list = new() + { + BatteryOneSn.Sn1, + BatteryOneSn.Sn2, + BatteryOneSn.Sn3, + BatteryOneSn.Sn4, + BatteryOneSn.Sn5, + BatteryOneSn.Sn6, + BatteryTwoSn.Sn1, + BatteryTwoSn.Sn2, + BatteryTwoSn.Sn3, + BatteryTwoSn.Sn4, + BatteryTwoSn.Sn5, + BatteryTwoSn.Sn6, + }; + var count = list.Where(i => i <= 0).Count(); + if (count > 6) + { + return null; + } + byte[] bytes = new byte[12]; + bytes[0] = BatteryOneSn.Sn1; + bytes[1] = BatteryOneSn.Sn2; + bytes[2] = BatteryOneSn.Sn3; + bytes[3] = BatteryOneSn.Sn4; + bytes[4] = BatteryOneSn.Sn5; + bytes[5] = BatteryOneSn.Sn6; + bytes[6] = BatteryTwoSn.Sn1; + bytes[7] = BatteryTwoSn.Sn2; + bytes[8] = BatteryTwoSn.Sn3; + bytes[9] = BatteryTwoSn.Sn4; + bytes[10] = BatteryTwoSn.Sn5; + bytes[11] = BatteryTwoSn.Sn6; + + return Encoding.ASCII.GetString(bytes); } #endregion From 8cac1769fc3e8a878e3742395c42fa0949b51a3e Mon Sep 17 00:00:00 2001 From: CZ Date: Thu, 20 Jun 2024 15:20:08 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/TBox/Msg/TBox/StatusMsg.cs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Service/TBox/Msg/TBox/StatusMsg.cs b/Service/TBox/Msg/TBox/StatusMsg.cs index 7f2beba..52126ae 100644 --- a/Service/TBox/Msg/TBox/StatusMsg.cs +++ b/Service/TBox/Msg/TBox/StatusMsg.cs @@ -7,41 +7,48 @@ public class StatusMsg : BaseMsg /// /// 车辆档位 最小值:-1,最大值 14 ,0x0F表示无效,-1 代表倒档 R;0 代表空挡 N;大于 0 代表前进档 D; /// - [Property(32,4)] + [Property(32, 4, offset: 1)] public byte Gear { get; set; } + /// /// 刹车状态 "0:未拉手刹1:已拉手刹 其它值无效" /// - [Property(36,2)] + [Property(36, 2)] public byte Break { get; set; } + /// /// 钥匙状态 "0:OFF1:ACC ON 2:IG ON 其它值无效" /// - [Property(38,2)] + [Property(38, 2)] public byte Keys { get; set; } + /// /// 主继电器状态 "0:无效值1:开启 2:闭合" /// - [Property(40,2)] + [Property(40, 2)] public byte MainRelay { get; set; } + /// /// 车型数据 "0:无效值1:牵引车 2:搅拌车 3:自卸车" /// - [Property(42,2)] + [Property(42, 2)] public byte CarType { get; set; } + /// /// 电磁阀驱动状态(预留,默认无效发0) "0:无效值1:开启 2:闭合" /// - [Property(44,2)] + [Property(44, 2)] public byte Solenoid { get; set; } + /// /// 换电车辆不在线标志位 "0:不在线1:在线" /// - [Property(46,2)] + [Property(46, 2)] public byte Online { get; set; } + /// /// Wifi数据转换控制器电源电压故障标志位 "0:无故障1:电压过低 2:电压过高" /// - [Property(48,2)] + [Property(48, 2)] public byte WifiError { get; set; } -} +} \ No newline at end of file