1 /* 2 * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __ESP_BT_DEVICE_H__ 8 #define __ESP_BT_DEVICE_H__ 9 10 #include <stdint.h> 11 #include <stdbool.h> 12 #include "esp_err.h" 13 #include "esp_bt_defs.h" 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 /** 20 * 21 * @brief Get bluetooth device address. Must use after "esp_bluedroid_enable". 22 * 23 * @return bluetooth device address (six bytes), or NULL if bluetooth stack is not enabled 24 */ 25 const uint8_t *esp_bt_dev_get_address(void); 26 27 28 /** 29 * @brief Set bluetooth device name. This function should be called after esp_bluedroid_enable() 30 * completes successfully. 31 * 32 * A BR/EDR/LE device type shall have a single Bluetooth device name which shall be 33 * identical irrespective of the physical channel used to perform the name discovery procedure. 34 * 35 * @param[in] name : device name to be set 36 * 37 * @return 38 * - ESP_OK : Succeed 39 * - ESP_ERR_INVALID_ARG : if name is NULL pointer or empty, or string length out of limit 40 * - ESP_ERR_INVALID_STATE : if bluetooth stack is not yet enabled 41 * - ESP_FAIL : others 42 */ 43 esp_err_t esp_bt_dev_set_device_name(const char *name); 44 45 #ifdef __cplusplus 46 } 47 #endif 48 49 50 #endif /* __ESP_BT_DEVICE_H__ */ 51