Skip to content

Commit

Permalink
Enable additional adv data on Linux as a reference platform (project-…
Browse files Browse the repository at this point in the history
…chip#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
  • Loading branch information
arkq committed Jun 17, 2024
1 parent 4728f4f commit f91c661
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/lighting-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ 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
6 changes: 5 additions & 1 deletion src/platform/Linux/bluez/BluezEndpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned int>(size))
#endif

namespace chip {
namespace DeviceLayer {
namespace Internal {
Expand Down Expand Up @@ -413,7 +417,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);
Expand Down

0 comments on commit f91c661

Please sign in to comment.