Repository navigation
fix(discovery): case-insensitive hostname match — the P4 was invisible - #22
Merged
Merged
Conversation
…s invisible
A real ESP32-P4 on the LAN found this. It advertises its Bonjour INSTANCE NAME as
"KitchenSync" (capital K, a friendly name), where the Touch and X32Link use lowercase
hostnames (kstouch-…, x32link-…). The hostname fallback used hasPrefix, which is
case-sensitive, so `"KitchenSync".hasPrefix("kitchensync")` was false and the P4 never
showed up. A Bonjour name's case is not meaningful. Lowercase before matching.
(The P4 also publishes dev=kitchensync in TXT, so a TXT-aware client matches it anyway;
this fixes the hostname fallback for units whose TXT the browse result doesn't carry.)
Test written from the real device's advertisement.
Claude-Session: https://claude.ai/code/session_01F7YsQgso3KNpeXbP5vNVj6
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A real ESP32-P4 found this: it advertises its Bonjour instance name as
KitchenSync(capital K), while the Touch/X32Link use lowercase hostnames.hasPrefixis case-sensitive, so the P4 was filtered out. Lowercase before matching. Test written from the device's actual advertisement.https://claude.ai/code/session_01F7YsQgso3KNpeXbP5vNVj6