From 1086976b7461bc6891dc4dd93acc4b4f3895b551 Mon Sep 17 00:00:00 2001 From: Praveen Chandran Date: Wed, 21 Sep 2022 17:05:16 -0700 Subject: [PATCH] [Infineon] KeyValue Storage write fix for Door Lock credentials (#22777) * [Infineon] KeyValue Storage write fix for Door Lock credentials * [Infineon] Add Infineon build badge to README.md Co-authored-by: Andrei Litvin --- README.md | 1 + examples/lock-app/infineon/psoc6/src/AppTask.cpp | 3 +++ src/platform/Infineon/PSOC6/P6Config.cpp | 2 +- third_party/infineon/psoc6/psoc6_sdk/libs/btstack | 2 +- third_party/infineon/psoc6/psoc6_sdk/libs/wifi-host-driver | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0d0a517dc39aa5..d4447b731a1f00 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ [![Examples - nRF Connect SDK](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20nRF%20Connect%20SDK/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-nrfconnect.yaml) [![Examples - QPG](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20QPG/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-qpg.yaml) [![Examples - TI CC26X2X7](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20TI%20CC26X2X7/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-cc13x2x7_26x2x7.yaml) +[![Build example - Infineon](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-infineon.yaml/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-infineon.yaml) [![Android](https://github.com/project-chip/connectedhomeip/workflows/Android/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/android.yaml) diff --git a/examples/lock-app/infineon/psoc6/src/AppTask.cpp b/examples/lock-app/infineon/psoc6/src/AppTask.cpp index 75a62037caad22..b0dbc3e26d6a3e 100644 --- a/examples/lock-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/lock-app/infineon/psoc6/src/AppTask.cpp @@ -331,6 +331,9 @@ void AppTask::AppTaskMain(void * pvParameter) P6_LOG("App Task started"); + // Users and credentials should be checked once from flash on boot + LockMgr().ReadConfigValues(); + while (true) { BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, portMAX_DELAY); diff --git a/src/platform/Infineon/PSOC6/P6Config.cpp b/src/platform/Infineon/PSOC6/P6Config.cpp index 2a4b48df11bf3e..2ef8a5ed038476 100644 --- a/src/platform/Infineon/PSOC6/P6Config.cpp +++ b/src/platform/Infineon/PSOC6/P6Config.cpp @@ -198,7 +198,7 @@ CHIP_ERROR P6Config::WriteConfigValueBin(Key key, const uint8_t * data, size_t d { char key_str[MTB_KVSTORE_MAX_KEY_SIZE] = { 0 }; key.to_str(key_str, MTB_KVSTORE_MAX_KEY_SIZE); - return PersistedStorage::KeyValueStoreMgr().Put(key_str, static_cast(&data), dataLen); + return PersistedStorage::KeyValueStoreMgr().Put(key_str, data, dataLen); } CHIP_ERROR P6Config::ClearConfigValue(Key key) diff --git a/third_party/infineon/psoc6/psoc6_sdk/libs/btstack b/third_party/infineon/psoc6/psoc6_sdk/libs/btstack index 34e7ee4b7de542..205412d987da3f 160000 --- a/third_party/infineon/psoc6/psoc6_sdk/libs/btstack +++ b/third_party/infineon/psoc6/psoc6_sdk/libs/btstack @@ -1 +1 @@ -Subproject commit 34e7ee4b7de542a9f8f779389eccc2a3886c3dbf +Subproject commit 205412d987da3f397201580ac2f98918d1bb0d57 diff --git a/third_party/infineon/psoc6/psoc6_sdk/libs/wifi-host-driver b/third_party/infineon/psoc6/psoc6_sdk/libs/wifi-host-driver index d2a12226145f63..40a7ec2273a950 160000 --- a/third_party/infineon/psoc6/psoc6_sdk/libs/wifi-host-driver +++ b/third_party/infineon/psoc6/psoc6_sdk/libs/wifi-host-driver @@ -1 +1 @@ -Subproject commit d2a12226145f63d870ef789ee88a1d9a28edcee0 +Subproject commit 40a7ec2273a950fbf89353d3eac98c5c1c2fd8cd