diff --git a/examples/lighting-app/linux/args.gni b/examples/lighting-app/linux/args.gni index 4c205a5cef34a5..8f4ba4dec53683 100644 --- a/examples/lighting-app/linux/args.gni +++ b/examples/lighting-app/linux/args.gni @@ -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 diff --git a/examples/platform/nxp/rt/rw61x/app/project_include/openthread/OpenThreadConfig.h b/examples/platform/nxp/rt/rw61x/app/project_include/openthread/OpenThreadConfig.h index a5bc2999e80cfb..2e27c4efb95076 100644 --- a/examples/platform/nxp/rt/rw61x/app/project_include/openthread/OpenThreadConfig.h +++ b/examples/platform/nxp/rt/rw61x/app/project_include/openthread/OpenThreadConfig.h @@ -65,12 +65,9 @@ #define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 #define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 -// Temporary workaround till we can enable this via the gn -#ifdef SPINEL_INTERFACE_RPMSG -#define OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 1 -#else +#ifndef OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE #define OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 0 -#endif /* SPINEL_INTERFACE_RPMSG */ +#endif /* OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE */ /* * "ot-nxp/src/rw/rw612/platform/radio.c" has a dependency on diff --git a/scripts/tests/cirque_tests.sh b/scripts/tests/cirque_tests.sh index 67bf0f2de63af5..b6fa0eb7f64e56 100755 --- a/scripts/tests/cirque_tests.sh +++ b/scripts/tests/cirque_tests.sh @@ -114,9 +114,7 @@ function cirquetest_bootstrap() { set -ex cd "$REPO_DIR"/third_party/cirque/repo - pip3 uninstall -y setuptools - pip3 install setuptools==65.7.0 - pip3 install pycodestyle==2.5.0 wheel + pip3 install --break-system-packages pycodestyle==2.5.0 wheel make NO_GRPC=1 install -j @@ -125,7 +123,7 @@ function cirquetest_bootstrap() { "$REPO_DIR"/integrations/docker/images/stage-2/chip-cirque-device-base/build.sh --build-arg OT_BR_POSIX_CHECKOUT="$OT_BR_POSIX_CHECKOUT" __cirquetest_build_ot_lazy - pip3 install -r requirements_nogrpc.txt + pip3 install --break-system-packages -r requirements_nogrpc.txt echo "OpenThread Version: $OPENTHREAD_CHECKOUT" echo "ot-br-posix Version: $OT_BR_POSIX_CHECKOUT" diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_2.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_2.yaml index 4ac1c8e0ceec8f..4012af1e1d4606 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_2.yaml @@ -56,7 +56,7 @@ tests: [1698660637.937911][6429:6431] CHIP:IN: Clearing BLE pending packets. [1698660637.938582][6429:6431] CHIP:BLE: Auto-closing end point's BLE connection. [1698660637.938645][6429:6431] CHIP:DL: Closing BLE GATT connection (con 0xffff9c034bb0) - [1698660637.938805][6429:6430] CHIP:DL: BluezDisconnect peer=F7:D4:24:D2:4A:1F + [1698660637.938805][6429:6430] CHIP:DL: Close BLE connection: peer=F7:D4:24:D2:4A:1F [1698660638.365208][6429:6431] CHIP:IN: SecureSession[0xffff9400f900]: MarkForEviction Type:1 LSID:62220 [1698660638.365311][6429:6431] CHIP:SC: SecureSession[0xffff9400f900, LSID:62220]: State change 'kActive' --> 'kPendingEviction' [1698660638.365440][6429:6431] CHIP:IN: SecureSession[0xffff9400f900]: Released - Type:1 LSID:62220 diff --git a/src/platform/Linux/BLEManagerImpl.cpp b/src/platform/Linux/BLEManagerImpl.cpp index ef36fa439532f7..2ff3136935b99e 100644 --- a/src/platform/Linux/BLEManagerImpl.cpp +++ b/src/platform/Linux/BLEManagerImpl.cpp @@ -476,58 +476,37 @@ void BLEManagerImpl::HandleSubscribeOpComplete(BLE_CONNECTION_OBJECT conId, bool void BLEManagerImpl::HandleTXCharChanged(BLE_CONNECTION_OBJECT conId, const uint8_t * value, size_t len) { - CHIP_ERROR err = CHIP_NO_ERROR; - System::PacketBufferHandle buf = System::PacketBufferHandle::NewWithData(value, len); + System::PacketBufferHandle buf(System::PacketBufferHandle::NewWithData(value, len)); + VerifyOrReturn(!buf.IsNull(), ChipLogError(DeviceLayer, "Failed to allocate packet buffer in %s", __func__)); ChipLogDetail(DeviceLayer, "Indication received, conn = %p", conId); ChipDeviceEvent event{ .Type = DeviceEventType::kPlatformLinuxBLEIndicationReceived, - .Platform = { .BLEIndicationReceived = { .mConnection = conId } } }; - - VerifyOrExit(!buf.IsNull(), err = CHIP_ERROR_NO_MEMORY); - - event.Platform.BLEIndicationReceived.mData = std::move(buf).UnsafeRelease(); + .Platform = { + .BLEIndicationReceived = { .mConnection = conId, .mData = std::move(buf).UnsafeRelease() } } }; PlatformMgr().PostEventOrDie(&event); - -exit: - if (err != CHIP_NO_ERROR) - ChipLogError(DeviceLayer, "HandleTXCharChanged() failed: %s", ErrorStr(err)); } void BLEManagerImpl::HandleRXCharWrite(BLE_CONNECTION_OBJECT conId, const uint8_t * value, size_t len) { - CHIP_ERROR err = CHIP_NO_ERROR; - System::PacketBufferHandle buf; - // Copy the data to a packet buffer. - buf = System::PacketBufferHandle::NewWithData(value, len); - VerifyOrExit(!buf.IsNull(), err = CHIP_ERROR_NO_MEMORY); + System::PacketBufferHandle buf(System::PacketBufferHandle::NewWithData(value, len)); + VerifyOrReturn(!buf.IsNull(), ChipLogError(DeviceLayer, "Failed to allocate packet buffer in %s", __func__)); - // Post an event to the Chip queue to deliver the data into the Chip stack. - { - ChipLogProgress(Ble, "Write request received debug %p", conId); - ChipDeviceEvent event{ .Type = DeviceEventType::kCHIPoBLEWriteReceived, - .CHIPoBLEWriteReceived = { .ConId = conId, .Data = std::move(buf).UnsafeRelease() } }; - PlatformMgr().PostEventOrDie(&event); - } + ChipLogProgress(Ble, "Write request received, conn = %p", conId); -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(DeviceLayer, "HandleRXCharWrite() failed: %s", ErrorStr(err)); - } + // Post an event to the Chip queue to deliver the data into the Chip stack. + ChipDeviceEvent event{ .Type = DeviceEventType::kCHIPoBLEWriteReceived, + .CHIPoBLEWriteReceived = { .ConId = conId, .Data = std::move(buf).UnsafeRelease() } }; + PlatformMgr().PostEventOrDie(&event); } -void BLEManagerImpl::CHIPoBluez_ConnectionClosed(BLE_CONNECTION_OBJECT conId) +void BLEManagerImpl::HandleConnectionClosed(BLE_CONNECTION_OBJECT conId) { - ChipLogProgress(DeviceLayer, "Bluez notify CHIPoBluez connection disconnected"); - // If this was a CHIPoBLE connection, post an event to deliver a connection error to the CHIPoBLE layer. - { - ChipDeviceEvent event{ .Type = DeviceEventType::kCHIPoBLEConnectionError, - .CHIPoBLEConnectionError = { .ConId = conId, .Reason = BLE_ERROR_REMOTE_DEVICE_DISCONNECTED } }; - PlatformMgr().PostEventOrDie(&event); - } + ChipDeviceEvent event{ .Type = DeviceEventType::kCHIPoBLEConnectionError, + .CHIPoBLEConnectionError = { .ConId = conId, .Reason = BLE_ERROR_REMOTE_DEVICE_DISCONNECTED } }; + PlatformMgr().PostEventOrDie(&event); } void BLEManagerImpl::HandleTXCharCCCDWrite(BLE_CONNECTION_OBJECT conId) @@ -535,15 +514,14 @@ void BLEManagerImpl::HandleTXCharCCCDWrite(BLE_CONNECTION_OBJECT conId) VerifyOrReturn(conId != BLE_CONNECTION_UNINITIALIZED, ChipLogError(DeviceLayer, "BLE connection is not initialized in %s", __func__)); + ChipLogProgress(DeviceLayer, "CHIPoBLE %s received", conId->IsNotifyAcquired() ? "subscribe" : "unsubscribe"); + // Post an event to the Chip queue to process either a CHIPoBLE Subscribe or Unsubscribe based on // whether the client is enabling or disabling indications. ChipDeviceEvent event{ .Type = conId->IsNotifyAcquired() ? static_cast(DeviceEventType::kCHIPoBLESubscribe) : static_cast(DeviceEventType::kCHIPoBLEUnsubscribe), .CHIPoBLESubscribe = { .ConId = conId } }; PlatformMgr().PostEventOrDie(&event); - - ChipLogProgress(DeviceLayer, "CHIPoBLE %s received", - (event.Type == DeviceEventType::kCHIPoBLESubscribe) ? "subscribe" : "unsubscribe"); } void BLEManagerImpl::HandleTXComplete(BLE_CONNECTION_OBJECT conId) diff --git a/src/platform/Linux/BLEManagerImpl.h b/src/platform/Linux/BLEManagerImpl.h index f58980397c36fa..97da171b641ace 100644 --- a/src/platform/Linux/BLEManagerImpl.h +++ b/src/platform/Linux/BLEManagerImpl.h @@ -87,7 +87,7 @@ class BLEManagerImpl final : public BLEManager, static void HandleSubscribeOpComplete(BLE_CONNECTION_OBJECT conId, bool subscribed); static void HandleTXCharChanged(BLE_CONNECTION_OBJECT conId, const uint8_t * value, size_t len); static void HandleRXCharWrite(BLE_CONNECTION_OBJECT user_data, const uint8_t * value, size_t len); - static void CHIPoBluez_ConnectionClosed(BLE_CONNECTION_OBJECT user_data); + static void HandleConnectionClosed(BLE_CONNECTION_OBJECT user_data); static void HandleTXCharCCCDWrite(BLE_CONNECTION_OBJECT user_data); static void HandleTXComplete(BLE_CONNECTION_OBJECT user_data); diff --git a/src/platform/Linux/bluez/BluezConnection.cpp b/src/platform/Linux/bluez/BluezConnection.cpp index 6ed15b5bb7cb45..d39411d18d6aef 100644 --- a/src/platform/Linux/bluez/BluezConnection.cpp +++ b/src/platform/Linux/bluez/BluezConnection.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -42,29 +43,31 @@ namespace Internal { namespace { -gboolean BluezIsServiceOnDevice(BluezGattService1 * aService, BluezDevice1 * aDevice) +bool BluezIsServiceOnDevice(BluezGattService1 * aService, BluezDevice1 * aDevice) { - const auto * servicePath = bluez_gatt_service1_get_device(aService); - const auto * devicePath = g_dbus_proxy_get_object_path(reinterpret_cast(aDevice)); - return strcmp(servicePath, devicePath) == 0 ? TRUE : FALSE; + auto servicePath = bluez_gatt_service1_get_device(aService); + auto devicePath = g_dbus_proxy_get_object_path(reinterpret_cast(aDevice)); + return strcmp(servicePath, devicePath) == 0; } -gboolean BluezIsCharOnService(BluezGattCharacteristic1 * aChar, BluezGattService1 * aService) +bool BluezIsCharOnService(BluezGattCharacteristic1 * aChar, BluezGattService1 * aService) { - const auto * charPath = bluez_gatt_characteristic1_get_service(aChar); - const auto * servicePath = g_dbus_proxy_get_object_path(reinterpret_cast(aService)); - ChipLogDetail(DeviceLayer, "Char %s on service %s", charPath, servicePath); - return strcmp(charPath, servicePath) == 0 ? TRUE : FALSE; + auto charPath = bluez_gatt_characteristic1_get_service(aChar); + auto servicePath = g_dbus_proxy_get_object_path(reinterpret_cast(aService)); + return strcmp(charPath, servicePath) == 0; } -} // namespace - -BluezConnection::BluezConnection(const BluezEndpoint & aEndpoint, BluezDevice1 & aDevice) : - mDevice(reinterpret_cast(g_object_ref(&aDevice))) +bool BluezIsFlagOnChar(BluezGattCharacteristic1 * aChar, const char * flag) { - Init(aEndpoint); + auto charFlags = bluez_gatt_characteristic1_get_flags(aChar); + for (size_t i = 0; charFlags[i] != nullptr; i++) + if (strcmp(charFlags[i], flag) == 0) + return true; + return false; } +} // namespace + BluezConnection::IOChannel::~IOChannel() { if (mWatchSource != nullptr) @@ -85,73 +88,69 @@ CHIP_ERROR BluezConnection::Init(const BluezEndpoint & aEndpoint) mService.reset(reinterpret_cast(g_object_ref(aEndpoint.mService.get()))); mC1.reset(reinterpret_cast(g_object_ref(aEndpoint.mC1.get()))); mC2.reset(reinterpret_cast(g_object_ref(aEndpoint.mC2.get()))); + return CHIP_NO_ERROR; } - else + + for (BluezObject & object : aEndpoint.mObjectManager.GetObjects()) { - for (BluezObject & object : aEndpoint.mObjectManager.GetObjects()) + GAutoPtr service(bluez_object_get_gatt_service1(&object)); + if (service && BluezIsServiceOnDevice(service.get(), mDevice.get())) { - BluezGattService1 * service = bluez_object_get_gatt_service1(&object); - if (service != nullptr) + if (strcmp(bluez_gatt_service1_get_uuid(service.get()), Ble::CHIP_BLE_SERVICE_LONG_UUID_STR) == 0) { - if ((BluezIsServiceOnDevice(service, mDevice.get())) == TRUE && - (strcmp(bluez_gatt_service1_get_uuid(service), Ble::CHIP_BLE_SERVICE_LONG_UUID_STR) == 0)) - { - mService.reset(service); - break; - } - g_object_unref(service); + ChipLogDetail(DeviceLayer, "CHIP service found"); + mService.reset(service.release()); + break; } } + } - VerifyOrExit(mService, ChipLogError(DeviceLayer, "FAIL: NULL service in %s", __func__)); + VerifyOrReturnError( + mService, BLE_ERROR_NOT_CHIP_DEVICE, + ChipLogError(DeviceLayer, "CHIP service (%s) not found on %s", Ble::CHIP_BLE_SERVICE_LONG_UUID_STR, GetPeerAddress())); - for (BluezObject & object : aEndpoint.mObjectManager.GetObjects()) + for (BluezObject & object : aEndpoint.mObjectManager.GetObjects()) + { + GAutoPtr chr(bluez_object_get_gatt_characteristic1(&object)); + if (chr && BluezIsCharOnService(chr.get(), mService.get())) { - BluezGattCharacteristic1 * char1 = bluez_object_get_gatt_characteristic1(&object); - if (char1 != nullptr) + if (strcmp(bluez_gatt_characteristic1_get_uuid(chr.get()), Ble::CHIP_BLE_CHAR_1_UUID_STR) == 0 && + BluezIsFlagOnChar(chr.get(), "write")) { - if ((BluezIsCharOnService(char1, mService.get()) == TRUE) && - (strcmp(bluez_gatt_characteristic1_get_uuid(char1), Ble::CHIP_BLE_CHAR_1_UUID_STR) == 0)) - { - mC1.reset(char1); - } - else if ((BluezIsCharOnService(char1, mService.get()) == TRUE) && - (strcmp(bluez_gatt_characteristic1_get_uuid(char1), Ble::CHIP_BLE_CHAR_2_UUID_STR) == 0)) - { - mC2.reset(char1); - } + ChipLogDetail(DeviceLayer, "Valid C1 characteristic found"); + mC1.reset(chr.release()); + } + else if (strcmp(bluez_gatt_characteristic1_get_uuid(chr.get()), Ble::CHIP_BLE_CHAR_2_UUID_STR) == 0 && + BluezIsFlagOnChar(chr.get(), "indicate")) + { + ChipLogDetail(DeviceLayer, "Valid C2 characteristic found"); + mC2.reset(chr.release()); + } #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING - else if ((BluezIsCharOnService(char1, mService.get()) == TRUE) && - (strcmp(bluez_gatt_characteristic1_get_uuid(char1), Ble::CHIP_BLE_CHAR_3_UUID_STR) == 0)) - { - mC3.reset(char1); - } -#endif - else - { - g_object_unref(char1); - } - if (mC1 && mC2) - { - break; - } + else if (strcmp(bluez_gatt_characteristic1_get_uuid(chr.get()), Ble::CHIP_BLE_CHAR_3_UUID_STR) == 0 && + BluezIsFlagOnChar(chr.get(), "read")) + { + ChipLogDetail(DeviceLayer, "Valid C3 characteristic found"); + mC3.reset(chr.release()); } +#endif } - - VerifyOrExit(mC1, ChipLogError(DeviceLayer, "FAIL: NULL C1 in %s", __func__)); - VerifyOrExit(mC2, ChipLogError(DeviceLayer, "FAIL: NULL C2 in %s", __func__)); } -exit: + VerifyOrReturnError(mC1, BLE_ERROR_NOT_CHIP_DEVICE, + ChipLogError(DeviceLayer, "No valid C1 (%s) on %s", Ble::CHIP_BLE_CHAR_1_UUID_STR, GetPeerAddress())); + VerifyOrReturnError(mC2, BLE_ERROR_NOT_CHIP_DEVICE, + ChipLogError(DeviceLayer, "No valid C2 (%s) on %s", Ble::CHIP_BLE_CHAR_2_UUID_STR, GetPeerAddress())); + return CHIP_NO_ERROR; } -CHIP_ERROR BluezConnection::BluezDisconnect(BluezConnection * conn) +CHIP_ERROR BluezConnection::CloseConnectionImpl(BluezConnection * conn) { GAutoPtr error; gboolean success; - ChipLogDetail(DeviceLayer, "%s peer=%s", __func__, conn->GetPeerAddress()); + ChipLogDetail(DeviceLayer, "Close BLE connection: peer=%s", conn->GetPeerAddress()); success = bluez_device1_call_disconnect_sync(conn->mDevice.get(), nullptr, &error.GetReceiver()); VerifyOrExit(success == TRUE, ChipLogError(DeviceLayer, "FAIL: Disconnect: %s", error->message)); @@ -162,7 +161,7 @@ CHIP_ERROR BluezConnection::BluezDisconnect(BluezConnection * conn) CHIP_ERROR BluezConnection::CloseConnection() { - return PlatformMgrImpl().GLibMatterContextInvokeSync(BluezDisconnect, this); + return PlatformMgrImpl().GLibMatterContextInvokeSync(CloseConnectionImpl, this); } const char * BluezConnection::GetPeerAddress() const diff --git a/src/platform/Linux/bluez/BluezConnection.h b/src/platform/Linux/bluez/BluezConnection.h index a967977a21cf39..f4efb3a5b22f2b 100644 --- a/src/platform/Linux/bluez/BluezConnection.h +++ b/src/platform/Linux/bluez/BluezConnection.h @@ -39,9 +39,11 @@ class BluezEndpoint; class BluezConnection { public: - BluezConnection(const BluezEndpoint & aEndpoint, BluezDevice1 & aDevice); + BluezConnection(BluezDevice1 & aDevice) : mDevice(reinterpret_cast(g_object_ref(&aDevice))) {} ~BluezConnection() = default; + CHIP_ERROR Init(const BluezEndpoint & aEndpoint); + const char * GetPeerAddress() const; uint16_t GetMTU() const { return mMtu; } @@ -97,9 +99,7 @@ class BluezConnection GAutoPtr mData; }; - CHIP_ERROR Init(const BluezEndpoint & aEndpoint); - - static CHIP_ERROR BluezDisconnect(BluezConnection * apConn); + static CHIP_ERROR CloseConnectionImpl(BluezConnection * apConn); static gboolean WriteHandlerCallback(GIOChannel * aChannel, GIOCondition aCond, BluezConnection * apConn); static gboolean NotifyHandlerCallback(GIOChannel * aChannel, GIOCondition aCond, BluezConnection * apConn); diff --git a/src/platform/Linux/bluez/BluezEndpoint.cpp b/src/platform/Linux/bluez/BluezEndpoint.cpp index 55b127e1b17014..9915abceb49712 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 { @@ -295,21 +299,21 @@ CHIP_ERROR BluezEndpoint::RegisterGattApplicationImpl() /// Update the table of open BLE connections whenever a new device is spotted or its attributes have changed. void BluezEndpoint::UpdateConnectionTable(BluezDevice1 & aDevice) { - const char * objectPath = g_dbus_proxy_get_object_path(reinterpret_cast(&aDevice)); - BluezConnection * connection = GetBluezConnection(objectPath); + const char * objectPath = g_dbus_proxy_get_object_path(reinterpret_cast(&aDevice)); + BluezConnection * conn = GetBluezConnection(objectPath); - if (connection != nullptr && !bluez_device1_get_connected(&aDevice)) + if (conn != nullptr && !bluez_device1_get_connected(&aDevice)) { - ChipLogDetail(DeviceLayer, "Bluez disconnected"); - BLEManagerImpl::CHIPoBluez_ConnectionClosed(connection); + ChipLogDetail(DeviceLayer, "BLE connection closed: conn=%p", conn); + BLEManagerImpl::HandleConnectionClosed(conn); mConnMap.erase(objectPath); // TODO: the connection object should be released after BLEManagerImpl finishes cleaning up its resources // after the disconnection. Releasing it here doesn't cause any issues, but it's error-prone. - chip::Platform::Delete(connection); + chip::Platform::Delete(conn); return; } - if (connection == nullptr) + if (conn == nullptr) { HandleNewDevice(aDevice); } @@ -319,6 +323,7 @@ void BluezEndpoint::HandleNewDevice(BluezDevice1 & aDevice) { VerifyOrReturn(bluez_device1_get_connected(&aDevice)); VerifyOrReturn(!mIsCentral || bluez_device1_get_services_resolved(&aDevice)); + CHIP_ERROR err; const char * objectPath = g_dbus_proxy_get_object_path(reinterpret_cast(&aDevice)); BluezConnection * conn = GetBluezConnection(objectPath); @@ -326,13 +331,21 @@ void BluezEndpoint::HandleNewDevice(BluezDevice1 & aDevice) ChipLogError(DeviceLayer, "FAIL: Connection already tracked: conn=%p device=%s path=%s", conn, conn->GetPeerAddress(), objectPath)); - conn = chip::Platform::New(*this, aDevice); + conn = chip::Platform::New(aDevice); + VerifyOrExit(conn != nullptr, err = CHIP_ERROR_NO_MEMORY); + SuccessOrExit(err = conn->Init(*this)); + mpPeerDevicePath = g_strdup(objectPath); mConnMap[mpPeerDevicePath] = conn; ChipLogDetail(DeviceLayer, "New BLE connection: conn=%p device=%s path=%s", conn, conn->GetPeerAddress(), objectPath); BLEManagerImpl::HandleNewConnection(conn); + return; + +exit: + chip::Platform::Delete(conn); + BLEManagerImpl::HandleConnectFailed(err); } void BluezEndpoint::OnDeviceAdded(BluezDevice1 & device) @@ -413,7 +426,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); @@ -433,7 +446,7 @@ void BluezEndpoint::SetupGattService() { static const char * const c1_flags[] = { "write", nullptr }; - static const char * const c2_flags[] = { "read", "indicate", nullptr }; + static const char * const c2_flags[] = { "indicate", nullptr }; #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING static const char * const c3_flags[] = { "read", nullptr }; #endif diff --git a/src/platform/nxp/common/ConnectivityManagerImpl.cpp b/src/platform/nxp/common/ConnectivityManagerImpl.cpp index c9d2861686b143..79abd4e9648dca 100644 --- a/src/platform/nxp/common/ConnectivityManagerImpl.cpp +++ b/src/platform/nxp/common/ConnectivityManagerImpl.cpp @@ -618,6 +618,16 @@ CHIP_ERROR ConnectivityManagerImpl::_DisconnectNetwork(void) return err; } + +#if CHIP_CONFIG_ENABLE_ICD_SERVER +CHIP_ERROR ConnectivityManagerImpl::_SetPollingInterval(System::Clock::Milliseconds32 pollingInterval) +{ + /* + * ToDo: Call API to put device into sleep + */ + return CHIP_NO_ERROR; +} +#endif // CHIP_CONFIG_ENABLE_ICD_SERVER #endif } // namespace DeviceLayer diff --git a/src/platform/nxp/common/ConnectivityManagerImpl.h b/src/platform/nxp/common/ConnectivityManagerImpl.h index 49e4f66a13197b..82ce24f814d544 100644 --- a/src/platform/nxp/common/ConnectivityManagerImpl.h +++ b/src/platform/nxp/common/ConnectivityManagerImpl.h @@ -87,6 +87,9 @@ class ConnectivityManagerImpl final : public ConnectivityManager, #if CHIP_DEVICE_CONFIG_ENABLE_WPA void StartWiFiManagement(); +#if CHIP_CONFIG_ENABLE_ICD_SERVER + CHIP_ERROR _SetPollingInterval(System::Clock::Milliseconds32 pollingInterval); +#endif // CHIP_CONFIG_ENABLE_ICD_SERVER #if CHIP_ENABLE_OPENTHREAD Inet::InterfaceId GetExternalInterface(); Inet::InterfaceId GetThreadInterface(); diff --git a/src/platform/nxp/common/NXPConfig.cpp b/src/platform/nxp/common/NXPConfig.cpp index cc6f8d51ec1256..b047d8afebc5ae 100644 --- a/src/platform/nxp/common/NXPConfig.cpp +++ b/src/platform/nxp/common/NXPConfig.cpp @@ -84,14 +84,14 @@ typedef struct { uint16_t chipConfigRamBufferLen; uint16_t padding; - uint8_t chipConfigRamBuffer[CONFIG_CHIP_NVM_RAMBUFFER_SIZE_KEY_INT]; + uint8_t chipConfigRamBuffer[CONFIG_CHIP_NVM_RAMBUFFER_SIZE_KEY_INT] __attribute__((aligned(4))); } ChipConfigRamStructKeyInt; typedef struct { uint16_t chipConfigRamBufferLen; uint16_t padding; - uint8_t chipConfigRamBuffer[CONFIG_CHIP_NVM_RAMBUFFER_SIZE_KEY_STRING]; + uint8_t chipConfigRamBuffer[CONFIG_CHIP_NVM_RAMBUFFER_SIZE_KEY_STRING] __attribute__((aligned(4))); } ChipConfigRamStructKeyString; /* File system containing only integer keys */ @@ -193,6 +193,14 @@ CHIP_ERROR NXPConfig::Init() { if (!isInitialized) { + /* + * Make sure to check that read buffers are always 4 bytes aligned, + * as NXP flash drivers may mandate the alignment of dst read buffer to 4 bytes + */ + static_assert(alignof(chipConfigRamStructKeyInt.chipConfigRamBuffer) == 4, + "Wrong buffer alignment, it must be 4 bytes aligned"); + static_assert(alignof(chipConfigRamStructKeyString.chipConfigRamBuffer) == 4, + "Wrong buffer alignment, it must be 4 bytes aligned"); ramStorageInit(); #if (CHIP_PLAT_NVM_SUPPORT == CHIP_PLAT_NVM_FWK) diff --git a/src/platform/nxp/rt/rw61x/PlatformManagerImpl.cpp b/src/platform/nxp/rt/rw61x/PlatformManagerImpl.cpp index fb5b900f345b5d..085a10ea5f5fa3 100644 --- a/src/platform/nxp/rt/rw61x/PlatformManagerImpl.cpp +++ b/src/platform/nxp/rt/rw61x/PlatformManagerImpl.cpp @@ -50,6 +50,8 @@ #endif extern "C" void BOARD_InitHardware(void); +extern "C" void otPlatSetResetFunction(void (*fp)(void)); +extern "C" void initiateResetInIdle(void); #if CHIP_DEVICE_CONFIG_ENABLE_WPA @@ -205,6 +207,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) */ otPlatLogInit(); otPlatRadioInit(); + otPlatSetResetFunction(initiateResetInIdle); #endif #if CHIP_DEVICE_CONFIG_ENABLE_WPA @@ -307,6 +310,22 @@ bool PlatformManagerImpl::GetResetInIdleValue(void) return resetInIdle; } +extern "C" void initiateResetInIdle(void) +{ + PlatformMgr().Shutdown(); + PlatformMgrImpl().ScheduleResetInIdle(); +} + +extern "C" void scheduleResetInIdle(void) +{ + PlatformMgrImpl().ScheduleResetInIdle(); +} + +extern "C" bool getResetInIdleValue(void) +{ + return PlatformMgrImpl().GetResetInIdleValue(); +} + void PlatformManagerImpl::StopBLEConnectivity(void) {} void PlatformManagerImpl::_Shutdown() diff --git a/src/test_driver/linux-cirque/CommissioningFailureOnReportTest.py b/src/test_driver/linux-cirque/CommissioningFailureOnReportTest.py index 81f351778925d8..86a3eb70817f25 100755 --- a/src/test_driver/linux-cirque/CommissioningFailureOnReportTest.py +++ b/src/test_driver/linux-cirque/CommissioningFailureOnReportTest.py @@ -91,11 +91,11 @@ def run_controller_test(self): req_device_id = req_ids[0] - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = ("gdb -return-child-result -q -ex run -ex bt --args python3 " diff --git a/src/test_driver/linux-cirque/CommissioningFailureTest.py b/src/test_driver/linux-cirque/CommissioningFailureTest.py index aec2f753d74e2d..62fde118039e44 100755 --- a/src/test_driver/linux-cirque/CommissioningFailureTest.py +++ b/src/test_driver/linux-cirque/CommissioningFailureTest.py @@ -91,11 +91,11 @@ def run_controller_test(self): req_device_id = req_ids[0] - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = "gdb -return-child-result -q -ex run -ex bt --args python3 {} -t 150 -a {} --paa-trust-store-path {}".format( diff --git a/src/test_driver/linux-cirque/CommissioningTest.py b/src/test_driver/linux-cirque/CommissioningTest.py index d6cad0fb0303ec..57200bfa0ca58d 100755 --- a/src/test_driver/linux-cirque/CommissioningTest.py +++ b/src/test_driver/linux-cirque/CommissioningTest.py @@ -132,11 +132,11 @@ def run_controller_test(self): req_device_id = req_ids[0] - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = ("gdb -return-child-result -q -ex run -ex bt --args python3 " diff --git a/src/test_driver/linux-cirque/CommissioningWindowTest.py b/src/test_driver/linux-cirque/CommissioningWindowTest.py index fac5b5bda334dc..9cc76ffb239cb0 100755 --- a/src/test_driver/linux-cirque/CommissioningWindowTest.py +++ b/src/test_driver/linux-cirque/CommissioningWindowTest.py @@ -95,11 +95,11 @@ def run_controller_test(self): req_device_id = req_ids[0] - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = ("gdb -return-child-result -q -ex run -ex bt " diff --git a/src/test_driver/linux-cirque/FailsafeTest.py b/src/test_driver/linux-cirque/FailsafeTest.py index ab5e5e58b06eca..0fb7eaefb80614 100755 --- a/src/test_driver/linux-cirque/FailsafeTest.py +++ b/src/test_driver/linux-cirque/FailsafeTest.py @@ -91,11 +91,11 @@ def run_controller_test(self): req_device_id = req_ids[0] - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = "gdb -return-child-result -q -ex run -ex bt --args python3 {} -t 150 -a {} --paa-trust-store-path {}".format( diff --git a/src/test_driver/linux-cirque/MobileDeviceTest.py b/src/test_driver/linux-cirque/MobileDeviceTest.py index 2a7c0acc5d500a..a206dc31c25c03 100755 --- a/src/test_driver/linux-cirque/MobileDeviceTest.py +++ b/src/test_driver/linux-cirque/MobileDeviceTest.py @@ -91,11 +91,11 @@ def run_controller_test(self): req_device_id = req_ids[0] - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = ("gdb -batch -return-child-result -q -ex run -ex \"thread apply all bt\" " diff --git a/src/test_driver/linux-cirque/PythonCommissioningTest.py b/src/test_driver/linux-cirque/PythonCommissioningTest.py index fdb314d3858603..b6ef64e4fdf445 100755 --- a/src/test_driver/linux-cirque/PythonCommissioningTest.py +++ b/src/test_driver/linux-cirque/PythonCommissioningTest.py @@ -104,11 +104,11 @@ def run_controller_test(self): req_device_id = req_ids[0] - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = "gdb -return-child-result -q -ex run -ex bt --args python3 {} -t 150 -d {} --paa-trust-store-path {} --nodeid {}".format( diff --git a/src/test_driver/linux-cirque/SplitCommissioningTest.py b/src/test_driver/linux-cirque/SplitCommissioningTest.py index 78acabb7085ed7..372a61fccc6aed 100755 --- a/src/test_driver/linux-cirque/SplitCommissioningTest.py +++ b/src/test_driver/linux-cirque/SplitCommissioningTest.py @@ -98,11 +98,11 @@ def run_controller_test(self): req_device_id = req_ids[0] - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = ("gdb -return-child-result -q -ex run -ex bt --args python3 " diff --git a/src/test_driver/linux-cirque/SubscriptionResumptionCapacityTest.py b/src/test_driver/linux-cirque/SubscriptionResumptionCapacityTest.py index 04214ecea39de1..195e6c574f7b96 100755 --- a/src/test_driver/linux-cirque/SubscriptionResumptionCapacityTest.py +++ b/src/test_driver/linux-cirque/SubscriptionResumptionCapacityTest.py @@ -125,11 +125,11 @@ def run_subscription_resumption_capacity_test(self): self.reset_thread_devices(server_ids) for req_device_id in req_ids: - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command1 = ("gdb -batch -return-child-result -q -ex run -ex \"thread apply all bt\" " diff --git a/src/test_driver/linux-cirque/SubscriptionResumptionTest.py b/src/test_driver/linux-cirque/SubscriptionResumptionTest.py index 271a3b3deb0cfe..e7b8e1a7c76735 100755 --- a/src/test_driver/linux-cirque/SubscriptionResumptionTest.py +++ b/src/test_driver/linux-cirque/SubscriptionResumptionTest.py @@ -102,11 +102,11 @@ def run_subscription_resumption_test(self): req_device_id = req_ids[0] - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = ("gdb -batch -return-child-result -q -ex run -ex \"thread apply all bt\" " diff --git a/src/test_driver/linux-cirque/SubscriptionResumptionTimeoutTest.py b/src/test_driver/linux-cirque/SubscriptionResumptionTimeoutTest.py index 2d4d6bfddb9e4f..0c655ba51adae0 100755 --- a/src/test_driver/linux-cirque/SubscriptionResumptionTimeoutTest.py +++ b/src/test_driver/linux-cirque/SubscriptionResumptionTimeoutTest.py @@ -103,11 +103,11 @@ def run_subscription_resumption_timeout_test(self): req_device_id = req_ids[0] - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) - self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + self.execute_device_cmd(req_device_id, "pip3 install --break-system-packages {}".format(os.path.join( CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = ("gdb -batch -return-child-result -q -ex run -ex \"thread apply all bt\" " diff --git a/third_party/nxp/nxp_sdk.gni b/third_party/nxp/nxp_sdk.gni index da66a0d51c5721..cb27d5c7554c84 100644 --- a/third_party/nxp/nxp_sdk.gni +++ b/third_party/nxp/nxp_sdk.gni @@ -53,7 +53,7 @@ declare_args() { nxp_idle_mode_duration_s = 600 # 10min Idle Mode Interval nxp_active_mode_duration_ms = 10000 # 10s Active Mode Interval - nxp_active_mode_threshold_ms = 1000 # 1s Active Mode Threshold + nxp_active_mode_threshold_ms = 5000 # 5s Active Mode Threshold nxp_icd_supported_clients_per_fabric = 2 # 2 registration slots per fabric } diff --git a/third_party/nxp/rt_sdk/transceiver/app_transceiver_config.h b/third_party/nxp/rt_sdk/transceiver/app_transceiver_config.h index c4dd38750c2bd0..edeec45a19fd19 100644 --- a/third_party/nxp/rt_sdk/transceiver/app_transceiver_config.h +++ b/third_party/nxp/rt_sdk/transceiver/app_transceiver_config.h @@ -41,5 +41,6 @@ #endif /* WIFI_TRANSCEIVER_SUPPORT */ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#define CONFIG_BT_DEVICE_NAME "NXP BLE test" #include "edgefast_bluetooth_config.h" #endif /* CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE */ diff --git a/third_party/openthread/platforms/nxp/rt/rw61x/BUILD.gn b/third_party/openthread/platforms/nxp/rt/rw61x/BUILD.gn index 318276cc0aa666..c8054103122357 100644 --- a/third_party/openthread/platforms/nxp/rt/rw61x/BUILD.gn +++ b/third_party/openthread/platforms/nxp/rt/rw61x/BUILD.gn @@ -26,6 +26,7 @@ import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni") openthread_nxp_root = "${chip_root}/third_party/openthread/ot-nxp" config("openthread_rw61x_config") { + defines = [] include_dirs = [ "${openthread_nxp_root}/src/common", "${openthread_nxp_root}/src/common/br", @@ -38,7 +39,7 @@ config("openthread_rw61x_config") { include_dirs += [ "${openthread_nxp_root}/src/common/spinel" ] } if (chip_enable_wifi && chip_enable_openthread) { - defines = [ + defines += [ "OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1", "OPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1", "OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE=1", @@ -53,6 +54,10 @@ config("openthread_rw61x_config") { "OPENTHREAD_CONFIG_GENERIC_TASKLET_ENABLE=1", ] } + # ot cli configs + defines += [ + "OPENTHREAD_CONFIG_PING_SENDER_ENABLE=1" + ] } #Config used by the openthread stack to get the path to OpenthreadConfig.h