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

[Android] Support Android MDNS subtype #26136

Merged
merged 4 commits into from
Apr 25, 2023

Conversation

jeonghwan7
Copy link
Contributor

Fix #25235
To use Android mdns sub-type must be below format
_S15._sub._matterc._udp -> _matterc._udp._S15
I changed the mdns subtype and the function was taken from darwin platform.

@github-actions
Copy link

PR #26136: Size comparison from 19909ce to b98546b

Decreases (1 build for cc32xx)
platform target config section 19909ce b98546b change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20328411 20328410 -1 -0.0
Full report (1 build for cc32xx)
platform target config section 19909ce b98546b change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643249 643249 0 0.0
(read/write) 203848 203848 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197248 197248 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 933224 933224 0 0.0
.debug_aranges 87792 87792 0 0.0
.debug_frame 302140 302140 0 0.0
.debug_info 20328411 20328410 -1 -0.0
.debug_line 2687890 2687890 0 0.0
.debug_loc 2838930 2838930 0 0.0
.debug_ranges 288072 288072 0 0.0
.debug_str 3042155 3042155 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104401 104401 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 377963 377963 0 0.0
.symtab 256976 256976 0 0.0
.text 536728 536728 0 0.0

@jeonghwan7 jeonghwan7 changed the title [Android] Support Android MDNS subtype (#25235) [Android] Support Android MDNS subtype Apr 18, 2023
@jeonghwan7 jeonghwan7 force-pushed the android/fix_subtype branch from b98546b to c764808 Compare April 18, 2023 07:28
@github-actions
Copy link

PR #26136: Size comparison from 4ccbbb7 to c764808

Increases (1 build for cc32xx)
platform target config section 4ccbbb7b c764808 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20330829 20330830 1 0.0
Full report (1 build for cc32xx)
platform target config section 4ccbbb7b c764808 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643249 643249 0 0.0
(read/write) 203848 203848 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197248 197248 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 933224 933224 0 0.0
.debug_aranges 87792 87792 0 0.0
.debug_frame 302140 302140 0 0.0
.debug_info 20330829 20330830 1 0.0
.debug_line 2687904 2687904 0 0.0
.debug_loc 2838960 2838960 0 0.0
.debug_ranges 288072 288072 0 0.0
.debug_str 3042335 3042335 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104401 104401 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 377963 377963 0 0.0
.symtab 256976 256976 0 0.0
.text 536728 536728 0 0.0

@github-actions
Copy link

PR #26136: Size comparison from b8368a1 to f8cb978

Increases (1 build for cc32xx)
platform target config section b8368a1 f8cb978 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20330829 20330830 1 0.0
Full report (1 build for cc32xx)
platform target config section b8368a1 f8cb978 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643249 643249 0 0.0
(read/write) 203848 203848 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197248 197248 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 933224 933224 0 0.0
.debug_aranges 87792 87792 0 0.0
.debug_frame 302140 302140 0 0.0
.debug_info 20330829 20330830 1 0.0
.debug_line 2687904 2687904 0 0.0
.debug_loc 2838960 2838960 0 0.0
.debug_ranges 288072 288072 0 0.0
.debug_str 3042335 3042335 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104401 104401 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 377963 377963 0 0.0
.symtab 256976 256976 0 0.0
.text 536728 536728 0 0.0

@github-actions
Copy link

PR #26136: Size comparison from e2341d8 to b1b807a

Increases (2 builds for nrfconnect)
platform target config section e2341d8 b1b807a change % change
nrfconnect all-clusters-app nrf52840dk_nrf52840 text 804832 804836 4 0.0
nrf7002dk_nrf5340_cpuapp text 775784 775788 4 0.0
Full report (6 builds for mbed, nrfconnect, qpg)
platform target config section e2341d8 b1b807a change % change
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2466336 2466336 0 0.0
.bss 215960 215960 0 0.0
.data 5888 5888 0 0.0
.text 1428980 1428980 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1173892 1173892 0 0.0
bss 155557 155557 0 0.0
rodata 132740 132740 0 0.0
text 804832 804836 4 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1119140 1119140 0 0.0
bss 154713 154713 0 0.0
rodata 109556 109556 0 0.0
text 774228 774228 0 0.0
all-clusters-app nrf7002dk_nrf5340_cpuapp (read only) 4 4 0 0.0
(read/write) 1433952 1433952 0 0.0
bss 135297 135297 0 0.0
rodata 228784 228784 0 0.0
text 775784 775788 4 0.0
qpg lighting-app qpg6105+debug (read/write) 1166568 1166568 0 0.0
.bss 99308 99308 0 0.0
.data 856 856 0 0.0
.text 613668 613668 0 0.0
lock-app qpg6105+debug (read/write) 1136688 1136688 0 0.0
.bss 94452 94452 0 0.0
.data 860 860 0 0.0
.text 583784 583784 0 0.0

@jeonghwan7 jeonghwan7 requested a review from andy31415 April 20, 2023 07:37
@github-actions
Copy link

PR #26136: Size comparison from 1177ce8 to 86b50a4

Decreases (1 build for cc32xx)
platform target config section 1177ce8 86b50a4 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20330829 20330828 -1 -0.0
Full report (1 build for cc32xx)
platform target config section 1177ce8 86b50a4 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643249 643249 0 0.0
(read/write) 203848 203848 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197248 197248 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 933224 933224 0 0.0
.debug_aranges 87792 87792 0 0.0
.debug_frame 302140 302140 0 0.0
.debug_info 20330829 20330828 -1 -0.0
.debug_line 2687904 2687904 0 0.0
.debug_loc 2838960 2838960 0 0.0
.debug_ranges 288072 288072 0 0.0
.debug_str 3042335 3042335 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104401 104401 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 377963 377963 0 0.0
.symtab 256976 256976 0 0.0
.text 536728 536728 0 0.0

@github-actions
Copy link

PR #26136: Size comparison from f3f7ecd to 632549e

Decreases (1 build for cc32xx)
platform target config section f3f7ecd 632549e change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20330830 20330829 -1 -0.0
Full report (1 build for cc32xx)
platform target config section f3f7ecd 632549e change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643249 643249 0 0.0
(read/write) 203848 203848 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197248 197248 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 933224 933224 0 0.0
.debug_aranges 87792 87792 0 0.0
.debug_frame 302140 302140 0 0.0
.debug_info 20330830 20330829 -1 -0.0
.debug_line 2687904 2687904 0 0.0
.debug_loc 2838960 2838960 0 0.0
.debug_ranges 288072 288072 0 0.0
.debug_str 3042335 3042335 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104401 104401 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 377963 377963 0 0.0
.symtab 256976 256976 0 0.0
.text 536728 536728 0 0.0

@github-actions
Copy link

PR #26136: Size comparison from f3f7ecd to fbc45b2

Decreases (1 build for cc32xx)
platform target config section f3f7ecd fbc45b2 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20330830 20330829 -1 -0.0
Full report (1 build for cc32xx)
platform target config section f3f7ecd fbc45b2 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643249 643249 0 0.0
(read/write) 203848 203848 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197248 197248 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 933224 933224 0 0.0
.debug_aranges 87792 87792 0 0.0
.debug_frame 302140 302140 0 0.0
.debug_info 20330830 20330829 -1 -0.0
.debug_line 2687904 2687904 0 0.0
.debug_loc 2838960 2838960 0 0.0
.debug_ranges 288072 288072 0 0.0
.debug_str 3042335 3042335 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104401 104401 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 377963 377963 0 0.0
.symtab 256976 256976 0 0.0
.text 536728 536728 0 0.0

@github-actions
Copy link

PR #26136: Size comparison from f3f7ecd to 7935b8d

Full report (1 build for cc32xx)
platform target config section f3f7ecd 7935b8d change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643249 643249 0 0.0
(read/write) 203848 203848 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197248 197248 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 933224 933224 0 0.0
.debug_aranges 87792 87792 0 0.0
.debug_frame 302140 302140 0 0.0
.debug_info 20330830 20330830 0 0.0
.debug_line 2687904 2687904 0 0.0
.debug_loc 2838960 2838960 0 0.0
.debug_ranges 288072 288072 0 0.0
.debug_str 3042335 3042335 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104401 104401 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 377963 377963 0 0.0
.symtab 256976 256976 0 0.0
.text 536728 536728 0 0.0

@andy31415
Copy link
Contributor

@jeonghwan7 could you add more details about To use Android mdns sub-type must be below format _S15._sub._matterc._udp -> _matterc._udp._S15 ?

Is this format documented anywhere or was this found during manual testing (and if so, how)?
Looking at the delta, we are also using a , separator for full types which is not described in the cases.

Looking at https://www.rfc-editor.org/rfc/rfc6763.html#section-7.1, the example given is _printer._sub._http._tcp so the existing _S15._sub.... seems more correct, hence my surprise that android needs to switch things. Not impossible, however I would like to understand what is going on.

@jeonghwan7
Copy link
Contributor Author

jeonghwan7 commented Apr 25, 2023

Hi, @andy31415
From what I found out, the way to use the mdns subtype is different depending on the library.
An error will occur when using S15._sub... for Android NSD API according to the attached standard(rfc6763)
Please check (#25235) for the detailed error.

Using subtype, I thought about discovery as a function that must be implemented in the app, and found out that I had to put the subtype back on Android after finding the following issue link, and when I tested it, it worked normally and created a PR.
(#15009 (comment))

The changing subtype method code is taken from darwin.
Please refer to the following link.

std::string GetFullTypeWithSubTypes(const char * type, DnssdServiceProtocol protocol, const char * subTypes[], size_t subTypeSize)

@andy31415 andy31415 merged commit 798c266 into project-chip:master Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] [Android] Service Discovery start fail when using specific service type
4 participants