|
|
|
@ -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
|
|
|
|
@ -823,7 +952,7 @@ 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)
|
|
|
|
|
{
|
|
|
|
|
CMD1502 CMD = new CMD1502();
|
|
|
|
|
CMD.reserved1 = 0;
|
|
|
|
|