12345678910111213141516171819202122232425262728293031 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ShengJu_CUT100_DES.MessageEntity.Outgoing
- {
- /// <summary>
- /// 读数据文件 读取长度固定 32 字节(1 块)
- /// </summary>
- public class ReadAppFileRequest : MessageBase
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="fileId">1-4</param>
- /// <param name="blockAddress">0-3</param>
- /// <param name="readKey">16 bytes key,密钥值需要与制定文件的读写密钥相对应</param>
- 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();
- }
- }
- }
|