-
Notifications
You must be signed in to change notification settings - Fork 136
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
mdns add browse support (IDFGH-12512) #522
mdns add browse support (IDFGH-12512) #522
Conversation
43500eb
to
155f270
Compare
57a2c35
to
23446f1
Compare
The algorithm for doing this is described in the MDNS specification. Is it being followed? I just encountered this inability to monitor when trying to build a matter controller. esp-matter needs this feature. |
No, I just send the query once and then listen for the service which has been queried. |
For esp-matter with just need to do a query on something like _matterc._tcp and then monitor add/deletes. This is the event interface. https://github.com/project-chip/connectedhomeip/blob/master/src/lib/dnssd/platform/DnssdBrowseDelegate.h There is no requirement to implement everything in the MDNS spec, all that is needed is enough to implement this interface. |
@jonsmirl This MR introduces a continuous browse feature which is similar to It was required by Thread BR project, while it should also works for your Matter controller use case. Let us know If there are any functionalities missing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for posting these changes and implementing browse support. This LGTM! I like the way you treat browsing separately from the searching and other features. It may be helpful to reuse some code from the searching routines, but this change is less invasive and more compact 👍
just left few nitpicks and of course we need to test the changes properly.
85ad383
to
67f9cb7
Compare
Hi, @david-cermak @gabsuren . I do these tests manually in my locally. And in my local test, I test for these scenarios manually:
case-1: Start browsing with the service
case-1: Start browsing with the service All the test case seems work fine in my local test env. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
67f9cb7
to
af330b6
Compare
This MR introduces a new query mode: browse(like the
avahi-browse -r _test._tcp
).mdns_browse_new
is used for starting a browse, it will add a browse in the link list of_mdns_server
, if there is some service start or leave, it will be notified by the callback passed in the API. When the service is leaved, the ttl will be0
, the related result will be freed after syncing to the notifier callback.mdns_browse_delete
is used for stop the browse query and free the related memory.All apis are followed the mdns action mechanism.