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

Make chip::Dnssd::kMaxDeviceNameLen configurable #33036

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@
#define CHIP_AUTOMATION_LOGGING 1

#define CHIP_DEVICE_CONFIG_MAX_DISCOVERED_IP_ADDRESSES 5

#define CHIP_DEVICE_CONFIG_MAX_DEVICE_NAME_LEN 32

/**
* HIGHWATERMARK
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ declare_args() {
chip_bt_bluedroid_enabled = true
chip_max_discovered_ip_addresses = 5
chip_enable_route_hook = false
chip_max_device_name_len = 32
}

buildconfig_header("custom_buildconfig") {
Expand Down Expand Up @@ -61,6 +62,7 @@ buildconfig_header("custom_buildconfig") {
"EXTERNAL_PLATFORMMANAGERIMPL_HEADER=<external_platform/ESP32_custom/PlatformManagerImpl.h>",
"CHIP_CONFIG_SOFTWARE_VERSION_NUMBER=${chip_config_software_version_number}",
"CHIP_DEVICE_CONFIG_MAX_DISCOVERED_IP_ADDRESSES=${chip_max_discovered_ip_addresses}",
"CHIP_DEVICE_CONFIG_MAX_DEVICE_NAME_LEN=${chip_max_device_name_len}",
]

if (chip_enable_ota_requestor) {
Expand Down
2 changes: 2 additions & 0 deletions examples/tv-casting-app/android/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ chip_config_network_layer_ble = false

chip_max_discovered_ip_addresses = 20

chip_max_device_name_len = 128

enable_rtti = true
2 changes: 2 additions & 0 deletions examples/tv-casting-app/darwin/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ chip_enable_rotating_device_id = true
chip_config_network_layer_ble = false

chip_max_discovered_ip_addresses = 20

chip_max_device_name_len = 128
2 changes: 2 additions & 0 deletions examples/tv-casting-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ chip_enable_rotating_device_id = true

chip_max_discovered_ip_addresses = 20

chip_max_device_name_len = 128

matter_enable_tracing_support = true
2 changes: 1 addition & 1 deletion src/lib/dnssd/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ struct OperationalNodeData
void Reset() { peerId = PeerId(); }
};

inline constexpr size_t kMaxDeviceNameLen = 32;
inline constexpr size_t kMaxDeviceNameLen = CHIP_DEVICE_CONFIG_MAX_DEVICE_NAME_LEN;
inline constexpr size_t kMaxRotatingIdLen = 50;
inline constexpr size_t kMaxPairingInstructionLen = 128;

Expand Down
8 changes: 7 additions & 1 deletion src/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ if (chip_device_platform != "none" && chip_device_platform != "external") {
# Define the default number of ip addresses to discover
chip_max_discovered_ip_addresses = 5

# Maximum length of the deviceName in the node discovery data
chip_max_device_name_len = 32

# Allows enabling dynamic setting of the local MRP configuration, for
# devices with multiple radios that have different sleep behavior for
# different radios.
Expand Down Expand Up @@ -380,7 +383,10 @@ if (chip_device_platform != "none" && chip_device_platform != "external") {
defines += [ "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=${chip_device_config_device_product_id}" ]
}

defines += [ "CHIP_DEVICE_CONFIG_MAX_DISCOVERED_IP_ADDRESSES=${chip_max_discovered_ip_addresses}" ]
defines += [
"CHIP_DEVICE_CONFIG_MAX_DISCOVERED_IP_ADDRESSES=${chip_max_discovered_ip_addresses}",
"CHIP_DEVICE_CONFIG_MAX_DEVICE_NAME_LEN=${chip_max_device_name_len}",
]

visibility = [
":platform_config_header",
Expand Down
Loading