Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does GmsCoreServiceResolver do? #146

Open
jonsmirl opened this issue Jun 25, 2023 · 2 comments
Open

What does GmsCoreServiceResolver do? #146

jonsmirl opened this issue Jun 25, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@jonsmirl
Copy link

I can't see anywhere in the code that calls GmsCoreServiceResolver. And if I put breakpoints in it, I can't hit them.
So what does this file do? It doesn't seem to be doing anything but overriding some internal GMS function and printing some debug.

How does this relate to NsdManager.DiscoveryListener?

@pierredelisle
Copy link
Contributor

In the CHIP SDK, there is an Android interface binding for mDNS service resolution called ServiceResolver. A default implementation, NsdManagerServiceResolver, is provided as a convenience, using the Android platform NsdManager.

See how it is used in ChipClient: https://github.com/google-home/sample-app-for-matter-android/blob/main/app/src/main/java/com/google/homesampleapp/chip/ChipClient.kt#L56

Unfortunately, the use of NsdManagerServiceResolver is not spec compliant and is problematic when used with Matter. For example, it only returns 1 address and if there is an IPv4 address, it likely returns that one, which is not spec-defined/compliant.

The Google Home API provides “resolveService” on the local network for the Matter DNS-SD service. (see https://developers.home.google.com/reference/com/google/android/gms/home/matter/discovery/DiscoveryClient).

As its comments say, GmsCoreServiceResolver is “mDNS service resolver that leverages the GMSCore mDNS discovery API.”

I ran into issues when testing and put it aside. This issue should act as a reminder to get back to it.

@pierredelisle pierredelisle added the enhancement New feature or request label Jun 27, 2023
@jonsmirl
Copy link
Author

I used NsdManager directly like you did here:
https://github.com/google-home/sample-app-for-matter-android/blob/main/app/src/main/java/com/google/homesampleapp/screens/commissionable/mdns/MatterBeaconProducerMdns.kt#L61

Doing that causes an issue in NsdServiceFinder...
project-chip/connectedhomeip#26644

It is fairly hard to hit that null ref, I hit it about twice a week when running tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants