mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-06-11 19:13:23 +02:00
Finished: NFC Lib v0.9, TODO: CMAC check, Change PICC Key
This commit is contained in:
@ -71,10 +71,10 @@ namespace NFC.ISO7816_4
|
||||
return string.Format(pattern_case2, CLA, INS, P1, P2, Le);
|
||||
case IsoCase.Case3Short:
|
||||
case IsoCase.Case3Extended:
|
||||
return string.Format(pattern_case3, CLA, INS, P1, P2, Lc, BitConverter.ToString(Data).Replace("-", " "));
|
||||
return string.Format(pattern_case3, CLA, INS, P1, P2, Lc, BitConverter.ToString(Data).Replace("-", "").ToLower());
|
||||
case IsoCase.Case4Short:
|
||||
case IsoCase.Case4Extended:
|
||||
return string.Format(pattern_case4, CLA, INS, P1, P2, Lc, BitConverter.ToString(Data).Replace("-", " "), Le);
|
||||
return string.Format(pattern_case4, CLA, INS, P1, P2, Lc, BitConverter.ToString(Data).Replace("-", "").ToLower(), Le);
|
||||
default:
|
||||
throw new Exception("Unknown IsoCase");
|
||||
}
|
||||
|
@ -146,8 +146,15 @@ namespace NFC.ISO7816_4
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string pattern = "SW1: 0x{0:x} | SW2: 0x{1:x} | Body: 0x{2:x}";
|
||||
return string.Format(pattern, SW1, SW2, Body);
|
||||
if(Body == null)
|
||||
{
|
||||
return string.Format("SW1: 0x{0:x} | SW2: 0x{1:x}", SW1, SW2);
|
||||
}
|
||||
else
|
||||
{
|
||||
return string.Format("SW1: 0x{0:x} | SW2: 0x{1:x} | Body: {2:x}", SW1, SW2, BitConverter.ToString(Body).Replace("-", "").ToLower());
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
Reference in New Issue
Block a user