mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
component/bt : main api
1. use blufi check main api ok
This commit is contained in:
parent
21d2b78105
commit
8fed003ce5
26
components/bt/bluedroid/api/esp_bt_main.c
Normal file
26
components/bt/bluedroid/api/esp_bt_main.c
Normal file
@ -0,0 +1,26 @@
|
||||
#include "esp_bt_main.h"
|
||||
|
||||
|
||||
|
||||
esp_err_t esp_enable_bluetooth(esp_bt_sec_cb_t *p_cback)
|
||||
{
|
||||
return btc_enable_bluetooth(p_cback) == BT_STATUS_SUCCESS ? ESP_OK: ESP_FAIL;
|
||||
}
|
||||
|
||||
esp_err_t esp_disable_bluetooth(void)
|
||||
{
|
||||
return btc_disable_bluetooth() == BT_STATUS_SUCCESS ? ESP_OK: ESP_FAIL;
|
||||
}
|
||||
|
||||
esp_err_t esp_init_bluetooth(bluetooth_init_cb_t cb)
|
||||
{
|
||||
return btc_init_bluetooth(cb) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
|
||||
void esp_deinit_bluetooth(void)
|
||||
{
|
||||
btc_deinit_bluetooth();
|
||||
}
|
||||
|
||||
|
16
components/bt/bluedroid/api/include/esp_bt_main.h
Normal file
16
components/bt/bluedroid/api/include/esp_bt_main.h
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef __ESP_BT_MAIN_H__
|
||||
#define __ESP_BT_MAIN_H__
|
||||
|
||||
#include "btc_main.h"
|
||||
#include "esp_err.h"
|
||||
|
||||
esp_err_t esp_enable_bluetooth(esp_bt_sec_cb_t *p_cback);
|
||||
|
||||
esp_err_t esp_disable_bluetooth(void);
|
||||
|
||||
esp_err_t esp_init_bluetooth(bluetooth_init_cb_t cb);
|
||||
|
||||
void esp_deinit_bluetooth(void);
|
||||
|
||||
|
||||
#endif /* __ESP_BT_MAIN_H__ */
|
@ -16,7 +16,7 @@ bt_status_t btc_disable_bluetooth(void)
|
||||
|
||||
bt_status_t btc_init_bluetooth(bluetooth_init_cb_t cb)
|
||||
{
|
||||
return bte_main_boot_entry(cb) == 0 ? ESP_OK : ESP_FAIL;
|
||||
return bte_main_boot_entry(cb) == 0 ? BT_STATUS_SUCCESS : BT_STATUS_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "blufi_adv.h"
|
||||
|
||||
#include "esp_bt_defs.h"
|
||||
#include "esp_bt_main.h"
|
||||
|
||||
static void BlufiDataCallBack(UINT8 app_id, UINT8 event, UINT8 len, UINT8 *p_data);
|
||||
|
||||
|
@ -26,7 +26,8 @@
|
||||
#include "bt.h"
|
||||
#include "bta_api.h"
|
||||
|
||||
#include "esp_bt_common.h"
|
||||
#include "esp_bt_defs.h"
|
||||
#include "esp_bt_main.h"
|
||||
#include "blufi.h"
|
||||
|
||||
#define WIFI_LIST_NUM 10
|
||||
|
Loading…
x
Reference in New Issue
Block a user