feat(openthread): Add dataset changed event and post it in state change callback

This commit is contained in:
WanqQixiang
2024-10-31 14:53:33 +08:00
parent 1acc70f476
commit 77656e2046
2 changed files with 44 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -46,6 +46,7 @@ typedef enum {
OPENTHREAD_EVENT_SET_DNS_SERVER, /*!< OpenThread stack set DNS server >*/
OPENTHREAD_EVENT_PUBLISH_MESHCOP_E, /*!< OpenThread stack start to publish meshcop-e service >*/
OPENTHREAD_EVENT_REMOVE_MESHCOP_E, /*!< OpenThread stack start to remove meshcop-e service >*/
OPENTHREAD_EVENT_DATASET_CHANGED, /*!< OpenThread dataset changed >*/
} esp_openthread_event_t;
/**
@@ -63,6 +64,24 @@ typedef struct {
otDeviceRole current_role; /*!< Current Thread role */
} esp_openthread_role_changed_event_t;
/**
* @brief OpenThread dataset type
*
*/
typedef enum {
OPENTHREAD_ACTIVE_DATASET, /*!< Active dataset */
OPENTHREAD_PENDING_DATASET, /*!< Pending dataset */
} esp_openthread_dataset_type_t;
/**
* @brief OpenThread dataset changed event data
*
*/
typedef struct {
esp_openthread_dataset_type_t type; /*!< Dataset type */
otOperationalDataset new_dataset; /*!< New dataset */
} esp_openthread_dataset_changed_event_t;
/**
* This structure represents a context for a select() based mainloop.
*