mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Merge branch 'feat/v1.4/discovery_timeout' into 'release/v1.4'
Add new API to configure ServerInitParams See merge request app-frameworks/esp-matter!1218
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ variables:
|
||||
IDF_CHECKOUT_REF: "v5.4.1"
|
||||
# This variable represents the short hash of the connectedhomeip submodule.
|
||||
# Note: Do change this short hash on submodule update MRs.
|
||||
CHIP_SHORT_HASH: "87cf8e5030"
|
||||
CHIP_SHORT_HASH: "7a54749dc9"
|
||||
DOCKER_IMAGE_NAME: "espressif/chip-idf"
|
||||
|
||||
.add_gitlab_ssh_key: &add_gitlab_ssh_key |
|
||||
|
||||
@@ -28,7 +28,7 @@ section in the ESP-Matter Programming Guide.
|
||||
|
||||
## Supported ESP-IDF and connectedhomeip versions
|
||||
|
||||
- This SDK currently works with commit [87cf8e5030](https://github.com/project-chip/connectedhomeip/tree/87cf8e5030) of connectedhomeip.
|
||||
- This SDK currently works with commit [7a54749dc9](https://github.com/project-chip/connectedhomeip/tree/7a54749dc9) of connectedhomeip.
|
||||
- For Matter projects development with this SDK, it is recommended to utilize ESP-IDF [v5.4.1](https://github.com/espressif/esp-idf/tree/v5.4.1).
|
||||
|
||||
## Documentation
|
||||
|
||||
@@ -66,6 +66,7 @@ using chip::DeviceLayer::ThreadStackMgr;
|
||||
|
||||
static const char *TAG = "esp_matter_core";
|
||||
static bool esp_matter_started = false;
|
||||
static chip::CommonCaseDeviceServerInitParams *s_server_init_params = nullptr;
|
||||
|
||||
#ifndef CONFIG_ESP_MATTER_ENABLE_MATTER_SERVER
|
||||
// If Matter Server is disabled, these functions are required by InteractionModelEngine but not linked
|
||||
@@ -734,11 +735,18 @@ static void deinit_ble_if_commissioned(intptr_t unused)
|
||||
static void esp_matter_chip_init_task(intptr_t context)
|
||||
{
|
||||
TaskHandle_t task_to_notify = reinterpret_cast<TaskHandle_t>(context);
|
||||
static chip::CommonCaseDeviceServerInitParams initParams;
|
||||
static chip::CommonCaseDeviceServerInitParams defaultInitParams;
|
||||
|
||||
chip::CommonCaseDeviceServerInitParams &initParams =
|
||||
s_server_init_params ? *s_server_init_params : defaultInitParams;
|
||||
|
||||
initParams.InitializeStaticResourcesBeforeServerInit();
|
||||
initParams.appDelegate = &s_app_delegate;
|
||||
initParams.testEventTriggerDelegate = test_event_trigger::get_delegate();
|
||||
if (!initParams.appDelegate) {
|
||||
initParams.appDelegate = &s_app_delegate;
|
||||
}
|
||||
if (!initParams.testEventTriggerDelegate) {
|
||||
initParams.testEventTriggerDelegate = test_event_trigger::get_delegate();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ESP_MATTER_ENABLE_DATA_MODEL
|
||||
// Group data provider injection for dynamic data model
|
||||
@@ -891,6 +899,13 @@ bool is_started()
|
||||
return esp_matter_started;
|
||||
}
|
||||
|
||||
esp_err_t set_server_init_params(chip::CommonCaseDeviceServerInitParams *server_init_params)
|
||||
{
|
||||
VerifyOrReturnError(!esp_matter_started, ESP_ERR_INVALID_STATE, ESP_LOGE(TAG, "esp_matter has started"));
|
||||
s_server_init_params = server_init_params;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t start(event_callback_t callback, intptr_t callback_arg)
|
||||
{
|
||||
VerifyOrReturnError(!esp_matter_started, ESP_ERR_INVALID_STATE, ESP_LOGE(TAG, "esp_matter has started"));
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <app/AttributePathParams.h>
|
||||
#include <app/CommandPathParams.h>
|
||||
#include <app/EventPathParams.h>
|
||||
#include <app/server/Server.h>
|
||||
|
||||
using chip::app::ConcreteCommandPath;
|
||||
using chip::DeviceLayer::ChipDeviceEvent;
|
||||
@@ -45,6 +46,30 @@ typedef handle_t command_t;
|
||||
/** Event handle */
|
||||
typedef handle_t event_t;
|
||||
|
||||
/**
|
||||
* @brief Set the server initialization parameters for Matter.
|
||||
*
|
||||
* This function must be called before Matter is started. `esp_matter::start()`
|
||||
* Calling it after Matter has started will have no effect and will return an error.
|
||||
*
|
||||
* @note Starting Matter without valid initialization parameters may lead to undefined behavior or startup failure.
|
||||
*
|
||||
* @note The provided pointer is stored internally and used later during Matter initialization.
|
||||
* It is not copied, so the caller must ensure that the memory pointed to by `server_init_params`
|
||||
* remains valid and unmodified until Matter is started.
|
||||
*
|
||||
* @note If this function is called with a `nullptr`, it will still return ESP_OK. The system
|
||||
* will proceed with default initialization behavior.
|
||||
*
|
||||
* @param[in] server_init_params Pointer to the server initialization parameters. May be nullptr.
|
||||
*
|
||||
* @return ESP_OK Successfully set the server initialization parameters.
|
||||
* @return ESP_ERR_INVALID_STATE If called after Matter has already started.
|
||||
* @return error in case of failure.
|
||||
*/
|
||||
|
||||
esp_err_t set_server_init_params(chip::CommonCaseDeviceServerInitParams *server_init_params);
|
||||
|
||||
/** Event callback
|
||||
*
|
||||
* @param[in] event event data pointer.
|
||||
|
||||
Submodule connectedhomeip/connectedhomeip updated: 87cf8e5030...7a54749dc9
Reference in New Issue
Block a user