Skip to content

Commit

Permalink
Make chip::Dnssd::kMaxDeviceNameLen configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadb-amazon committed Apr 17, 2024
1 parent 035d302 commit 9961c45
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
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

0 comments on commit 9961c45

Please sign in to comment.