1 /* 2 * SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef _ESP_BLE_MESH_COMMON_API_H_ 8 #define _ESP_BLE_MESH_COMMON_API_H_ 9 10 #include "esp_ble_mesh_defs.h" 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 /** 17 * @brief Initialize BLE Mesh module. 18 * This API initializes provisioning capabilities and composition data information. 19 * 20 * @note After calling this API, the device needs to call esp_ble_mesh_prov_enable() 21 * to enable provisioning functionality again. 22 * 23 * @param[in] prov: Pointer to the device provisioning capabilities. This pointer must 24 * remain valid during the lifetime of the BLE Mesh device. 25 * @param[in] comp: Pointer to the device composition data information. This pointer 26 * must remain valid during the lifetime of the BLE Mesh device. 27 * 28 * @return ESP_OK on success or error code otherwise. 29 * 30 */ 31 esp_err_t esp_ble_mesh_init(esp_ble_mesh_prov_t *prov, esp_ble_mesh_comp_t *comp); 32 33 /** 34 * @brief De-initialize BLE Mesh module. 35 * 36 * @note 37 * 1. This function shall be invoked after esp_ble_mesh_client_model_deinit(). 38 * 2. This function is strictly forbidden to run in any BTC Task Context 39 * (e.g. registered Mesh Event Callback). 40 * 41 * @param[in] param: Pointer to the structure of BLE Mesh deinit parameters. 42 * 43 * @return ESP_OK on success or error code otherwise. 44 * 45 */ 46 esp_err_t esp_ble_mesh_deinit(esp_ble_mesh_deinit_param_t *param); 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif /* _ESP_BLE_MESH_COMMON_API_H_ */ 53