-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding virtual NDEF card with PN532 (#2159)
* initial commit * Adding writing and events * Improving doc * adding more doc * improved sample and doc * compatibility suppressions * adjusting default padding for felica and adding phone app link * fixing markdown lint
- Loading branch information
Showing
21 changed files
with
1,012 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,59 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Iot.Device.Card.CreditCardProcessing | ||
namespace Iot.Device.Card | ||
{ | ||
/// <summary> | ||
/// The list of predefined commands to communicate with the card | ||
/// </summary> | ||
internal class ApduCommands | ||
public class ApduCommands | ||
{ | ||
/// <summary>Application block.</summary> | ||
public static byte[] ApplicationBlock = { 0x80, 0x1E }; | ||
public static byte[] ApplicaitonUnBlock = { 0x80, 0x18 }; | ||
|
||
/// <summary>Application unblock.</summary> | ||
public static byte[] ApplicationUnBlock = { 0x80, 0x18 }; | ||
|
||
/// <summary>Card block.</summary> | ||
public static byte[] CardBlock = { 0x80, 0x16 }; | ||
|
||
/// <summary>External authenticate.</summary> | ||
public static byte[] ExternalAuthenticate = { 0x00, 0x82 }; | ||
|
||
/// <summary>Generate application cryptogram.</summary> | ||
public static byte[] GenerateApplicationCryptogram = { 0x80, 0xAE }; | ||
|
||
/// <summary>Get challenge.</summary> | ||
public static byte[] GetChallenge = { 0x00, 0x84 }; | ||
|
||
/// <summary>Get data.</summary> | ||
public static byte[] GetData = { 0x80, 0xCA }; | ||
|
||
/// <summary>Get processing options.</summary> | ||
public static byte[] GetProcessingOptions = { 0x80, 0xA8 }; | ||
|
||
/// <summary>Internal authenticate.</summary> | ||
public static byte[] InternalAuthenticate = { 0x00, 0x88 }; | ||
|
||
/// <summary>PIN number change unblock.</summary> | ||
public static byte[] PersonalIdentificationNumberChangeUnblock = { 0x80, 0x24 }; | ||
|
||
/// <summary>Read binary.</summary> | ||
public static byte[] ReadBinary = { 0x00, 0xB0 }; | ||
|
||
/// <summary>Update binary.</summary> | ||
public static byte[] UpdateBinary = { 0x00, 0xD6 }; | ||
|
||
/// <summary>Read record.</summary> | ||
public static byte[] ReadRecord = { 0x00, 0xB2 }; | ||
|
||
/// <summary>Select a file.</summary> | ||
public static byte[] Select = { 0x00, 0xA4 }; | ||
|
||
/// <summary>Verify.</summary> | ||
public static byte[] Verify = { 0x80, 0x20 }; | ||
|
||
/// <summary>Get bytes to read.</summary> | ||
public static byte[] GetBytesToRead = { 0x00, 0xC0 }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Iot.Device.Card | ||
{ | ||
/// <summary> | ||
/// The list of predefined commands to communicate with the card | ||
/// </summary> | ||
public class ApduReturnCommands | ||
{ | ||
/// <summary>Command completed properly.</summary> | ||
public static byte[] CommandComplete = { 0x90, 0x00 }; | ||
|
||
/// <summary>Tag not found.</summary> | ||
public static byte[] TagNotFound = { 0x6A, 0x82 }; | ||
|
||
/// <summary>Function not supported.</summary> | ||
public static byte[] FunctionNotSupported = { 0x6A, 0x81 }; | ||
|
||
/// <summary>Memory Failure.</summary> | ||
public static byte[] MemoryFailure = { 0x65, 0x81 }; | ||
|
||
/// <summary>Security status not satisfied.</summary> | ||
public static byte[] SecurityNotSatisfied = { 0x69, 0x82 }; | ||
|
||
/// <summary>Wrong legnth.</summary> | ||
public static byte[] WrongLength = { 0x6C, 0x00 }; | ||
|
||
/// <summary>End of file before being able to send all.</summary> | ||
public static byte[] EndOfFileBefore = { 0x62, 0x82 }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace EmulatedTag | ||
{ | ||
/// <summary> | ||
/// The state of the card. | ||
/// </summary> | ||
public enum CardStatus | ||
{ | ||
/// <summary>Card is in released state.</summary> | ||
Released = 0, | ||
|
||
/// <summary>Car is in activated state.</summary> | ||
Activated, | ||
|
||
/// <summary>Card is on delected state.</summary> | ||
Deselected | ||
} | ||
} |
Oops, something went wrong.