using Edge.Core.Parser.BinaryParser.MessageEntity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HengshanPaymentTerminal.MessageEntity.Incoming
{
///
/// FCC发起授权请求,油机回复数据对象
///
public class AuthorizationResponse:CommonMessage
{
///
/// 枪号
///
public int NozzleNum { get; set; }
///
/// 发起授权时间
///
public DateTime? AuthorizationTime { get; set; }
///
/// 授权结果:00:失败;01:成功
///
public int Result { get; set; }
///
/// 流水号
///
public int Ttc { get; set; }
public override byte[] ToCommonByteArray()
{
return base.ToCommonByteArray();
}
public override CommonMessage ToObject(byte[] datas)
{
string v = BitConverter.ToString(datas).Replace("-", " ");
getBaseData(datas);
this.NozzleNum = datas[7];
Span authorizationTimeSapn = datas.AsSpan(8, 7);
this.AuthorizationTime = bytes2DateTime(authorizationTimeSapn.ToArray());
this.Result = datas[15];
this.Ttc = Bytes2Number(datas, 16, 4);
return this;
}
}
}