Skip to content

Commit f91c661

Browse files
authored
Enable additional adv data on Linux as a reference platform (#33897)
* Enable additional adv data on Linux as a reference platform * Enable rotating device ID on Linux * Fix build with glib < 2.68 * Remove rotating ID option from chip-tool
1 parent 4728f4f commit f91c661

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

examples/lighting-app/linux/args.gni

+3
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
2828

2929
matter_enable_tracing_support = true
3030

31+
chip_enable_additional_data_advertising = true
32+
chip_enable_rotating_device_id = true
33+
3134
chip_enable_read_client = false

src/platform/Linux/bluez/BluezEndpoint.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
#include "BluezConnection.h"
7676
#include "Types.h"
7777

78+
#if !GLIB_CHECK_VERSION(2, 68, 0)
79+
#define g_memdup2(mem, size) g_memdup(mem, static_cast<unsigned int>(size))
80+
#endif
81+
7882
namespace chip {
7983
namespace DeviceLayer {
8084
namespace Internal {
@@ -413,7 +417,7 @@ static void UpdateAdditionalDataCharacteristic(BluezGattCharacteristic1 * charac
413417
additionalDataFields);
414418
SuccessOrExit(err);
415419

416-
data = g_memdup(bufferHandle->Start(), bufferHandle->DataLength());
420+
data = g_memdup2(bufferHandle->Start(), bufferHandle->DataLength());
417421

418422
cValue = g_variant_new_from_data(G_VARIANT_TYPE("ay"), data, bufferHandle->DataLength(), TRUE, g_free, data);
419423
bluez_gatt_characteristic1_set_value(characteristic, cValue);

0 commit comments

Comments
 (0)