You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.4 KiB

using BatCharging.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BatCharging.Service
{
public static class PublicProgram
{
public static string failName01 = null;
public static string failName02 = null;
public static string failName03 = null;
public static string failName04 = null;
public static List<byte> APCI(APDUModel baseApci)
{
List<byte> lstResult = null;
if (baseApci != null)
{
lstResult = new List<byte>();
//起始域
lstResult.Add(baseApci.OriginDomain1);
lstResult.Add(baseApci.OriginDomain2);
//长度域
byte[] packLens = BitConverter.GetBytes(baseApci.LengthDomain);
lstResult.AddRange(packLens);
//信息域
lstResult.Add(baseApci.infoDomain);
//序列号域
lstResult.Add(baseApci.SerialNumberDomain);
//源地址
byte[] packSrcs = BitConverter.GetBytes(baseApci.CMD);
lstResult.AddRange(packSrcs);
//数据域
lstResult.AddRange(baseApci.dataDomain);
//校验和域
lstResult.Add(baseApci.checksumDomain);
}
return lstResult;
}
}
}