Skip to content

fix: discard all failed probes in Safe mode#42

Merged
wizzomafizzo merged 1 commit intomainfrom
fix/safe-mode-false-positive-detection
Feb 7, 2026
Merged

fix: discard all failed probes in Safe mode#42
wizzomafizzo merged 1 commit intomainfrom
fix/safe-mode-false-positive-detection

Conversation

@wizzomafizzo
Copy link
Member

Summary

  • Remove isLikelyPN532() guard from the failed-probe branch in processPort() so Safe mode always discards devices that don't respond to the firmware version probe
  • Devices using common USB-to-serial chips (CH340 1A86:7523, FTDI 0403:6001) were returned as detected PN532 devices even when probing failed, causing false positives to be cached and blocking detection of real PN532 devices that enumerate later during boot
  • Add regression tests for processPort Safe mode behavior via a probeDeviceFn test seam

Devices using common USB-to-serial chips (CH340, FTDI) were returned as
detected PN532 devices in Safe mode even when probing failed, because
the isLikelyPN532() guard prevented discarding them. This caused false
positives to be cached, blocking detection of real PN532 devices that
enumerate later during boot.

Remove the isLikelyPN532() guard from the failed-probe branch so Safe
mode always discards devices that don't respond to the firmware version
probe. A real PN532 behind a CH340 chip will always pass the probe.
@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
detection/uart/detector.go 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@wizzomafizzo wizzomafizzo merged commit ff024e3 into main Feb 7, 2026
13 checks passed
@wizzomafizzo wizzomafizzo deleted the fix/safe-mode-false-positive-detection branch February 7, 2026 09:48
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.

1 participant