Skip to content

Conversation

@whywilson
Copy link
Owner

This pull request introduces several improvements and refactors to the PN532 CLI tool, focusing on enhanced connection handling (supporting serial, TCP, and UDP), better user feedback, improved raw frame sending, and code cleanup. The changes also include the removal of some legacy or redundant commands and improved robustness for Mifare Classic/Ultralight operations.

Connection handling and CLI improvements:

  • Enhanced connection string parsing and user instructions for serial, TCP, and UDP connections in HWConnect, along with clearer feedback when connecting and additional usage examples. [1] [2]
  • The CLI prompt and connection status now accurately reflect the current connection type (USB, TCP, UDP, or Offline), with better detection logic.
  • The CLI loop now checks for lost connections and informs the user, closing the device if needed.

Raw frame and command sending enhancements:

  • Improved handling of raw data: if the user inputs a complete frame or wakeup sequence, it is sent directly without additional wrapping.

Mifare and tag operations:

  • Improved logic for writing Mifare Classic blocks, including more informative output and fixing block write logic for Gen1A cards.
  • Adjusted Mifare Ultralight command class names for consistency (HfMfuRdbl, HfMfuWrbl).

Code cleanup and refactoring:

  • Removed legacy or redundant commands, including eRead for Mifare Classic and Ultralight, several LF and NTAG commands, and associated logic, streamlining the codebase. [1] [2]
  • Added encoding declaration to Python scripts for better compatibility.

Robustness and network support:

  • Increased passive tag scan timeout for TCP/UDP connections to improve reliability in networked environments.
  • Improved handling of scan and read results, ensuring more robust parsing and output for tag data. [1] [2]

Let me know if you need a walkthrough of any specific section or the rationale behind any of the refactors!

@whywilson whywilson merged commit b3225c4 into main Aug 15, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants