Skip to content

Commit 9961c45

Browse files
Make chip::Dnssd::kMaxDeviceNameLen configurable
1 parent 035d302 commit 9961c45

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

examples/tv-casting-app/android/args.gni

+2
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ chip_config_network_layer_ble = false
3434

3535
chip_max_discovered_ip_addresses = 20
3636

37+
chip_max_device_name_len = 128
38+
3739
enable_rtti = true

examples/tv-casting-app/darwin/args.gni

+2
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ chip_enable_rotating_device_id = true
3838
chip_config_network_layer_ble = false
3939

4040
chip_max_discovered_ip_addresses = 20
41+
42+
chip_max_device_name_len = 128

examples/tv-casting-app/linux/args.gni

+2
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ chip_enable_rotating_device_id = true
3232

3333
chip_max_discovered_ip_addresses = 20
3434

35+
chip_max_device_name_len = 128
36+
3537
matter_enable_tracing_support = true

src/lib/dnssd/Types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ struct OperationalNodeData
200200
void Reset() { peerId = PeerId(); }
201201
};
202202

203-
inline constexpr size_t kMaxDeviceNameLen = 32;
203+
inline constexpr size_t kMaxDeviceNameLen = CHIP_DEVICE_CONFIG_MAX_DEVICE_NAME_LEN;
204204
inline constexpr size_t kMaxRotatingIdLen = 50;
205205
inline constexpr size_t kMaxPairingInstructionLen = 128;
206206

src/platform/BUILD.gn

+7-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ if (chip_device_platform != "none" && chip_device_platform != "external") {
8181
# Define the default number of ip addresses to discover
8282
chip_max_discovered_ip_addresses = 5
8383

84+
# Maximum length of the deviceName in the node discovery data
85+
chip_max_device_name_len = 32
86+
8487
# Allows enabling dynamic setting of the local MRP configuration, for
8588
# devices with multiple radios that have different sleep behavior for
8689
# different radios.
@@ -380,7 +383,10 @@ if (chip_device_platform != "none" && chip_device_platform != "external") {
380383
defines += [ "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=${chip_device_config_device_product_id}" ]
381384
}
382385

383-
defines += [ "CHIP_DEVICE_CONFIG_MAX_DISCOVERED_IP_ADDRESSES=${chip_max_discovered_ip_addresses}" ]
386+
defines += [
387+
"CHIP_DEVICE_CONFIG_MAX_DISCOVERED_IP_ADDRESSES=${chip_max_discovered_ip_addresses}",
388+
"CHIP_DEVICE_CONFIG_MAX_DEVICE_NAME_LEN=${chip_max_device_name_len}",
389+
]
384390

385391
visibility = [
386392
":platform_config_header",

0 commit comments

Comments
 (0)