using Edge.Core.Parser.BinaryParser.Attributes;
using Edge.Core.Parser.BinaryParser.MessageEntity;
using System;
using System.Collections.Generic;
using System.Text;
namespace ShellChina_EPS_Project_CarPlatePay_EpsClient_App.MessageEntity.Base
{
public class MessageBase : MessageTemplateBase
{
///
/// BCD, 0x11,0x12, stands for 1112
/// Bin, 0x11, stands for 17
/// AscIIInt, 0x32,0x37, stands for 27
///
public static string VariableLengthMode = "AscIIInt";
///
/// 长度位为2个字节二进制格式数字
///
//[Format("Content", "+17", EncodingType.BCD, -9999)]
//[Range(0, 655536, "Shell China ISO8583 msg must be range from {1} to {2}, but actual is {0}")]
public int Length { get; set; }
///
/// TPDU为10位数字,报文中以5字节BCD码表示,本接口对TPDU内容没有特殊要求,终端中按应用的需求配置为固定的TPDU即可,如“6000300000”
///
[Format(5, EncodingType.BcdString, -9950)]
public string TPDU { get; set; }
///
/// MTI为消息类型标识(Message type identifier的简写),4位数字,报文中以2字节BCD码表示
///
[Format(2, EncodingType.BCD, -9900)]
[Range(0, 9999, "Shell China ISO8583 msg MessageTypeIdentifier must be range from {1} to {2}, but actual is {0}")]
public int MessageTypeIdentifier { get; set; }
///
/// 本接口规范仅使用8个字节基本位图,不使用扩展位图
///
[EnumerableFormat(8, -9850, EncodingType = EncodingType.BIN)]
public List BitMap { get; set; }
[EnumerableFormat("%cascade", -9800)]
public List Content { get; set; }
public void SetBitMapAndValue(int fieldIndex, string value)
{
}
public void SetBitMapAndValue(int fieldIndex, int value)
{
}
}
}