using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ShengJu_CUT100_DES.MessageEntity.Outgoing
{
///
/// 读数据文件 读取长度固定 32 字节(1 块)
///
public class ReadAppFileRequest : MessageBase
{
///
///
///
/// 1-4
/// 0-3
/// 16 bytes key,密钥值需要与制定文件的读写密钥相对应
public ReadAppFileRequest(byte fileId, byte blockAddress, byte[] readKey)
{
if (fileId < 1 || fileId > 4)
throw new ArgumentOutOfRangeException("fileId must be range from(include) 1 to 4");
if (blockAddress > 3)
throw new ArgumentOutOfRangeException("blockAddress must be range from(include) 0 to 3");
if (readKey.Length != 16)
throw new ArgumentException("readKey must has its length to 16");
base.命令代码 = CommandType.DesFireEV1操作命令_读数据_高级命令;
base.RawDataAndCheck = new byte[] { fileId }.Concat(new byte[] { blockAddress }).Concat(readKey).ToList();
}
}
}