diff --git a/src/GBNewEnergy.Protocol/Enums/NEInfoType.cs b/src/GBNewEnergy.Protocol/Enums/NEInfoType.cs
index f8cf870..1b614e7 100644
--- a/src/GBNewEnergy.Protocol/Enums/NEInfoType.cs
+++ b/src/GBNewEnergy.Protocol/Enums/NEInfoType.cs
@@ -16,8 +16,9 @@ namespace GBNewEnergy.Protocol.Enums
车辆位置数据=0x05,
极值数据=0x06,
报警数据=0x07,
- 终端数据预留=0x08,
- 平台交换协议自定义数据=0x0A,
+ 可充电储能装置电压数据=0x08,
+ 可充电储能装置温度数据 = 0x09,
+ 平台交换协议自定义数据 =0x0A,
预留=0x30,
用户自定义=0x80
}
diff --git a/src/GBNewEnergy.Protocol/NEBodiesFactory.cs b/src/GBNewEnergy.Protocol/NEBodiesFactory.cs
index e9d0787..56853bf 100644
--- a/src/GBNewEnergy.Protocol/NEBodiesFactory.cs
+++ b/src/GBNewEnergy.Protocol/NEBodiesFactory.cs
@@ -1,42 +1,43 @@
-using GBNewEnergy.Protocol.DownStream;
-using GBNewEnergy.Protocol.Enums;
-using GBNewEnergy.Protocol.UpStream;
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace GBNewEnergy.Protocol
-{
- public class NEBodiesFactory
- {
- ///
- /// 通过命令id获取数据体
- ///
- ///
- ///
- ///
- public static NEBodies GetNEBodiesByMsgId(NEMsgId msgId,byte[] buf, NEGlobalConfigs nEConfigs)
- {
- switch (msgId)
- {
- case NEMsgId.login:
- return new NELoginUpStream(buf, nEConfigs);
- case NEMsgId.loginout:
- return new NELogoutUpStream(buf, nEConfigs);
- case NEMsgId.platformlogin:
- return new NEPlatformLoginUpStream(buf, nEConfigs);
- case NEMsgId.platformlogout:
- return new NEPlatformLogoutUpStream(buf, nEConfigs);
+using GBNewEnergy.Protocol.DownStream;
+using GBNewEnergy.Protocol.Enums;
+using GBNewEnergy.Protocol.UpStream;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GBNewEnergy.Protocol
+{
+ public class NEBodiesFactory
+ {
+ ///
+ /// 通过命令id获取数据体
+ ///
+ ///
+ ///
+ ///
+ public static NEBodies GetNEBodiesByMsgId(NEMsgId msgId,byte[] buf, NEGlobalConfigs nEConfigs)
+ {
+ switch (msgId)
+ {
+ case NEMsgId.login:
+ return new NELoginUpStream(buf, nEConfigs);
+ case NEMsgId.uploadim:
+ return new NERealUploadUpStream(buf, nEConfigs);
+ case NEMsgId.loginout:
+ return new NELogoutUpStream(buf, nEConfigs);
+ case NEMsgId.platformlogin:
+ return new NEPlatformLoginUpStream(buf, nEConfigs);
+ case NEMsgId.platformlogout:
+ return new NEPlatformLogoutUpStream(buf, nEConfigs);
case NEMsgId.control:
- return new NEControlDownStream(buf, nEConfigs);
- case NEMsgId.settings:
- case NEMsgId.heartbeat:
- case NEMsgId.checktime:
- return new CommonUpStream(buf, nEConfigs);
-
- default:
- return null;
- }
- }
- }
-}
+ return new NEControlDownStream(buf, nEConfigs);
+ case NEMsgId.settings:
+ case NEMsgId.heartbeat:
+ case NEMsgId.checktime:
+ return new CommonUpStream(buf, nEConfigs);
+ default:
+ return null;
+ }
+ }
+ }
+}
diff --git a/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadAlarmProperty.cs b/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadAlarmProperty.cs
new file mode 100644
index 0000000..706d3f8
--- /dev/null
+++ b/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadAlarmProperty.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using GBNewEnergy.Protocol.Enums;
+
+namespace GBNewEnergy.Protocol.NEProperties.NEUploadProperties
+{
+ ///
+ /// 报警数据
+ ///
+ public class NEUploadAlarmProperty : NEUploadPropertyBase
+ {
+ public override NEInfoType NEInfoType => NEInfoType.报警数据;
+
+ ///
+ /// 报警等级
+ ///
+ public byte AlarmLevel { get; set; }
+ ///
+ /// 通用报警标志
+ ///
+ public int AlarmBatteryFlag { get; set; }
+ ///
+ /// 报警没变化 0,有报警 1
+ ///
+ public byte AlarmBatteryChanged { get; set; }
+ ///
+ /// 可充电储能装置故障总数
+ ///
+ public byte AlarmBatteryOtherCount { get; set; }
+ ///
+ /// 可充电储能装置故障代码列表
+ ///
+ public List AlarmBatteryOtherList { get; set; } = new List();
+ ///
+ /// 驱动电机故障总数
+ ///
+ public byte AlarmElCount { get; set; }
+ ///
+ /// 驱动电机故障代码列表
+ ///
+ public List AlarmElList { get; set; } = new List();
+ ///
+ /// 发动机故障总数
+ ///
+ public byte AlarmEngineCount { get; set; }
+ ///
+ /// 发动机故障列表
+ ///
+ public ListAlarmEngineList { get; set; } = new List();
+ ///
+ /// 其他故障总数
+ ///
+ public byte AlarmOtherCount { get; set; }
+ ///
+ /// 其他故障代码列表
+ ///
+ public List AlarmOtherList { get; set; } = new List();
+ }
+}
diff --git a/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadEnergyStorageProperty.cs b/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadEnergyStorageProperty.cs
new file mode 100644
index 0000000..0541c0f
--- /dev/null
+++ b/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadEnergyStorageProperty.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using GBNewEnergy.Protocol.Enums;
+
+namespace GBNewEnergy.Protocol.NEProperties.NEUploadProperties
+{
+ ///
+ /// 可充电储能装置电压数据
+ ///
+ public class NEUploadEnergyStorageProperty : NEUploadPropertyBase
+ {
+ public override NEInfoType NEInfoType => NEInfoType.可充电储能装置电压数据;
+
+ ///
+ /// 可充电储能子系统个数
+ ///
+ public byte BatteryAssemblyCount { get; set; }
+
+ ///
+ /// 可充电储能子系统电压信息列表
+ ///
+ public List BatteryAssemblyList { get; set; } = new List();
+
+ ///
+ /// 每个电池总成数据
+ ///
+ public class BatteryAssembly
+ {
+ ///
+ /// 可充电储能子系统号
+ ///
+ public byte BatteryAssemblyNo { get; set; }
+ ///
+ /// 可充电储能装置电压
+ ///
+ public double BatteryAssemblyVoltage { get; set; }
+ ///
+ /// 可充电储能装置电流
+ ///
+ public double BatteryAssemblyCurrent { get; set; }
+ ///
+ /// 单体电池总数
+ ///
+ public int SingleBatteryCount { get; set; }
+ ///
+ /// 本帧起始电池序号
+ ///
+ public int ThisSingleBatteryBeginNo { get; set; }
+ ///
+ /// /本帧单体电池总数
+ ///
+ public int ThisSingleBatteryBeginCount { get; set; }
+ ///
+ /// 单体电池电压
+ ///
+ public List SingleBatteryVoltageList { get; set; } = new List();
+ }
+ }
+}
diff --git a/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadEnergyStorageTemperatureProperty.cs b/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadEnergyStorageTemperatureProperty.cs
new file mode 100644
index 0000000..9302658
--- /dev/null
+++ b/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadEnergyStorageTemperatureProperty.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using GBNewEnergy.Protocol.Enums;
+
+namespace GBNewEnergy.Protocol.NEProperties.NEUploadProperties
+{
+ ///
+ /// 可充电储能装置温度数据
+ ///
+ public class NEUploadEnergyStorageTemperatureProperty : NEUploadPropertyBase
+ {
+ public override NEInfoType NEInfoType => NEInfoType.可充电储能装置温度数据;
+
+ ///
+ /// 动力蓄电池总成个数
+ ///
+ public byte BatteryAssemblyCount { get; set; }
+ ///
+ /// 每个可充电储能子系统温度信息长度
+ ///
+ public List BatteryAssemblyList { get; set; } = new List();
+
+ ///
+ /// 每个动力蓄电池上温度数据
+ ///
+ public class BatteryTemperature
+ {
+ ///
+ /// 可充电储能子系统号
+ ///
+ public byte BatteryAssemblyNo { get; set; }
+ ///
+ /// 可充电储能温度探针个数
+ ///
+ public int TemperatureProbeCount { get; set; }
+ ///
+ /// 可充电储能子系统各温度探针检测到的温度值
+ ///
+ public List TemperatureList { get; set; } = new List();
+ }
+ }
+}
diff --git a/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadProperty.cs b/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadProperty.cs
index 17fdfc9..6cff296 100644
--- a/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadProperty.cs
+++ b/src/GBNewEnergy.Protocol/NEProperties/NEUploadProperties/NEUploadProperty.cs
@@ -1,6 +1,7 @@
using GBNewEnergy.Protocol.Enums;
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Text;
namespace GBNewEnergy.Protocol.NEProperties.NEUploadProperties
@@ -12,6 +13,14 @@ namespace GBNewEnergy.Protocol.NEProperties.NEUploadProperties
{
public string VIN { get ; set; }
-
+ public NEUploadProperty(params NEUploadPropertyBase[] nEUploadPropertyBases)
+ {
+ if (nEUploadPropertyBases != null)
+ {
+ NEUploadPropertys = nEUploadPropertyBases.ToList();
+ }
+ }
+
+ public List NEUploadPropertys { get; set; }
}
}
diff --git a/src/GBNewEnergy.Protocol/UpStream/NERealUploadUpStream.cs b/src/GBNewEnergy.Protocol/UpStream/NERealUploadUpStream.cs
new file mode 100644
index 0000000..e7dabde
--- /dev/null
+++ b/src/GBNewEnergy.Protocol/UpStream/NERealUploadUpStream.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GBNewEnergy.Protocol.UpStream
+{
+ ///
+ /// 实时信息上报
+ ///
+ public class NERealUploadUpStream : NEBodies
+ {
+ public NERealUploadUpStream(byte[] buffer, NEGlobalConfigs nEConfigs) : base(buffer, nEConfigs)
+ {
+ }
+
+ public NERealUploadUpStream(INEProperties nEProperties, NEGlobalConfigs nEConfigs) : base(nEProperties, nEConfigs)
+ {
+ }
+
+ protected override void InitializeProperties(INEProperties nEProperties)
+ {
+ throw new NotImplementedException();
+ }
+
+ protected override void InitializePropertiesFromBuffer()
+ {
+ throw new NotImplementedException();
+ }
+
+ protected override void ToBuffer()
+ {
+ throw new NotImplementedException();
+ }
+ }
+}