Skip to content

Reduce UART probe timeout and cache user data page#38

Merged
wizzomafizzo merged 2 commits intomainfrom
feature/reduce-probe-timeout
Jan 17, 2026
Merged

Reduce UART probe timeout and cache user data page#38
wizzomafizzo merged 2 commits intomainfrom
feature/reduce-probe-timeout

Conversation

@wizzomafizzo
Copy link
Member

Summary

  • Reduce per-device UART probe timeout from 2s to 500ms for faster detection when multiple USB-serial devices are present (e.g., Daemonbite controllers sharing CH340 chips)
  • Cache page 4 (first user data page) during NTAG DetectType for Amiibo detection without additional reads
  • Skip probe-based detection for non-NDEF tags to avoid NAK errors that break subsequent reads
  • Expose GetCachedUserDataPage in tagops for downstream consumers

Test plan

  • All unit tests pass
  • All integration tests pass
  • Lint passes with 0 issues

- Reduce per-device UART probe timeout from 2s to 500ms for faster
  detection when multiple USB-serial devices are present
- Cache page 4 (first user data page) during NTAG DetectType for
  Amiibo detection without additional reads
- Skip probe-based detection for non-NDEF tags to avoid NAK errors
- Expose GetCachedUserDataPage in tagops for downstream consumers
- Remove detectTypeByProbing function (now unused since non-NDEF
  tags default to NTAG215 without probing)
- Consolidate non-NDEF detection tests into single test verifying
  default to NTAG215 behavior
- Add page 4 mock response to integration test for DetectType flow
@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

❌ Patch coverage is 65.00000% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
tagops/tagops.go 0.00% 4 Missing ⚠️
ntag.go 86.66% 1 Missing and 1 partial ⚠️
detection/uart/detector.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@wizzomafizzo wizzomafizzo merged commit 41fe349 into main Jan 17, 2026
12 of 13 checks passed
@wizzomafizzo wizzomafizzo deleted the feature/reduce-probe-timeout branch January 17, 2026 14:05
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