forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v1.2-branch][ESP32][cherry-pick]Cherry pick some necessary fixes for…
… v1.2-branch (project-chip#33161) * [1.1] Cherry pick Thread DNS client and memory leak fixes (project-chip#31457) * [app] Fix DeferredAttributePersister memory leak (project-chip#31075) * [app] Fix DeferredAttributePerister memory leak ScopedMemoryBuffer's Release() method was used instead of Free(). Add CHECK_RETURN_VALUE annotation to the Release() method to prevent from making such a mistake in the future. Signed-off-by: Damian Krolik <[email protected]> * Code review --------- Signed-off-by: Damian Krolik <[email protected]> (cherry picked from commit 3e8aeeb) * [OpenThread] Harden DNS record parsing (project-chip#31227) OpenThread applications would crash upon receiving an empty DNS TXT record. The reason was that the code for copying OT DNS service info object into Matter DnssdService object would not initialize the TXT entry count in the latter object in such a case. In the reported case, the Matter stack was presented an empty TXT record because OpenThread's DNS client received a TXT record with TTL 0 and it discarded its contents. Nevertheless, the issue could be reproduced by publishing Matter service without TXT entries and kicking off DNS query. 1. Initialize the TXT entry and subtype count properly in all scenarios. 2. Do not even process the service info object if an error was returned by OpenThread before. 3. Extract some boilerplate to a separate function to improve readability. Signed-off-by: Damian Krolik <[email protected]> (cherry picked from commit 76b6bb5) * ESP32: Add EndpointQueueFilter for ESP32 platform (project-chip#31440) * Add EndpointQueueFilter for ESP32 platform * Restyled by clang-format * Restyled by gn * fix compile error when disabling inet ipv4 * review changes * Restyled by clang-format * review changes * review changes --------- Co-authored-by: Restyled.io <[email protected]> * [ESP32] Limit number of returned WiFi scan results to configured limit (project-chip#30780) Scan results are allocated on the heap and on a resource critical device where heap is less, this may fail if there are a lot of APs in the vicinity. * [ESP32] Fix the threading issue in nimble (project-chip#29180) * [ESP32] Fix the threading issue in nimble Send ble connection error than executing in nimble thread context * comment explaining why we are posting connection error event * Adding a comment for kCHIPoBLEConnectionError * IM: Create ReadHandler after Session Establishment for Subscription Resumption (project-chip#30491) * IM: Create ReadHandler after Session Establishment for Subscription Resumption * Restyled by clang-format * Make SubscriptionResumptionHelper inherits from SubscriptionInfo * review changes * Rename Helper to SessionEstablisher * Restyled by clang-format * RAII changes * Restyled by clang-format --------- Co-authored-by: Restyled.io <[email protected]> * [ESP32] Fix adding NDEBUG flag to CPPFLAGS (project-chip#30763) In esp-idf, NDEBUG flag is added to CPPFLAGS only if assertions are disabled. Making this inline to that. * Add records of session establishment for subscription resumption (project-chip#31755) * Add records of session establishment for subscription resumption * Restyled by clang-format * review changes * Schedule subscription resumption when failing to establish the session in SubscriptionResumptionSessionEstablisher * Add option to set subscription timeout resumption retry interval seconds for Linux app Add cirque test for subscription resumption timeout * Restyled by clang-format * Restyled by autopep8 * Restyled by isort * fix CI building * Add test to the test list * add subscription resumption restries number to SubscriptionInfo struct * review changes * make resumption retries persistent * Restyled by clang-format * ci build fixes * try to fix cirque test --------- Co-authored-by: Restyled.io <[email protected]> * ESP32: check ap info in IsStationConnected (project-chip#31438) * Add checks for mOTInst in GenericThreadStackManagerImpl_OpenThread (project-chip#32482) * Add checks for mOTInst in GenericThreadStackManagerImpl_OpenThread * review changes * [ESP32] Fix few attributes with fixed quality in DeviceInfoProvider (project-chip#32893) * [ESP32] Fix few attributes with fixed quality in DeviceInfoProvider Fixed labels, supported locales, supported calendar types were being read from the nvs(flash) and during OTA its a hassle if one wants to upgrade these values. Added few APIs to set the data for these attributes in ESP32DeviceInfoProvider. * Restyled by clang-format * Restyled by prettier-markdown * fix the lint errors * Add back the original Device info provider which reads from the nvs Add StaticESP32DeviceInfoProvider along with APIs to set data Remove changes from example and add a guide along with usage --------- Co-authored-by: Restyled.io <[email protected]> * Implement BLE Manager Shutdown for nimble host (project-chip#33109) * [ESP32] Implement BLE Manager Shutdown for nimble host - Replace ble deinit imple in Esp32AppServer with BLEMgr().Shutdown() - Replace few ESP_LOG with ChipLog in Esp32AppServer - Move ble deinit kCommissioningComplete switch case - Make USE_BLE_ONLY_FOR_COMMISSIONING depends on BT_ENABLED * Restyled by clang-format * address reviews * Add checks for timer handler --------- Co-authored-by: Restyled.io <[email protected]> * [ESP32] Made a provision to generate esp_secure_cert partition in factory partition script. (project-chip#29840) * Made a provision to generate esp_secure_cert partition in factory partition script. - Added the provision to generate esp_secure_cert_partition based on option --dac-in-secure-cert. - Refactored some code of the existing script - made it more modular. * made outdir user governed * Added the support for onboarding paylaod in factory script (project-chip#31274) --------- Co-authored-by: Damian Królik <[email protected]> Co-authored-by: Wang Qixiang <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Shubham Patil <[email protected]> Co-authored-by: shripad621git <[email protected]>
- Loading branch information
1 parent
d3e48c6
commit c11bca8
Showing
38 changed files
with
1,455 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
## Providers Implemented for ESP32 Platform | ||
|
||
The ESP32 platform has implemented several providers that can be used with data | ||
stored in the factory or by setting fixed data. | ||
|
||
Below are the providers that have been implemented: | ||
|
||
- [Commissionable Data Provider](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32FactoryDataProvider.h#L47) | ||
This provider reads the discriminator and setup pincode related parameters | ||
from the factory partition. | ||
- [Device Attestation Credentials Provider](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32FactoryDataProvider.h#L56) | ||
This provider manages the attestation data. | ||
- [Device Instance Info Provider](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32FactoryDataProvider.h#L86) | ||
This provider reads basic device information from the factory partition. | ||
- [Device Info Provider](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32DeviceInfoProvider.h#L31) | ||
This provider provides fixed labels, supported calendar types, and supported | ||
locales from the factory partition. | ||
- [Supported Modes](https://github.com/project-chip/connectedhomeip/blob/master/examples/platform/esp32/mode-support/static-supported-modes-manager.h#L28) | ||
This provider offers the supported modes for the mode-select cluster. | ||
|
||
More information can be found in the [factory data guide](factory_data.md). | ||
|
||
### Device Info Provider | ||
|
||
Currently, there are two implementations for this provider: | ||
|
||
1. [Reads data stored in the factory partition](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32FactoryDataProvider.h#L56) | ||
_(This will be deprecated in the future)_ | ||
2. [Provides APIs to set fixed data that gets read later](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/StaticESP32DeviceInfoProvider.h) | ||
|
||
- New products should use the `StaticESP32DeviceInfoProvider`. Utilize the | ||
`Set...()` APIs to set the fixed data. | ||
- Existing products using the first implementation can continue to use it if | ||
they do not wish to change the data. | ||
- For products using the first implementation and wanting to change the fixed | ||
data via OTA, they should switch to the second implementation in the OTA | ||
image and use the `Set...()` APIs to set the fixed data. | ||
|
||
#### Example: | ||
|
||
```cpp | ||
#include <platform/ESP32/StaticESP32FactoryDataProvider.h> | ||
|
||
DeviceLayer::StaticESP32DeviceInfoProvider deviceInfoProvider; | ||
|
||
// Define array for Supported Calendar Types | ||
using namespace chip::app::Clusters::TimeFormatLocalization::CalendarTypeEnum; | ||
CalendarTypeEnum supportedCalendarTypes[] = { | ||
CalendarTypeEnum::kGregorian, CalendarTypeEnum::kCoptic, | ||
CalendarTypeEnum::kEthiopian, CalendarTypeEnum::kChinese, | ||
}; | ||
|
||
// Define array for Supported Locales | ||
const char* supportedLocales[] = { | ||
"en-US", | ||
"en-EU", | ||
}; | ||
|
||
// Define array for Fixed labels { EndpointId, Label, Value } | ||
struct StaticESP32DeviceInfoProvider::FixedLabelEntry fixedLabels[] = { | ||
{ 0, "Room", "Bedroom 2" }, | ||
{ 0, "Orientation", "North" }, | ||
{ 0, "Direction", "Up" }, | ||
}; | ||
|
||
Span<CalendarTypeEnum> sSupportedCalendarTypes(supportedCalendarTypes); | ||
Span<const char*> sSupportedLocales(supportedLocales); | ||
Span<StaticESP32DeviceInfoProvider::FixedLabelEntry> sFixedLabels(fixedLabels); | ||
|
||
{ | ||
deviceInfoProvider.SetSupportedLocales(sSupportedLocales); | ||
deviceInfoProvider.SetSupportedCalendarTypes(sSupportedCalendarTypes); | ||
deviceInfoProvider.SetFixedLabels(sFixedLabels); | ||
DeviceLayer::SetDeviceInfoProvider(&deviceInfoProvider); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.