Skip to content

Commit

Permalink
UltralightCard fixes - byte order of ATQA, number of blocks in Ultral…
Browse files Browse the repository at this point in the history
…ightEV1 (dotnet#2022)

Co-authored-by: John D. Bruner <[email protected]>
  • Loading branch information
jdbruner and jdbruner authored Jan 25, 2023
1 parent 3394f8e commit 5d07526
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/devices/Card/Ultralight/UltralightCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class UltralightCard
/// <param name="ATQA">The ATQA</param>
/// <param name="SAK">The SAK</param>
/// <returns>True if this is an Ultralight</returns>
public static bool IsUltralightCard(ushort ATQA, byte SAK) => (ATQA == 0x4400) && (SAK == 0);
public static bool IsUltralightCard(ushort ATQA, byte SAK) => (ATQA == 0x0044) && (SAK == 0);

/// <summary>
/// Constructor for Ultralight
Expand Down Expand Up @@ -435,18 +435,17 @@ public bool IsPageReadOnly(byte page)
/// </summary>
public int NumberBlocks => UltralightCardType switch
{
// Whenever NdefCapacity + 9 is used, then it's a guess
UltralightCardType.UltralightNtag210 => 16,
UltralightCardType.UltralightNtag212 => 45,
UltralightCardType.UltralightNtag213 => 45,
UltralightCardType.UltralightNtag213F => 45,
UltralightCardType.UltralightNtag215 => 135,
UltralightCardType.UltralightNtag216 => 231,
UltralightCardType.UltralightNtag216F => 231,
UltralightCardType.UltralightEV1MF0UL1101 => 41,
UltralightCardType.UltralightEV1MF0ULH1101 => 41,
UltralightCardType.UltralightEV1MF0UL2101 => NdefCapacity + 9,
UltralightCardType.UltralightEV1MF0ULH2101 => NdefCapacity + 9,
UltralightCardType.UltralightEV1MF0UL1101 => 20,
UltralightCardType.UltralightEV1MF0ULH1101 => 20,
UltralightCardType.UltralightEV1MF0UL2101 => 41,
UltralightCardType.UltralightEV1MF0ULH2101 => 41,
UltralightCardType.UltralightNtagI2cNT3H1101 => 231,
UltralightCardType.UltralightNtagI2cNT3H1101W0 => 231,
UltralightCardType.UltralightNtagI2cNT3H2111W0 => 476 + 9,
Expand Down

0 comments on commit 5d07526

Please sign in to comment.