充电机发送CMD1_CMD113Merge branch 'master' of http://180.76.133.253:16300/cz/CDJ

master
CZ 8 months ago committed by lch
commit d45b0bd4fe

File diff suppressed because it is too large Load Diff

@ -1,10 +1,4 @@
using System; using System.Xml.Linq;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using BatCharging.Model; using BatCharging.Model;
using BatCharging.Service.Encoder.New; using BatCharging.Service.Encoder.New;
using CommonClass; using CommonClass;
@ -297,8 +291,6 @@ namespace BatCharging.Service
APDUModel APDUModel; APDUModel APDUModel;
CMD1 CMD1 = new CMD1(); CMD1 CMD1 = new CMD1();
CMD1.value1 = 0;
CMD1.value2 = 0;
CMD1.value3 = type; CMD1.value3 = type;
CMD1.value4 = startAddress; CMD1.value4 = startAddress;
CMD1.value5 = num; CMD1.value5 = num;

@ -43,7 +43,11 @@ namespace BatCharging.Service
} }
return lstResult; return lstResult;
} }
/// <summary>
/// 数据包发送-计算校验和
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public static byte checksumDomain(byte[] data) public static byte checksumDomain(byte[] data)
{ {
int checksum = 0; int checksum = 0;
@ -60,6 +64,11 @@ namespace BatCharging.Service
// 取校验和的低8位 // 取校验和的低8位
return (byte)(checksum & 0xFF); return (byte)(checksum & 0xFF);
} }
/// <summary>
/// 数据包接收-判断校验和是否正确-即判断数据是否完整
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public static bool checksumDomainReceive(byte[] data) public static bool checksumDomainReceive(byte[] data)
{ {
bool bResult = false; bool bResult = false;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save