|
|
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
|
|
|
|
using System.Xml.Linq;
|
|
|
|
|
using BatCharging.Model;
|
|
|
|
|
using BatCharging.Service.Encoder.New;
|
|
|
|
|
using CommonClass;
|
|
|
|
|
using Module.Socket.Tool;
|
|
|
|
|
using Monitor.LogService;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
@ -19,6 +20,8 @@ namespace BatCharging.Service
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal class ChargerSendMsgUtils
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
PubCommonClass pubCommonClass = new PubCommonClass();
|
|
|
|
|
#region
|
|
|
|
|
#region 充放电启动指令
|
|
|
|
|
|
|
|
|
@ -285,15 +288,31 @@ namespace BatCharging.Service
|
|
|
|
|
/// (CMD=1)后台服务器下发充电桩整形工作参数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send1(TcpClientChargerTool tcp_client)
|
|
|
|
|
/// <param name="type"></param>
|
|
|
|
|
/// <param name="startAddress"></param>
|
|
|
|
|
/// <param name="num"></param>
|
|
|
|
|
/// <param name="setData"></param>
|
|
|
|
|
internal void Send1(TcpClientChargerTool tcp_client, byte type, uint startAddress, byte num, byte[] setData)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1(out APDUModel APDUModel);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
APDUModel APDUModel;
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
CMD1 CMD1 = new CMD1();
|
|
|
|
|
CMD1.value1 = 0;
|
|
|
|
|
CMD1.value2 = 0;
|
|
|
|
|
CMD1.value3 = type;
|
|
|
|
|
CMD1.value4 = startAddress;
|
|
|
|
|
CMD1.value5 = num;
|
|
|
|
|
CMD1.value6 = (ushort)(num * 4);
|
|
|
|
|
CMD1.value7 = setData;
|
|
|
|
|
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1(out APDUModel, CMD1);
|
|
|
|
|
|
|
|
|
|
if (APDUModel != null)
|
|
|
|
|
{
|
|
|
|
|
string result = "后台服务器下发充电桩整形工作参数-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -302,172 +321,282 @@ namespace BatCharging.Service
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send3(TcpClientChargerTool tcp_client)
|
|
|
|
|
internal void Send3(TcpClientChargerTool tcp_client, byte type, uint startAddress, byte[] setData)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD3(out APDUModel APDUModel);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
APDUModel APDUModel;
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
|
|
|
|
|
CMD3 CMD3 = new CMD3();
|
|
|
|
|
CMD3.value1 = 0;
|
|
|
|
|
CMD3.value2 = 0;
|
|
|
|
|
CMD3.value3 = type;
|
|
|
|
|
CMD3.value4 = startAddress;
|
|
|
|
|
CMD3.value5 = pubCommonClass.cmd3StartAddress[startAddress];
|
|
|
|
|
CMD3.value6 = setData;
|
|
|
|
|
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD3(out APDUModel, CMD3);
|
|
|
|
|
|
|
|
|
|
if (APDUModel != null)
|
|
|
|
|
{
|
|
|
|
|
string result = "后台服务器下发充电桩字符型参数-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// 后台服务器下发充电桩控制命令
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send5(TcpClientChargerTool tcp_client)
|
|
|
|
|
/// <param name="chargeMuzzle">充电枪口</param>
|
|
|
|
|
/// <param name="startAddress">启始命令地址</param>
|
|
|
|
|
/// <param name="num">命令个数</param>
|
|
|
|
|
/// <param name="setData">命令参数</param>
|
|
|
|
|
internal void Send5(TcpClientChargerTool tcp_client, byte chargeMuzzle, uint startAddress, byte num, byte[] setData)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD5(out APDUModel APDUModel);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
APDUModel APDUModel;
|
|
|
|
|
|
|
|
|
|
CMD5 CMD = new CMD5();
|
|
|
|
|
CMD.value3 = chargeMuzzle;
|
|
|
|
|
CMD.value4 = startAddress;
|
|
|
|
|
CMD.value5 = num;
|
|
|
|
|
CMD.value6 = (ushort)(num * 4);
|
|
|
|
|
CMD.value7 = setData;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD5(out APDUModel, CMD);
|
|
|
|
|
|
|
|
|
|
if (APDUModel != null)
|
|
|
|
|
{
|
|
|
|
|
string result = "后台服务器下发充电桩控制命令-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// 后台服务器下发充电桩开启充电控制命令
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send7(TcpClientChargerTool tcp_client)
|
|
|
|
|
/// <param name="CMD"></param>
|
|
|
|
|
internal void Send7(TcpClientChargerTool tcp_client, CMD7 CMD)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD7(out APDUModel APDUModel);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
APDUModel APDUModel;
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD7(out APDUModel, CMD);
|
|
|
|
|
if (APDUModel != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
string result = "后台服务器下发充电桩开启充电控制命令-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// 后台服务器应答桩上传命令请求(预留)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send9(TcpClientChargerTool tcp_client)
|
|
|
|
|
/// <param name="chargeMuzzle">充电枪号</param>
|
|
|
|
|
/// <param name="executeResult">执行结果</param>
|
|
|
|
|
/// <param name="address">命令地址</param>
|
|
|
|
|
/// <param name="setData">数据</param>
|
|
|
|
|
internal void Send9(TcpClientChargerTool tcp_client, byte chargeMuzzle, uint executeResult, uint address, byte[] setData)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD9(out APDUModel APDUModel);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
APDUModel APDUModel;
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
CMD9 CMD = new CMD9();
|
|
|
|
|
|
|
|
|
|
CMD.value03 = chargeMuzzle;
|
|
|
|
|
CMD.value04 = executeResult;
|
|
|
|
|
CMD.value05 = address;
|
|
|
|
|
CMD.value06 = 4;
|
|
|
|
|
CMD.value07 = null;
|
|
|
|
|
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD9(out APDUModel, CMD);
|
|
|
|
|
|
|
|
|
|
if (APDUModel != null)
|
|
|
|
|
{
|
|
|
|
|
string result = "后台服务器应答桩上传命令请求(预留)-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 充电桩主动上传数据
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// 服务器应答心跳包信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send101(TcpClientChargerTool tcp_client)
|
|
|
|
|
/// <param name="heartbeatNum">心跳应答</param>
|
|
|
|
|
internal void Send101(TcpClientChargerTool tcp_client, ushort heartbeatNum)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD101(out APDUModel APDUModel);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
APDUModel APDUModel;
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
CMD101 CMD = new CMD101();
|
|
|
|
|
|
|
|
|
|
CMD.value03 = heartbeatNum;
|
|
|
|
|
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD101(out APDUModel, CMD);
|
|
|
|
|
if (APDUModel != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
string result = "服务器应答心跳包信息-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// 服务器应答充电桩状态信息包
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send103(TcpClientChargerTool tcp_client)
|
|
|
|
|
/// <param name="chargeNum">充电口号</param>
|
|
|
|
|
/// <param name="reportMessage">是否立即上报一次104报文 0-否 、1-是</param>
|
|
|
|
|
internal void Send103(TcpClientChargerTool tcp_client, byte chargeNum, bool reportMessage)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD103(out APDUModel APDUModel);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
APDUModel APDUModel;
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
|
|
|
|
|
CMD103 CMD = new CMD103();
|
|
|
|
|
CMD.value03 = chargeNum;
|
|
|
|
|
CMD.value04 = reportMessage;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD103(out APDUModel, CMD);
|
|
|
|
|
if (APDUModel != null)
|
|
|
|
|
{
|
|
|
|
|
string result = "服务器应答充电桩状态信息包-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// 服务器应答充电桩签到命令
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send105(TcpClientChargerTool tcp_client)
|
|
|
|
|
/// <param name="cMD"></param>
|
|
|
|
|
internal void Send105(TcpClientChargerTool tcp_client, CMD105 CMD)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD105(out APDUModel APDUModel);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
APDUModel APDUModel;
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD105(out APDUModel, CMD);
|
|
|
|
|
if (APDUModel != null)
|
|
|
|
|
{
|
|
|
|
|
string result = "服务器应答充电桩签到命令-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// 服务器应答充电桩告警信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send107(TcpClientChargerTool tcp_client)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD107(out APDUModel APDUModel);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
APDUModel APDUModel;
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
CMD107 CMD = new CMD107();
|
|
|
|
|
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD107(out APDUModel, CMD);
|
|
|
|
|
if (APDUModel != null)
|
|
|
|
|
{
|
|
|
|
|
string result = "服务器应答充电桩告警信息-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// 服务器应答充电桩告警信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send109(TcpClientChargerTool tcp_client)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD109(out APDUModel APDUModel);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
APDUModel APDUModel;
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CMD109 CMD = new CMD109();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD109(out APDUModel, CMD);
|
|
|
|
|
if (APDUModel != null)
|
|
|
|
|
{
|
|
|
|
|
string result = "服务器应答充电桩告警信息-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// 服务器应答充电桩上报模块信息(预留)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send111(TcpClientChargerTool tcp_client)
|
|
|
|
|
/// <param name="messageType">报文类型</param>
|
|
|
|
|
internal void Send111(TcpClientChargerTool tcp_client, byte messageType)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD111(out APDUModel APDUModel);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
APDUModel APDUModel;
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
|
|
|
|
|
CMD111 CMD = new CMD111();
|
|
|
|
|
|
|
|
|
|
CMD.value03 = messageType;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD111(out APDUModel, CMD);
|
|
|
|
|
if (APDUModel != null)
|
|
|
|
|
{
|
|
|
|
|
string result = "服务器应答充电桩上报模块信息(预留)-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// 服务器查询最近一次充电各时段信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send113(TcpClientChargerTool tcp_client)
|
|
|
|
|
/// <param name="chargeNum">充电口号</param>
|
|
|
|
|
/// <param name="sign">标志</param>
|
|
|
|
|
internal void Send113(TcpClientChargerTool tcp_client, byte chargeNum, byte sign)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD113(out APDUModel APDUModel);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
APDUModel APDUModel;
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
CMD113 CMD = new CMD113();
|
|
|
|
|
|
|
|
|
|
CMD.value03 = chargeNum;
|
|
|
|
|
CMD.value04 = sign;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD113(out APDUModel, CMD);
|
|
|
|
|
if (APDUModel != null)
|
|
|
|
|
{
|
|
|
|
|
string result = "服务器查询最近一次充电各时段信息-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
@ -728,9 +857,9 @@ namespace BatCharging.Service
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send1103(TcpClientChargerTool tcp_client)
|
|
|
|
|
internal void Send1103(TcpClientChargerTool tcp_client, CMD1103 CMD)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1103(out APDUModel APDUModel);
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1103(out APDUModel APDUModel, CMD);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
@ -742,9 +871,9 @@ namespace BatCharging.Service
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send1105(TcpClientChargerTool tcp_client)
|
|
|
|
|
internal void Send1105(TcpClientChargerTool tcp_client, CMD1105 CMD)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1105(out APDUModel APDUModel);
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1105(out APDUModel APDUModel,CMD);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
@ -774,9 +903,9 @@ namespace BatCharging.Service
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send1301(TcpClientChargerTool tcp_client)
|
|
|
|
|
internal void Send1301(TcpClientChargerTool tcp_client, CMD1301 CMD)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1301(out APDUModel APDUModel);
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1301(out APDUModel APDUModel, CMD);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
@ -790,11 +919,26 @@ namespace BatCharging.Service
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send1401(TcpClientChargerTool tcp_client)
|
|
|
|
|
/// <param name="UpgradeSoftwareFileVersionNum"></param>
|
|
|
|
|
/// <param name="ftpServerIPaddress"></param>
|
|
|
|
|
/// <param name="ftpUserName"></param>
|
|
|
|
|
/// <param name="ftpPassWord"></param>
|
|
|
|
|
/// <param name="ftpDownloadPath"></param>
|
|
|
|
|
/// <param name="executeWay"></param>
|
|
|
|
|
/// <param name="nowUpgradeDeviceType"></param>
|
|
|
|
|
internal void Send1401(TcpClientChargerTool tcp_client, CMD1401 CMD)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1401(out APDUModel APDUModel);
|
|
|
|
|
//CMD1401 CMD = new CMD1401();
|
|
|
|
|
//CMD.reserved1 = 0;
|
|
|
|
|
//CMD.reserved2 = 0;
|
|
|
|
|
//CMD.UpgradeSoftwareFileVersionNum = UpgradeSoftwareFileVersionNum;
|
|
|
|
|
//CMD.ftpServerIPaddress = ftpServerIPaddress;
|
|
|
|
|
//CMD.ftpUserName = ftpUserName;
|
|
|
|
|
//CMD.ftpPassWord = ftpPassWord;
|
|
|
|
|
//CMD.ftpDownloadPath = ftpDownloadPath;
|
|
|
|
|
//CMD.executeWay = executeWay;
|
|
|
|
|
//CMD.nowUpgradeDeviceType = nowUpgradeDeviceType;
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1401(out APDUModel APDUModel, CMD);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
@ -806,9 +950,19 @@ namespace BatCharging.Service
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send1406(TcpClientChargerTool tcp_client)
|
|
|
|
|
internal void Send1406(TcpClientChargerTool tcp_client, CMD1406 CMD)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1406(out APDUModel APDUModel);
|
|
|
|
|
//CMD1406 CMD = new CMD1406();
|
|
|
|
|
//CMD.reserved1 = 0;
|
|
|
|
|
//CMD.reserved2 = 0;
|
|
|
|
|
//CMD.getLogType = 0;
|
|
|
|
|
//CMD.ftpServerIPaddress = null;
|
|
|
|
|
//CMD.ftpUserName = null;
|
|
|
|
|
//CMD.ftpPassWord = null;
|
|
|
|
|
//CMD.ftpSavePath = null;
|
|
|
|
|
//CMD.executeWay = 0;
|
|
|
|
|
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1406(out APDUModel APDUModel, CMD);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
@ -823,12 +977,12 @@ namespace BatCharging.Service
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send1502(TcpClientChargerTool tcp_client )
|
|
|
|
|
internal void Send1502(TcpClientChargerTool tcp_client,ushort responseCode)
|
|
|
|
|
{
|
|
|
|
|
CMD1502 CMD = new CMD1502();
|
|
|
|
|
CMD.reserved1 = 0;
|
|
|
|
|
CMD.reserved2 = 0;
|
|
|
|
|
CMD.responseCode = 0;
|
|
|
|
|
CMD.responseCode = responseCode;
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1502(out APDUModel APDUModel, CMD);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
@ -838,12 +992,36 @@ namespace BatCharging.Service
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client"></param>
|
|
|
|
|
/// <param name="dest_addr"></param>
|
|
|
|
|
/// <param name="respResult"></param>
|
|
|
|
|
internal void Send1504(TcpClientChargerTool tcp_client)
|
|
|
|
|
/// <param name="tcp_client">TCP</param>
|
|
|
|
|
/// <param name="logo">标识</param>
|
|
|
|
|
/// <param name="successReservedMessageNum">已成功接收的报文编号
|
|
|
|
|
/// 这个要与最后一次收到的 1503 报文中的字段 4 一样。</param>
|
|
|
|
|
internal void Send1504(TcpClientChargerTool tcp_client, uint logo,uint successReservedMessageNum)
|
|
|
|
|
{
|
|
|
|
|
CMD1504 CMD = new CMD1504();
|
|
|
|
|
CMD.reserved1 = 0;
|
|
|
|
|
CMD.reserved2 = 0;
|
|
|
|
|
CMD.logo = logo;
|
|
|
|
|
CMD.successReservedMessageNum = successReservedMessageNum;
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1504(out APDUModel APDUModel, CMD);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|
tcp_client.Write(bytes);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// (CMD=5)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tcp_client">TCP</param>
|
|
|
|
|
/// <param name="logo">标识</param>
|
|
|
|
|
/// <param name="successReservedMessageNum">已成功接收的报文编号
|
|
|
|
|
/// 这个要与最后一次收到的 1503 报文中的字段 4 一样。</param>
|
|
|
|
|
internal void Send1506(TcpClientChargerTool tcp_client)
|
|
|
|
|
{
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1504(out APDUModel APDUModel);
|
|
|
|
|
CMD1506 CMD = new CMD1506();
|
|
|
|
|
CMD.value01 = 0;
|
|
|
|
|
CMD.value01 = 0;
|
|
|
|
|
byte[] bytes = new ChargerSendCMD().SendRCMD1506(out APDUModel APDUModel, CMD);
|
|
|
|
|
string result = "站控响应充放电机上报模块状态-发送字节内容:" + ByteUtils.BytesToHexStr(bytes) + ";";
|
|
|
|
|
|
|
|
|
|
Log.LogInstance.WriteLog(result, LogType.Information, "SendLog");
|
|
|
|
|