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

[BUG] [Android] Service Discovery start fail when using specific service type #25235

Closed
jeonghwan7 opened this issue Feb 22, 2023 · 1 comment · Fixed by #26136
Closed

[BUG] [Android] Service Discovery start fail when using specific service type #25235

jeonghwan7 opened this issue Feb 22, 2023 · 1 comment · Fixed by #26136
Labels

Comments

@jeonghwan7
Copy link
Contributor

Reproduction steps

Service Discovery start fail when using specific service type (_S9._sub._matterc._udp)

Hi, Service Discovery fail when using specific service type like _S9._sub._matterc._udp
without sub type (_matterc._udp) is working well.

It is mandatory function for just using manual pairing code and QR Code pairing.

Log is below
`02-22 10:01:54.414 D 31680 31680 NsdManagerServiceBrowser: Starting service discovering for _S9._sub._matterc._udp
.....
02-22 10:01:54.626 E 1039 15809 MDnsDS : Discover request 732 got an error from DNSServiceBrowse -65540
02-22 10:01:54.636 E 1590 2299 MDnsManager: Discover service failed.
02-22 10:01:54.636 E 1590 2299 MDnsManager: android.os.ServiceSpecificException: Unknown error -65540 (code -65540)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at android.os.Parcel.createExceptionOrNull(Parcel.java:3037)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at android.os.Parcel.createException(Parcel.java:3007)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at android.os.Parcel.readException(Parcel.java:2990)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at android.os.Parcel.readException(Parcel.java:2932)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at android.net.connectivity.android.net.mdns.aidl.IMDns$Stub$Proxy.discover(IMDns.java:269)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at android.net.connectivity.android.net.nsd.MDnsManager.discover(MDnsManager.java:107)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at com.android.server.NsdService.discoverServices(NsdService.java:818)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at com.android.server.NsdService.-$$Nest$mdiscoverServices(Unknown Source:0)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at com.android.server.NsdService$NsdStateMachine$EnabledState.processMessage(NsdService.java:314)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at android.net.connectivity.com.android.internal.util.StateMachine$SmHandler.processMsg(StateMachine.java:993)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at android.net.connectivity.com.android.internal.util.StateMachine$SmHandler.handleMessage(StateMachine.java:810)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at android.os.Handler.dispatchMessage(Handler.java:106)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at android.os.Looper.loopOnce(Looper.java:226)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at android.os.Looper.loop(Looper.java:313)
02-22 10:01:54.636 E 1590 2299 MDnsManager: at android.os.HandlerThread.run(HandlerThread.java:67)
02-22 10:01:54.636 E 1039 15809 MDnsDS : Stop used unknown requestId 732
02-22 10:01:54.637 E 1590 2299 MDnsManager: Stop operation failed.
02-22 10:01:54.637 E 1590 2299 MDnsManager: android.os.ServiceSpecificException: No such process (code 3)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at android.os.Parcel.createExceptionOrNull(Parcel.java:3037)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at android.os.Parcel.createException(Parcel.java:3007)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at android.os.Parcel.readException(Parcel.java:2990)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at android.os.Parcel.readException(Parcel.java:2932)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at android.net.connectivity.android.net.mdns.aidl.IMDns$Stub$Proxy.stopOperation(IMDns.java:323)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at android.net.connectivity.android.net.nsd.MDnsManager.stopOperation(MDnsManager.java:167)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at com.android.server.NsdService.stopServiceDiscovery(NsdService.java:822)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at com.android.server.NsdService.-$$Nest$mstopServiceDiscovery(Unknown Source:0)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at com.android.server.NsdService$NsdStateMachine$EnabledState.processMessage(NsdService.java:322)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at android.net.connectivity.com.android.internal.util.StateMachine$SmHandler.processMsg(StateMachine.java:993)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at android.net.connectivity.com.android.internal.util.StateMachine$SmHandler.handleMessage(StateMachine.java:810)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at android.os.Handler.dispatchMessage(Handler.java:106)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at android.os.Looper.loopOnce(Looper.java:226)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at android.os.Looper.loop(Looper.java:313)
02-22 10:01:54.637 E 1590 2299 MDnsManager: at android.os.HandlerThread.run(HandlerThread.java:67)
02-22 10:01:54.638 W 31680 31780 NsdManagerServiceBrowser: Failed to start discovery service _S9._sub._matterc._udp: 0

`

Bug prevalence

everytime

GitHub hash of the SDK that was being used

5f058f9

Platform

android

Platform Version(s)

No response

Anything else?

No response

@jeonghwan7 jeonghwan7 changed the title [BUG] [Android] Service Discovery start fail when using specific device type [BUG] [Android] Service Discovery start fail when using specific service type Feb 22, 2023
@jeonghwan7
Copy link
Contributor Author

jeonghwan7 commented Feb 28, 2023

It seems that Android NsdService don't support dns sd subtype(_S9._sub.)

Actually, I have tried to another way to resolve this issue.
For example

  1. I try to find "_matterc._udp"
  2. If device found, ㅑ checked if it could be processed within the second found callback, but it seems impossible because the Service Info object does not contain a service type.

@Override public void onServiceFound(NsdServiceInfo serviceInfo) { Log.i(TAG, "Found service '" + serviceInfo.getServiceName() + "' service info "+serviceInfo.getServiceType() + "service "+serviceInfo); serviceNameList.add(serviceInfo.getServiceName()); }

The Log is below There is no sub type in there.

02-28 10:40:03.642 I 12630 12922 NsdManagerServiceBrowser: Found service ECA649FB2ECBE143 service info _matterc._udp.service name: ECA649FB2ECBE143, type: _matterc._udp., host: null, port: 0, network: 105, txtRecord:

jeonghwan7 added a commit to jeonghwan7/connectedhomeip that referenced this issue Apr 18, 2023
jeonghwan7 added a commit to jeonghwan7/connectedhomeip that referenced this issue Apr 18, 2023
jeonghwan7 added a commit to jeonghwan7/connectedhomeip that referenced this issue Apr 18, 2023
andy31415 pushed a commit that referenced this issue Apr 25, 2023
* [Android] Support Android MDNS subtype (#25235)

* Restyled by whitespace

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants