|
|
|
@ -10,6 +10,7 @@ using Newtonsoft.Json;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using DotNetty.Transport.Channels;
|
|
|
|
|
using HybirdFrameworkServices.Netty;
|
|
|
|
|
using HybirdFrameworkServices.Charger.BatCharging.Service;
|
|
|
|
|
|
|
|
|
|
namespace HybirdFrameworkServices
|
|
|
|
|
{
|
|
|
|
@ -100,6 +101,24 @@ namespace HybirdFrameworkServices
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 线程是否启动
|
|
|
|
|
/// </summary>
|
|
|
|
|
private bool _thread_start;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 线程是否启动
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool F_ThreadStart
|
|
|
|
|
{
|
|
|
|
|
get { return _thread_start; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
lock (lockObj)
|
|
|
|
|
{
|
|
|
|
|
_thread_start = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 是否与充电机已经鉴权
|
|
|
|
@ -573,16 +592,7 @@ namespace HybirdFrameworkServices
|
|
|
|
|
|
|
|
|
|
#region 通讯线程
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 充电机心跳线程和断线线程
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void ChargerNetHeartBeatThread()
|
|
|
|
|
{
|
|
|
|
|
Thread chrgConnectedThread = new Thread(ChargerHeartBeatFunc);
|
|
|
|
|
chrgConnectedThread.IsBackground = true;
|
|
|
|
|
chrgConnectedThread.Start();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 充电机判断是否断线线程
|
|
|
|
|
/// 充电机线程启动
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void ChargerNetCheckThread()
|
|
|
|
|
{
|
|
|
|
@ -590,39 +600,31 @@ namespace HybirdFrameworkServices
|
|
|
|
|
chargerThread.IsBackground = true;
|
|
|
|
|
chargerThread.Start();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 充电机的心跳方法
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void ChargerHeartBeatFunc()
|
|
|
|
|
{
|
|
|
|
|
while (F_IsAuthed)
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(2000);
|
|
|
|
|
byte[] bytes = Send101(F_Accumulation);
|
|
|
|
|
|
|
|
|
|
if (Server != null)
|
|
|
|
|
{
|
|
|
|
|
Server.Send(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 充电机判断是否断线线程.充电机在连接情况下,30秒未收到信息,则认为断线,需要重新连接
|
|
|
|
|
/// 读取发送到此充电机的报文
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void ChargerNetCheckFunc()
|
|
|
|
|
{
|
|
|
|
|
while (F_IsAuthed)
|
|
|
|
|
while (F_ThreadStart)
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(2000);
|
|
|
|
|
|
|
|
|
|
DateTime recvTime = DateTime.Now;
|
|
|
|
|
int seconds = Convert.ToInt32(recvTime.Subtract(F_RecvingDataTime).TotalSeconds);
|
|
|
|
|
if (seconds >= _net_check_time_out)
|
|
|
|
|
//if (F_IsAuthed)//是否鉴权
|
|
|
|
|
// if (F_NetConnected)//是否连接
|
|
|
|
|
if (F_NetConnected)//是否连接
|
|
|
|
|
{
|
|
|
|
|
//ChargerDisConnect();
|
|
|
|
|
Thread.Sleep(2000);
|
|
|
|
|
|
|
|
|
|
DateTime recvTime = DateTime.Now;
|
|
|
|
|
int seconds = Convert.ToInt32(recvTime.Subtract(F_RecvingDataTime).TotalSeconds);
|
|
|
|
|
if (seconds >= _net_check_time_out)
|
|
|
|
|
{
|
|
|
|
|
//ChargerDisConnect();
|
|
|
|
|
Server.Disconnect(F_IPAddr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion 通讯线程
|
|
|
|
@ -630,395 +632,422 @@ namespace HybirdFrameworkServices
|
|
|
|
|
#region 数据接收
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void decode(string IP, string port, byte[] data)
|
|
|
|
|
public void decode(byte[] data)
|
|
|
|
|
{
|
|
|
|
|
switch (IP)
|
|
|
|
|
{
|
|
|
|
|
case "1":
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case "2":
|
|
|
|
|
break;
|
|
|
|
|
case "3":
|
|
|
|
|
break;
|
|
|
|
|
case "4":
|
|
|
|
|
break;
|
|
|
|
|
case "5":
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
int func = (ushort)(data[6] + (data[6 + 1] << 8));
|
|
|
|
|
F_RecvingDataTime = DateTime.Now;
|
|
|
|
|
switch (func)
|
|
|
|
|
{
|
|
|
|
|
#region 设置/查询工作参数和命令
|
|
|
|
|
if (func == 106 || F_IsAuthed)
|
|
|
|
|
switch (func)
|
|
|
|
|
{
|
|
|
|
|
#region 设置/查询工作参数和命令
|
|
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
{
|
|
|
|
|
CMD2 CMD2 = ConCMD2(data);
|
|
|
|
|
string result = "(CMD=2)充电桩参数整形设置/查询应答 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=2)充电桩参数整形设置/查询应答对象:" + JsonConvert.SerializeObject(CMD2);
|
|
|
|
|
////Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
case 2:
|
|
|
|
|
{
|
|
|
|
|
CMD2 CMD2 = ConCMD2(data);
|
|
|
|
|
string result = "(CMD=2)充电桩参数整形设置/查询应答 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=2)充电桩参数整形设置/查询应答对象:" + JsonConvert.SerializeObject(CMD2);
|
|
|
|
|
////Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
{
|
|
|
|
|
CMD4 CMD4 = ConCMD4(data);
|
|
|
|
|
string result = "(CMD=4)充电桩参数字符形设置/查询应答 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=4)充电桩参数字符形设置/查询应答对象:" + JsonConvert.SerializeObject(CMD4);
|
|
|
|
|
////Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
{
|
|
|
|
|
CMD4 CMD4 = ConCMD4(data);
|
|
|
|
|
string result = "(CMD=4)充电桩参数字符形设置/查询应答 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=4)充电桩参数字符形设置/查询应答对象:" + JsonConvert.SerializeObject(CMD4);
|
|
|
|
|
////Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
{
|
|
|
|
|
CMD6 CMD6 = ConCMD6(data);
|
|
|
|
|
string result = "(CMD=6)充电桩对后台控制命令应答- 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=6)充电桩对后台控制命令应答对象:" + JsonConvert.SerializeObject(CMD6);
|
|
|
|
|
////Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
{
|
|
|
|
|
CMD6 CMD6 = ConCMD6(data);
|
|
|
|
|
string result = "(CMD=6)充电桩对后台控制命令应答- 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=6)充电桩对后台控制命令应答对象:" + JsonConvert.SerializeObject(CMD6);
|
|
|
|
|
////Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 8:
|
|
|
|
|
{
|
|
|
|
|
CMD8 CMD8 = ConCMD8(data);
|
|
|
|
|
string result = "(CMD=8) 充电桩对后台下发的充电桩开启充电控制应答 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=8) 充电桩对后台下发的充电桩开启充电控制应答对象:" + JsonConvert.SerializeObject(CMD8);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 8:
|
|
|
|
|
{
|
|
|
|
|
CMD8 CMD8 = ConCMD8(data);
|
|
|
|
|
string result = "(CMD=8) 充电桩对后台下发的充电桩开启充电控制应答 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=8) 充电桩对后台下发的充电桩开启充电控制应答对象:" + JsonConvert.SerializeObject(CMD8);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 10:
|
|
|
|
|
{
|
|
|
|
|
CMD10 CMD10 = ConCMD10(data);
|
|
|
|
|
string result = "(CMD=10)充电桩上传命令请求(预留) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩上传命令请求(预留)对象:" + JsonConvert.SerializeObject(CMD10);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 10:
|
|
|
|
|
{
|
|
|
|
|
CMD10 CMD10 = ConCMD10(data);
|
|
|
|
|
string result = "(CMD=10)充电桩上传命令请求(预留) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩上传命令请求(预留)对象:" + JsonConvert.SerializeObject(CMD10);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 充电桩主动上传数据
|
|
|
|
|
#region 充电桩主动上传数据
|
|
|
|
|
|
|
|
|
|
case 102:
|
|
|
|
|
{
|
|
|
|
|
CMD102 CMD102 = ConCMD102(data);
|
|
|
|
|
string result = "(CMD=10)充电桩上传心跳包信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩上传心跳包信息对象:" + JsonConvert.SerializeObject(CMD102);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
HeartBeatProcessCounter += 1;
|
|
|
|
|
byte[] bytes = Send101(HeartBeatProcessCounter);
|
|
|
|
|
|
|
|
|
|
if (Server != null)
|
|
|
|
|
case 102:
|
|
|
|
|
{
|
|
|
|
|
Server.Send(bytes);
|
|
|
|
|
CMD102 CMD102 = ConCMD102(data);
|
|
|
|
|
string result = "(CMD=10)充电桩上传心跳包信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩上传心跳包信息对象:" + JsonConvert.SerializeObject(CMD102);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
HeartBeatProcessCounter += 1;
|
|
|
|
|
byte[] bytes = Send101(HeartBeatProcessCounter);
|
|
|
|
|
|
|
|
|
|
if (Server != null)
|
|
|
|
|
{
|
|
|
|
|
Send(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 104:
|
|
|
|
|
{
|
|
|
|
|
CMD104 CMD104 = ConCMD104(data);
|
|
|
|
|
string result = "(CMD=10)充电桩状态信息包上报 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩状态信息包上报对象:" + JsonConvert.SerializeObject(CMD104);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
break;
|
|
|
|
|
case 104:
|
|
|
|
|
{
|
|
|
|
|
CMD104 CMD104 = ConCMD104(data);
|
|
|
|
|
string result = "(CMD=10)充电桩状态信息包上报 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩状态信息包上报对象:" + JsonConvert.SerializeObject(CMD104);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 106:
|
|
|
|
|
{
|
|
|
|
|
CMD106 CMD106 = ConCMD106(data);
|
|
|
|
|
string result = "(CMD=10)充电桩签到信息上报 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩签到信息上报对象:" + JsonConvert.SerializeObject(CMD106);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
if (CMD106 != null)
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 106:
|
|
|
|
|
//106签到鉴权
|
|
|
|
|
{
|
|
|
|
|
F_EqmCode = CMD106.ASCIINum;
|
|
|
|
|
F_Sign = CMD106.Sign == 1 ? true : false;
|
|
|
|
|
F_IsAuthed = true;
|
|
|
|
|
CMD106 CMD106 = ConCMD106(data);
|
|
|
|
|
string result = "(CMD=10)充电桩签到信息上报 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩签到信息上报对象:" + JsonConvert.SerializeObject(CMD106);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
if (CMD106 != null)
|
|
|
|
|
{
|
|
|
|
|
//回复106签到报文
|
|
|
|
|
{
|
|
|
|
|
F_EqmCode = CMD106.ASCIINum;
|
|
|
|
|
F_Sign = CMD106.Sign == 1 ? true : false;
|
|
|
|
|
F_IsAuthed = true;
|
|
|
|
|
CMD105 CMD = new CMD105();
|
|
|
|
|
CMD.NumResponse = (uint)new Random().Next();
|
|
|
|
|
CMD.LoginVerify = 0;
|
|
|
|
|
CMD.EncryptionFlag = 0;
|
|
|
|
|
CMD.RSAComModule = "";
|
|
|
|
|
CMD.RSAComSecret = 0;
|
|
|
|
|
CMD.RSAComSecret = 0;
|
|
|
|
|
CMD.StSign = 0;
|
|
|
|
|
CMD.BCDTime = (ulong)BcdTimeConverter.ConvertToBcdTime(DateTime.Now);
|
|
|
|
|
CMD.MessageUpload = 0;
|
|
|
|
|
CMD.AESSecretKey = "";
|
|
|
|
|
|
|
|
|
|
byte[] bytes = Send105(CMD);
|
|
|
|
|
|
|
|
|
|
if (Server != null)
|
|
|
|
|
{
|
|
|
|
|
Server.Send(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//CMD3对时报文
|
|
|
|
|
{
|
|
|
|
|
byte type = 1;//0-查询 1-设置
|
|
|
|
|
uint startAddress = 2;//设置/查询参数启始地址
|
|
|
|
|
|
|
|
|
|
byte[] setData = new byte[8];//设置数据
|
|
|
|
|
setData = BcdTimeConverter.ConvertToBcdTimeByte(DateTime.Now);
|
|
|
|
|
byte[] bytes = Send3(type, startAddress, setData);
|
|
|
|
|
|
|
|
|
|
if (Server != null)
|
|
|
|
|
{
|
|
|
|
|
Server.Send(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 108:
|
|
|
|
|
{
|
|
|
|
|
CMD108 CMD108 = ConCMD108(data);
|
|
|
|
|
string result = "(CMD=10)充电桩告警信息上报(预留) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩告警信息上报(预留)对象:" + JsonConvert.SerializeObject(CMD108);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
break;
|
|
|
|
|
case 108:
|
|
|
|
|
{
|
|
|
|
|
CMD108 CMD108 = ConCMD108(data);
|
|
|
|
|
string result = "(CMD=10)充电桩告警信息上报(预留) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩告警信息上报(预留)对象:" + JsonConvert.SerializeObject(CMD108);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 110:
|
|
|
|
|
{
|
|
|
|
|
CMD110 CMD110 = ConCMD110(data);
|
|
|
|
|
string result = "(CMD=10)充电桩上报充电启动完成命令(预留) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩上报充电启动完成命令(预留)对象:" + JsonConvert.SerializeObject(CMD110);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 110:
|
|
|
|
|
{
|
|
|
|
|
CMD110 CMD110 = ConCMD110(data);
|
|
|
|
|
string result = "(CMD=10)充电桩上报充电启动完成命令(预留) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩上报充电启动完成命令(预留)对象:" + JsonConvert.SerializeObject(CMD110);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 112:
|
|
|
|
|
{
|
|
|
|
|
CMD112 CMD112 = ConCMD112(data);
|
|
|
|
|
string result = "(CMD=10)充电桩模块信息上报(预留) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩模块信息上报对象:" + JsonConvert.SerializeObject(CMD112);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 114:
|
|
|
|
|
{
|
|
|
|
|
CMD114 CMD114 = ConCMD114(data);
|
|
|
|
|
string result = "(CMD=10)充电桩应答服务器查询最近一次充电各时段信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩应答服务器查询最近一次充电各时段信息对象:" + JsonConvert.SerializeObject(CMD114);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 112:
|
|
|
|
|
{
|
|
|
|
|
CMD112 CMD112 = ConCMD112(data);
|
|
|
|
|
string result = "(CMD=10)充电桩模块信息上报(预留) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩模块信息上报对象:" + JsonConvert.SerializeObject(CMD112);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 114:
|
|
|
|
|
{
|
|
|
|
|
CMD114 CMD114 = ConCMD114(data);
|
|
|
|
|
string result = "(CMD=10)充电桩应答服务器查询最近一次充电各时段信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩应答服务器查询最近一次充电各时段信息对象:" + JsonConvert.SerializeObject(CMD114);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 充电信息数据
|
|
|
|
|
#region 充电信息数据
|
|
|
|
|
|
|
|
|
|
case 202:
|
|
|
|
|
case 222:
|
|
|
|
|
{
|
|
|
|
|
CMD202 CMD202 = ConCMD202((UInt16)func, data);
|
|
|
|
|
string result = "充电桩上报充电记录信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "上报充电记录信息对象:" + JsonConvert.SerializeObject(CMD202);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 204:
|
|
|
|
|
{
|
|
|
|
|
CMD204 CMD204 = ConCMD204(data);
|
|
|
|
|
string result = "充电桩充电上传用户账户查询报文 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩充电上传用户账户查询报文对象:" + JsonConvert.SerializeObject(CMD204);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
case 202:
|
|
|
|
|
case 222:
|
|
|
|
|
{
|
|
|
|
|
CMD202 CMD202 = ConCMD202((UInt16)func, data);
|
|
|
|
|
string result = "充电桩上报充电记录信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "上报充电记录信息对象:" + JsonConvert.SerializeObject(CMD202);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 204:
|
|
|
|
|
{
|
|
|
|
|
CMD204 CMD204 = ConCMD204(data);
|
|
|
|
|
string result = "充电桩充电上传用户账户查询报文 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩充电上传用户账户查询报文对象:" + JsonConvert.SerializeObject(CMD204);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 206:
|
|
|
|
|
{
|
|
|
|
|
CMD206 CMD206 = ConCMD206(data);
|
|
|
|
|
string result = "充电桩充电上传用户密码验证报文 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩充电上传用户密码验证报文对象:" + JsonConvert.SerializeObject(CMD206);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 208:
|
|
|
|
|
{
|
|
|
|
|
CMD208 CMD208 = ConCMD208(data);
|
|
|
|
|
string result = "充电桩上报“即插即充”启动充电请求 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩上报“即插即充”启动充电请求对象:" + JsonConvert.SerializeObject(CMD208);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 210:
|
|
|
|
|
{
|
|
|
|
|
CMD210 CMD210 = ConCMD210(data);
|
|
|
|
|
string result = "充电桩上报“即插即充”启动充电结果 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩上报“即插即充”启动充电结果:" + JsonConvert.SerializeObject(CMD210);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 206:
|
|
|
|
|
{
|
|
|
|
|
CMD206 CMD206 = ConCMD206(data);
|
|
|
|
|
string result = "充电桩充电上传用户密码验证报文 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩充电上传用户密码验证报文对象:" + JsonConvert.SerializeObject(CMD206);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 208:
|
|
|
|
|
{
|
|
|
|
|
CMD208 CMD208 = ConCMD208(data);
|
|
|
|
|
string result = "充电桩上报“即插即充”启动充电请求 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩上报“即插即充”启动充电请求对象:" + JsonConvert.SerializeObject(CMD208);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 210:
|
|
|
|
|
{
|
|
|
|
|
CMD210 CMD210 = ConCMD210(data);
|
|
|
|
|
string result = "充电桩上报“即插即充”启动充电结果 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩上报“即插即充”启动充电结果:" + JsonConvert.SerializeObject(CMD210);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 直流充电桩 BMS 信息数据(预留)
|
|
|
|
|
case 302:
|
|
|
|
|
{
|
|
|
|
|
CMD302 CMD302 = ConCMD302(data);
|
|
|
|
|
string result = "充电桩上报BMS信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩上报BMS信息对象:" + JsonConvert.SerializeObject(CMD302);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 304:
|
|
|
|
|
{
|
|
|
|
|
CMD304 CMD304 = ConCMD304(data);
|
|
|
|
|
string result = "充电桩上报BMS信息(预留-暂时不用) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩上报BMS信息(预留-暂时不用)对象:" + JsonConvert.SerializeObject(CMD304);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
#region 直流充电桩 BMS 信息数据(预留)
|
|
|
|
|
case 302:
|
|
|
|
|
{
|
|
|
|
|
CMD302 CMD302 = ConCMD302(data);
|
|
|
|
|
string result = "充电桩上报BMS信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩上报BMS信息对象:" + JsonConvert.SerializeObject(CMD302);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 304:
|
|
|
|
|
{
|
|
|
|
|
CMD304 CMD304 = ConCMD304(data);
|
|
|
|
|
string result = "充电桩上报BMS信息(预留-暂时不用) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩上报BMS信息(预留-暂时不用)对象:" + JsonConvert.SerializeObject(CMD304);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 历史记录
|
|
|
|
|
case 402:
|
|
|
|
|
case 422:
|
|
|
|
|
{
|
|
|
|
|
CMD402 CMD402 = ConCMD402((UInt16)func, data);
|
|
|
|
|
string result = "充电桩上报历史的充电记录 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩上报历史的充电记录:" + JsonConvert.SerializeObject(CMD402);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
#region 历史记录
|
|
|
|
|
case 402:
|
|
|
|
|
case 422:
|
|
|
|
|
{
|
|
|
|
|
CMD402 CMD402 = ConCMD402((UInt16)func, data);
|
|
|
|
|
string result = "充电桩上报历史的充电记录 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩上报历史的充电记录:" + JsonConvert.SerializeObject(CMD402);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 升级命令
|
|
|
|
|
case 1002:
|
|
|
|
|
{
|
|
|
|
|
CMD1002 CMD1002 = ConCMD1002(data);
|
|
|
|
|
string result = "充电桩回复服务器下发擦除指令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩回复服务器下发擦除指令对象:" + JsonConvert.SerializeObject(CMD1002);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1004:
|
|
|
|
|
{
|
|
|
|
|
CMD1004 CMD1004 = ConCMD1004(data);
|
|
|
|
|
string result = "充电桩应答服务器下发升级文件名指令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发升级文件名指令对象:" + JsonConvert.SerializeObject(CMD1004);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1006:
|
|
|
|
|
{
|
|
|
|
|
CMD1006 CMD1006 = ConCMD1006(data);
|
|
|
|
|
string result = "充电桩应答服务器下发升级文件大小指令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发升级文件大小指令对象:" + JsonConvert.SerializeObject(CMD1006);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1008:
|
|
|
|
|
{
|
|
|
|
|
CMD1008 CMD1008 = ConCMD1008(data);
|
|
|
|
|
string result = "充电桩应答服务器下发升级文件数据指令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发升级文件数据指令对象:" + JsonConvert.SerializeObject(CMD1008);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1010:
|
|
|
|
|
{
|
|
|
|
|
CMD1010 CMD1010 = ConCMD1010(data);
|
|
|
|
|
string result = "充电桩应答服务器下发升级文件数据结束指令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发升级文件数据结束指令对象:" + JsonConvert.SerializeObject(CMD1010);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1012:
|
|
|
|
|
{
|
|
|
|
|
CMD1012 CMD1012 = ConCMD1012(data);
|
|
|
|
|
string result = "充电桩应答服务器下发重启指令- 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发重启指令对象:" + JsonConvert.SerializeObject(CMD1012);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1022:
|
|
|
|
|
{
|
|
|
|
|
CMD1022 CMD1022 = ConCMD1022(data);
|
|
|
|
|
string result = "充电桩主动请求升级命令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩主动请求升级命令对象:" + JsonConvert.SerializeObject(CMD1022);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
#region 升级命令
|
|
|
|
|
case 1002:
|
|
|
|
|
{
|
|
|
|
|
CMD1002 CMD1002 = ConCMD1002(data);
|
|
|
|
|
string result = "充电桩回复服务器下发擦除指令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩回复服务器下发擦除指令对象:" + JsonConvert.SerializeObject(CMD1002);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1004:
|
|
|
|
|
{
|
|
|
|
|
CMD1004 CMD1004 = ConCMD1004(data);
|
|
|
|
|
string result = "充电桩应答服务器下发升级文件名指令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发升级文件名指令对象:" + JsonConvert.SerializeObject(CMD1004);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1006:
|
|
|
|
|
{
|
|
|
|
|
CMD1006 CMD1006 = ConCMD1006(data);
|
|
|
|
|
string result = "充电桩应答服务器下发升级文件大小指令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发升级文件大小指令对象:" + JsonConvert.SerializeObject(CMD1006);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1008:
|
|
|
|
|
{
|
|
|
|
|
CMD1008 CMD1008 = ConCMD1008(data);
|
|
|
|
|
string result = "充电桩应答服务器下发升级文件数据指令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发升级文件数据指令对象:" + JsonConvert.SerializeObject(CMD1008);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1010:
|
|
|
|
|
{
|
|
|
|
|
CMD1010 CMD1010 = ConCMD1010(data);
|
|
|
|
|
string result = "充电桩应答服务器下发升级文件数据结束指令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发升级文件数据结束指令对象:" + JsonConvert.SerializeObject(CMD1010);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1012:
|
|
|
|
|
{
|
|
|
|
|
CMD1012 CMD1012 = ConCMD1012(data);
|
|
|
|
|
string result = "充电桩应答服务器下发重启指令- 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发重启指令对象:" + JsonConvert.SerializeObject(CMD1012);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1022:
|
|
|
|
|
{
|
|
|
|
|
CMD1022 CMD1022 = ConCMD1022(data);
|
|
|
|
|
string result = "充电桩主动请求升级命令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩主动请求升级命令对象:" + JsonConvert.SerializeObject(CMD1022);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 与计费策略相关的指令
|
|
|
|
|
case 1102:
|
|
|
|
|
{
|
|
|
|
|
CMD1102 CMD1102 = ConCMD1102(data);
|
|
|
|
|
string result = "充电桩应答后台服务器查询24时电费计价策略信息- 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答后台服务器查询24时电费计价策略信息对象:" + JsonConvert.SerializeObject(CMD1102);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1104:
|
|
|
|
|
{
|
|
|
|
|
CMD1104 CMD1104 = ConCMD1104(data);
|
|
|
|
|
string result = "充电桩应答后台服务器设置24时电费计价策略信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答后台服务器设置24时电费计价策略信息对象:" + JsonConvert.SerializeObject(CMD1104);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1106:
|
|
|
|
|
{
|
|
|
|
|
CMD1106 CMD1106 = ConCMD1106(data);
|
|
|
|
|
string result = "充电桩应答后台服务器设置分时段计价策略信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答后台服务器设置分时段计价策略信息对象:" + JsonConvert.SerializeObject(CMD1106);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1108:
|
|
|
|
|
{
|
|
|
|
|
CMD1108 CMD1108 = ConCMD1108(data);
|
|
|
|
|
string result = "充电桩回复分时电费计价策略信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩回复分时电费计价策略信息对象:" + JsonConvert.SerializeObject(CMD1108);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
#region 与计费策略相关的指令
|
|
|
|
|
case 1102:
|
|
|
|
|
{
|
|
|
|
|
CMD1102 CMD1102 = ConCMD1102(data);
|
|
|
|
|
string result = "充电桩应答后台服务器查询24时电费计价策略信息- 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答后台服务器查询24时电费计价策略信息对象:" + JsonConvert.SerializeObject(CMD1102);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1104:
|
|
|
|
|
{
|
|
|
|
|
CMD1104 CMD1104 = ConCMD1104(data);
|
|
|
|
|
string result = "充电桩应答后台服务器设置24时电费计价策略信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答后台服务器设置24时电费计价策略信息对象:" + JsonConvert.SerializeObject(CMD1104);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1106:
|
|
|
|
|
{
|
|
|
|
|
CMD1106 CMD1106 = ConCMD1106(data);
|
|
|
|
|
string result = "充电桩应答后台服务器设置分时段计价策略信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答后台服务器设置分时段计价策略信息对象:" + JsonConvert.SerializeObject(CMD1106);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1108:
|
|
|
|
|
{
|
|
|
|
|
CMD1108 CMD1108 = ConCMD1108(data);
|
|
|
|
|
string result = "充电桩回复分时电费计价策略信息 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩回复分时电费计价策略信息对象:" + JsonConvert.SerializeObject(CMD1108);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 白名单报文
|
|
|
|
|
case 1302:
|
|
|
|
|
{
|
|
|
|
|
CMD1302 CMD1302 = ConCMD1302(data);
|
|
|
|
|
string result = "充电桩应答白名单操作日志数据包 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答白名单操作日志数据包对象:" + JsonConvert.SerializeObject(CMD1302);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
#region 白名单报文
|
|
|
|
|
case 1302:
|
|
|
|
|
{
|
|
|
|
|
CMD1302 CMD1302 = ConCMD1302(data);
|
|
|
|
|
string result = "充电桩应答白名单操作日志数据包 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答白名单操作日志数据包对象:" + JsonConvert.SerializeObject(CMD1302);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region FTP远程升级和FTP方式日志上传
|
|
|
|
|
case 1402:
|
|
|
|
|
{
|
|
|
|
|
CMD1402 CMD1402 = ConCMD1402(data);
|
|
|
|
|
string result = "充电桩应答服务器下发FTP远程升级命令- 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发FTP远程升级命令对象:" + JsonConvert.SerializeObject(CMD1402);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1403:
|
|
|
|
|
{
|
|
|
|
|
CMD1403 CMD1403 = ConCMD1403(data);
|
|
|
|
|
string result = "充电桩应答FTP升级包下载进度 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答FTP升级包下载进度对象:" + JsonConvert.SerializeObject(CMD1403);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1407:
|
|
|
|
|
{
|
|
|
|
|
CMD1407 CMD1407 = ConCMD1407(data);
|
|
|
|
|
string result = "充电桩应答服务器下发获取充电桩日志命令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发获取充电桩日志命令对象:" + JsonConvert.SerializeObject(CMD1407);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
#region FTP远程升级和FTP方式日志上传
|
|
|
|
|
case 1402:
|
|
|
|
|
{
|
|
|
|
|
CMD1402 CMD1402 = ConCMD1402(data);
|
|
|
|
|
string result = "充电桩应答服务器下发FTP远程升级命令- 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发FTP远程升级命令对象:" + JsonConvert.SerializeObject(CMD1402);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1403:
|
|
|
|
|
{
|
|
|
|
|
CMD1403 CMD1403 = ConCMD1403(data);
|
|
|
|
|
string result = "充电桩应答FTP升级包下载进度 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答FTP升级包下载进度对象:" + JsonConvert.SerializeObject(CMD1403);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1407:
|
|
|
|
|
{
|
|
|
|
|
CMD1407 CMD1407 = ConCMD1407(data);
|
|
|
|
|
string result = "充电桩应答服务器下发获取充电桩日志命令 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "充电桩应答服务器下发获取充电桩日志命令对象:" + JsonConvert.SerializeObject(CMD1407);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 协议方式日志上传
|
|
|
|
|
case 1501:
|
|
|
|
|
{
|
|
|
|
|
CMD1501 CMD1501 = ConCMD1501(data);
|
|
|
|
|
string result = "(CMD=1501)申请上传文件 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=1501)申请上传文件对象:" + JsonConvert.SerializeObject(CMD1501);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1503:
|
|
|
|
|
{
|
|
|
|
|
CMD1503 CMD1503 = ConCMD1503(data);
|
|
|
|
|
string result = "(CMD=10)充电桩上传命令请求(预留) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩上传命令请求(预留)对象:" + JsonConvert.SerializeObject(CMD1503);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
#region 协议方式日志上传
|
|
|
|
|
case 1501:
|
|
|
|
|
{
|
|
|
|
|
CMD1501 CMD1501 = ConCMD1501(data);
|
|
|
|
|
string result = "(CMD=1501)申请上传文件 - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=1501)申请上传文件对象:" + JsonConvert.SerializeObject(CMD1501);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1503:
|
|
|
|
|
{
|
|
|
|
|
CMD1503 CMD1503 = ConCMD1503(data);
|
|
|
|
|
string result = "(CMD=10)充电桩上传命令请求(预留) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩上传命令请求(预留)对象:" + JsonConvert.SerializeObject(CMD1503);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1505://接收完成,要保存关闭
|
|
|
|
|
{
|
|
|
|
|
CMD1505 CMD1505 = ConCMD1505(data);
|
|
|
|
|
string result = "(CMD=10)充电桩上传命令请求(预留) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩上传命令请求(预留)对象:" + JsonConvert.SerializeObject(CMD1505);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1505://接收完成,要保存关闭
|
|
|
|
|
{
|
|
|
|
|
CMD1505 CMD1505 = ConCMD1505(data);
|
|
|
|
|
string result = "(CMD=10)充电桩上传命令请求(预留) - 接收字节内容:" + ByteUtils.BytesToHexStr(data) + ";";
|
|
|
|
|
result += "\r\n" + "(CMD=10)充电桩上传命令请求(预留)对象:" + JsonConvert.SerializeObject(CMD1505);
|
|
|
|
|
//Log.LogInstance.WriteLog(result, LogType.Information, "Charger" + "充电机编码");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion 数据接收
|
|
|
|
|
|
|
|
|
|
#region 数据发送
|
|
|
|
|
public void Send(byte[] bytes)
|
|
|
|
|
{
|
|
|
|
|
Server.Send(bytes, ID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 服务器向充电桩设置/查询工作参数和命令
|
|
|
|
|
/// <summary>
|
|
|
|
|