From f8c1304bb49feba654dc0c7e49ebe5480622b32e Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Thu, 13 Jun 2024 11:13:41 +0200 Subject: [PATCH 1/4] Enable additional adv data on Linux as a reference platform --- examples/chip-tool/args.gni | 2 ++ examples/lighting-app/linux/args.gni | 2 ++ src/platform/Linux/bluez/BluezEndpoint.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/chip-tool/args.gni b/examples/chip-tool/args.gni index 30f4000365e4ef..3e6a52d4a17a7a 100644 --- a/examples/chip-tool/args.gni +++ b/examples/chip-tool/args.gni @@ -28,6 +28,8 @@ matter_enable_tracing_support = true matter_log_json_payload_hex = true matter_log_json_payload_decode_full = true +chip_enable_additional_data_advertising = true + # make chip-tool very strict by default chip_tlv_validate_char_string_on_read = true chip_tlv_validate_char_string_on_write = true diff --git a/examples/lighting-app/linux/args.gni b/examples/lighting-app/linux/args.gni index 4c205a5cef34a5..3f0947e1002367 100644 --- a/examples/lighting-app/linux/args.gni +++ b/examples/lighting-app/linux/args.gni @@ -28,4 +28,6 @@ chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] matter_enable_tracing_support = true +chip_enable_additional_data_advertising = true + chip_enable_read_client = false diff --git a/src/platform/Linux/bluez/BluezEndpoint.cpp b/src/platform/Linux/bluez/BluezEndpoint.cpp index 55b127e1b17014..3f9487c66c7b75 100644 --- a/src/platform/Linux/bluez/BluezEndpoint.cpp +++ b/src/platform/Linux/bluez/BluezEndpoint.cpp @@ -413,7 +413,7 @@ static void UpdateAdditionalDataCharacteristic(BluezGattCharacteristic1 * charac additionalDataFields); SuccessOrExit(err); - data = g_memdup(bufferHandle->Start(), bufferHandle->DataLength()); + data = g_memdup2(bufferHandle->Start(), bufferHandle->DataLength()); cValue = g_variant_new_from_data(G_VARIANT_TYPE("ay"), data, bufferHandle->DataLength(), TRUE, g_free, data); bluez_gatt_characteristic1_set_value(characteristic, cValue); From 174db6dc9f86f56be4797960c17da088aadcc60d Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Thu, 13 Jun 2024 11:21:52 +0200 Subject: [PATCH 2/4] Enable rotating device ID on Linux --- examples/chip-tool/args.gni | 1 + examples/lighting-app/linux/args.gni | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/chip-tool/args.gni b/examples/chip-tool/args.gni index 3e6a52d4a17a7a..86c6acc3fc91d6 100644 --- a/examples/chip-tool/args.gni +++ b/examples/chip-tool/args.gni @@ -29,6 +29,7 @@ matter_log_json_payload_hex = true matter_log_json_payload_decode_full = true chip_enable_additional_data_advertising = true +chip_enable_rotating_device_id = true # make chip-tool very strict by default chip_tlv_validate_char_string_on_read = true diff --git a/examples/lighting-app/linux/args.gni b/examples/lighting-app/linux/args.gni index 3f0947e1002367..8f4ba4dec53683 100644 --- a/examples/lighting-app/linux/args.gni +++ b/examples/lighting-app/linux/args.gni @@ -29,5 +29,6 @@ chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] matter_enable_tracing_support = true chip_enable_additional_data_advertising = true +chip_enable_rotating_device_id = true chip_enable_read_client = false From 869b1871e6c22f208380c80ec4053a0c0610c814 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Thu, 13 Jun 2024 11:49:47 +0200 Subject: [PATCH 3/4] Fix build with glib < 2.68 --- src/platform/Linux/bluez/BluezEndpoint.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/platform/Linux/bluez/BluezEndpoint.cpp b/src/platform/Linux/bluez/BluezEndpoint.cpp index 3f9487c66c7b75..430176ffae028c 100644 --- a/src/platform/Linux/bluez/BluezEndpoint.cpp +++ b/src/platform/Linux/bluez/BluezEndpoint.cpp @@ -75,6 +75,10 @@ #include "BluezConnection.h" #include "Types.h" +#if !GLIB_CHECK_VERSION(2, 68, 0) +#define g_memdup2(mem, size) g_memdup(mem, static_cast(size)) +#endif + namespace chip { namespace DeviceLayer { namespace Internal { From 7a455d85652674e8c5c3aae306fa859f2e7cda39 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Mon, 17 Jun 2024 13:39:07 +0200 Subject: [PATCH 4/4] Remove rotating ID option from chip-tool --- examples/chip-tool/args.gni | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/chip-tool/args.gni b/examples/chip-tool/args.gni index 86c6acc3fc91d6..30f4000365e4ef 100644 --- a/examples/chip-tool/args.gni +++ b/examples/chip-tool/args.gni @@ -28,9 +28,6 @@ matter_enable_tracing_support = true matter_log_json_payload_hex = true matter_log_json_payload_decode_full = true -chip_enable_additional_data_advertising = true -chip_enable_rotating_device_id = true - # make chip-tool very strict by default chip_tlv_validate_char_string_on_read = true chip_tlv_validate_char_string_on_write = true