Skip to content

Commit

Permalink
[Android] Change default val of udpListenPort to 0 (#29875)
Browse files Browse the repository at this point in the history
This commit changes the default value of the UDP listen port used in
Android platform's ControllerParams from 5541 to 0. Since the default
value of UDP listen port was 5541, if multiple matter applications using
default settings are run on one matter device, UDP listen port conflict
occurs. If we set the UDP listen port to 0, port collisions can be
avoided because the port is bound randomly. Although matter applications
can avoid conflicts by setting a UDP listen port, it is better to set
this to its default value of 0 so that matter applications that use the
default settings can avoid conflicts.

Signed-off-by: Youngho Yoon <yhoyoon@samsung.com>
Signed-off-by: Charles Kim <chulspro.kim@samsung.com>
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
Signed-off-by: sanghyukko <sanghyuk.ko@samsung.com>
Signed-off-by: Jaehoon You <jaehoon.you@samsung.com>
Signed-off-by: Kyu-Wook Lim <kyuwook.lim@samsung.com>
  • Loading branch information
yhoyoon authored and pull[bot] committed Oct 23, 2023
1 parent 19e1790 commit 1393874
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public final class ControllerParams {
@Nullable private final byte[] ipk;
private final long adminSubject;

private static final int LEGACY_GLOBAL_CHIP_PORT = 5540;

/** @param udpListenPort the UDP listening port, or 0 to pick any available port. */
private ControllerParams(Builder builder) {
this.fabricId = builder.fabricId;
Expand Down Expand Up @@ -132,7 +130,7 @@ public static Builder newBuilder(OperationalKeyConfig operationalKeyConfig) {
/** Builder for {@link ControllerParams}. */
public static class Builder {
private long fabricId = 1;
private int udpListenPort = LEGACY_GLOBAL_CHIP_PORT + 1;
private int udpListenPort = 0;
private int controllerVendorId = 0xFFFF;
private int failsafeTimerSeconds = 30;
private int caseFailsafeTimerSeconds = 0;
Expand Down

0 comments on commit 1393874

Please sign in to comment.