mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'feature/btdm_bluedroid' into feature/btdm_a2dp
# Conflicts: # components/bt/bluedroid/bta/include/bta_api.h # components/bt/bluedroid/bta/include/bta_gattc_int.h # components/bt/bluedroid/hci/hci_hal_h4.c # components/bt/bluedroid/hci/hci_layer.c # components/bt/bluedroid/include/bt_target.h # components/bt/bluedroid/stack/btu/btu_init.c
This commit is contained in:
commit
50227f12fd
@ -8,11 +8,11 @@ config BT_ENABLED
|
|||||||
help
|
help
|
||||||
This compiles in the low-level BT stack.
|
This compiles in the low-level BT stack.
|
||||||
|
|
||||||
menu "BT_UTIL"
|
menu "BT UTILITY OPTION"
|
||||||
visible if BT_ENABLED
|
visible if BT_ENABLED
|
||||||
|
|
||||||
config BT_USE_ETS_PRINT
|
config BT_USE_ETS_PRINT
|
||||||
bool "BT USE ETS_PRINT"
|
bool "BT use print which has lock"
|
||||||
default y
|
default y
|
||||||
depends on BT_ENABLED
|
depends on BT_ENABLED
|
||||||
help
|
help
|
||||||
@ -20,6 +20,13 @@ config BT_USE_ETS_PRINT
|
|||||||
|
|
||||||
endmenu #menu
|
endmenu #menu
|
||||||
|
|
||||||
|
config BTC_TASK_STACK_SIZE
|
||||||
|
int "BT event (callback to application) task stack size"
|
||||||
|
default 2048
|
||||||
|
depends on BT_ENABLED
|
||||||
|
help
|
||||||
|
This select btc task stack size
|
||||||
|
|
||||||
#config BT_BTLE
|
#config BT_BTLE
|
||||||
# bool "Enable BTLE"
|
# bool "Enable BTLE"
|
||||||
# depends on BT_ENABLED
|
# depends on BT_ENABLED
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "bt_types.h"
|
#include "bt_types.h"
|
||||||
#include "btm_api.h"
|
#include "btm_api.h"
|
||||||
#include "uipc_msg.h"
|
#include "uipc_msg.h"
|
||||||
|
#include "sdp_api.h"
|
||||||
|
|
||||||
#if BLE_INCLUDED == TRUE
|
#if BLE_INCLUDED == TRUE
|
||||||
#include "btm_ble_api.h"
|
#include "btm_ble_api.h"
|
||||||
|
@ -77,12 +77,12 @@ typedef UINT16 tBTA_GATTC_INT_EVT;
|
|||||||
|
|
||||||
/* max client application GATTC can support */
|
/* max client application GATTC can support */
|
||||||
#ifndef BTA_GATTC_CL_MAX
|
#ifndef BTA_GATTC_CL_MAX
|
||||||
#define BTA_GATTC_CL_MAX 4 // 32
|
#define BTA_GATTC_CL_MAX 3 // 32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* max known devices GATTC can support */
|
/* max known devices GATTC can support */
|
||||||
#ifndef BTA_GATTC_KNOWN_SR_MAX
|
#ifndef BTA_GATTC_KNOWN_SR_MAX
|
||||||
#define BTA_GATTC_KNOWN_SR_MAX 4 // 10
|
#define BTA_GATTC_KNOWN_SR_MAX 3 // 10
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BTA_GATTC_CONN_MAX GATT_MAX_PHY_CHANNEL
|
#define BTA_GATTC_CONN_MAX GATT_MAX_PHY_CHANNEL
|
||||||
|
@ -17,11 +17,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bt_defs.h"
|
#include "bt_defs.h"
|
||||||
|
#include "thread.h"
|
||||||
#define BTC_TASK_QUEUE_NUM 20
|
|
||||||
#define BTC_TASK_STACK_SIZE 4096
|
|
||||||
#define BTC_TASK_NAME "btcT"
|
|
||||||
#define BTC_TASK_PRIO (configMAX_PRIORITIES - 5)
|
|
||||||
|
|
||||||
typedef struct btc_msg {
|
typedef struct btc_msg {
|
||||||
uint8_t sig; //event signal
|
uint8_t sig; //event signal
|
||||||
|
@ -101,8 +101,8 @@ static bool hal_open(const hci_hal_callbacks_t *upper_callbacks)
|
|||||||
|
|
||||||
hci_hal_env_init(HCI_HAL_SERIAL_BUFFER_SIZE, SIZE_MAX);
|
hci_hal_env_init(HCI_HAL_SERIAL_BUFFER_SIZE, SIZE_MAX);
|
||||||
|
|
||||||
xHciH4Queue = xQueueCreate(60, sizeof(BtTaskEvt_t));
|
xHciH4Queue = xQueueCreate(HCI_H4_QUEUE_NUM, sizeof(BtTaskEvt_t));
|
||||||
xTaskCreate(hci_hal_h4_rx_handler, "HciH4T", 1024 + 256, NULL, configMAX_PRIORITIES - 3, &xHciH4TaskHandle);
|
xTaskCreate(hci_hal_h4_rx_handler, HCI_H4_TASK_NAME, HCI_H4_TASK_STACK_SIZE, NULL, HCI_H4_TASK_PRIO, &xHciH4TaskHandle);
|
||||||
|
|
||||||
//register vhci host cb
|
//register vhci host cb
|
||||||
API_vhci_host_register_callback(&vhci_host_cb);
|
API_vhci_host_register_callback(&vhci_host_cb);
|
||||||
|
@ -113,8 +113,8 @@ int hci_start_up(void)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
xHciHostQueue = xQueueCreate(60, sizeof(BtTaskEvt_t));
|
xHciHostQueue = xQueueCreate(HCI_HOST_QUEUE_NUM, sizeof(BtTaskEvt_t));
|
||||||
xTaskCreate(hci_host_thread_handler, "HciHostT", (1024+256), NULL, configMAX_PRIORITIES - 3, &xHciHostTaskHandle);
|
xTaskCreate(hci_host_thread_handler, HCI_HOST_TASK_NAME, HCI_HOST_TASK_STACK_SIZE, NULL, HCI_HOST_TASK_PRIO, &xHciHostTaskHandle);
|
||||||
|
|
||||||
packet_fragmenter->init(&packet_fragmenter_callbacks);
|
packet_fragmenter->init(&packet_fragmenter_callbacks);
|
||||||
hal->open(&hal_callbacks);
|
hal->open(&hal_callbacks);
|
||||||
|
@ -403,7 +403,7 @@
|
|||||||
|
|
||||||
/* Includes SCO if TRUE */
|
/* Includes SCO if TRUE */
|
||||||
#ifndef BTM_SCO_INCLUDED
|
#ifndef BTM_SCO_INCLUDED
|
||||||
#define BTM_SCO_INCLUDED FALSE /* TRUE includes SCO code */
|
#define BTM_SCO_INCLUDED FALSE //TRUE /* TRUE includes SCO code */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Includes SCO if TRUE */
|
/* Includes SCO if TRUE */
|
||||||
@ -480,7 +480,7 @@
|
|||||||
|
|
||||||
/* The number of SCO links. */
|
/* The number of SCO links. */
|
||||||
#ifndef BTM_MAX_SCO_LINKS
|
#ifndef BTM_MAX_SCO_LINKS
|
||||||
#define BTM_MAX_SCO_LINKS 1
|
#define BTM_MAX_SCO_LINKS 1 //3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The preferred type of SCO links (2-eSCO, 0-SCO). */
|
/* The preferred type of SCO links (2-eSCO, 0-SCO). */
|
||||||
|
@ -43,6 +43,26 @@ enum {
|
|||||||
// SIG_BTIF_WORK = 0xff
|
// SIG_BTIF_WORK = 0xff
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define HCI_HOST_TASK_STACK_SIZE 1024
|
||||||
|
#define HCI_HOST_TASK_PRIO (configMAX_PRIORITIES - 3)
|
||||||
|
#define HCI_HOST_TASK_NAME "hciHostT"
|
||||||
|
#define HCI_HOST_QUEUE_NUM 30
|
||||||
|
|
||||||
|
#define HCI_H4_TASK_STACK_SIZE 1024
|
||||||
|
#define HCI_H4_TASK_PRIO (configMAX_PRIORITIES - 3)
|
||||||
|
#define HCI_H4_TASK_NAME "hciH4T"
|
||||||
|
#define HCI_H4_QUEUE_NUM 30
|
||||||
|
|
||||||
|
#define BTU_TASK_STACK_SIZE 4096
|
||||||
|
#define BTU_TASK_PRIO (configMAX_PRIORITIES - 1)
|
||||||
|
#define BTU_TASK_NAME "btuT"
|
||||||
|
#define BTU_QUEUE_NUM 30
|
||||||
|
|
||||||
|
#define BTC_TASK_QUEUE_NUM 20
|
||||||
|
#define BTC_TASK_STACK_SIZE CONFIG_BTC_TASK_STACK_SIZE //by menuconfig
|
||||||
|
#define BTC_TASK_NAME "btcT"
|
||||||
|
#define BTC_TASK_PRIO (configMAX_PRIORITIES - 5)
|
||||||
|
|
||||||
void btu_task_post(uint32_t sig);
|
void btu_task_post(uint32_t sig);
|
||||||
void hci_host_task_post(void);
|
void hci_host_task_post(void);
|
||||||
void hci_hal_h4_task_post(void);
|
void hci_hal_h4_task_post(void);
|
||||||
|
@ -2615,13 +2615,15 @@ BOOLEAN btm_ble_update_inq_result(tINQ_DB_ENT *p_i, UINT8 addr_type, UINT8 evt_t
|
|||||||
BTM_BLE_AD_TYPE_16SRV_CMPL, &len)) != NULL) {
|
BTM_BLE_AD_TYPE_16SRV_CMPL, &len)) != NULL) {
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
for (i = 0; i + 2 <= len; i = i + 2) {
|
for (i = 0; i + 2 <= len; i = i + 2) {
|
||||||
/* if this BLE device support HID over LE, set HID Major in class of device */
|
#if BTA_HH_LE_INCLUDED == TRUE
|
||||||
|
/* if this BLE device support HID over LE, set HID Major in class of device */
|
||||||
if ((p_uuid16[i] | (p_uuid16[i + 1] << 8)) == UUID_SERVCLASS_LE_HID) {
|
if ((p_uuid16[i] | (p_uuid16[i + 1] << 8)) == UUID_SERVCLASS_LE_HID) {
|
||||||
p_cur->dev_class[0] = 0;
|
p_cur->dev_class[0] = 0;
|
||||||
p_cur->dev_class[1] = BTM_COD_MAJOR_PERIPHERAL;
|
p_cur->dev_class[1] = BTM_COD_MAJOR_PERIPHERAL;
|
||||||
p_cur->dev_class[2] = 0;
|
p_cur->dev_class[2] = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif /* BTA_HH_LE_INCLUDED */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,9 +200,8 @@ void BTU_StartUp(void)
|
|||||||
goto error_exit;
|
goto error_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
xBtuQueue = xQueueCreate(60, sizeof(BtTaskEvt_t));
|
xBtuQueue = xQueueCreate(BTU_QUEUE_NUM, sizeof(BtTaskEvt_t));
|
||||||
xTaskCreate(btu_task_thread_handler, "BtuT", 2048 + 1024, NULL, configMAX_PRIORITIES - 1, &xBtuTaskHandle);
|
xTaskCreate(btu_task_thread_handler, BTU_TASK_NAME, BTU_TASK_STACK_SIZE, NULL, BTU_TASK_PRIO, &xBtuTaskHandle);
|
||||||
|
|
||||||
btu_task_post(SIG_BTU_START_UP);
|
btu_task_post(SIG_BTU_START_UP);
|
||||||
/*
|
/*
|
||||||
// Continue startup on bt workqueue thread.
|
// Continue startup on bt workqueue thread.
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "gatt_int.h"
|
#include "gatt_int.h"
|
||||||
#include "btm_int.h"
|
#include "btm_int.h"
|
||||||
#include "hcimsgs.h"
|
#include "hcimsgs.h"
|
||||||
|
#include "sdpdefs.h"
|
||||||
|
|
||||||
#define GAP_CHAR_ICON_SIZE 2
|
#define GAP_CHAR_ICON_SIZE 2
|
||||||
#define GAP_CHAR_DEV_NAME_SIZE 248
|
#define GAP_CHAR_DEV_NAME_SIZE 248
|
||||||
|
@ -33,7 +33,8 @@
|
|||||||
#include "gatt_int.h"
|
#include "gatt_int.h"
|
||||||
#include "l2c_api.h"
|
#include "l2c_api.h"
|
||||||
#include "btm_int.h"
|
#include "btm_int.h"
|
||||||
|
#include "sdpdefs.h"
|
||||||
|
#include "sdp_api.h"
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "gatt_api.h"
|
#include "gatt_api.h"
|
||||||
#include "gatt_int.h"
|
#include "gatt_int.h"
|
||||||
|
#include "sdpdefs.h"
|
||||||
|
|
||||||
#if BLE_INCLUDED == TRUE
|
#if BLE_INCLUDED == TRUE
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#ifndef GAP_API_H
|
#ifndef GAP_API_H
|
||||||
#define GAP_API_H
|
#define GAP_API_H
|
||||||
|
|
||||||
|
#include "sdpdefs.h"
|
||||||
#include "profiles_api.h"
|
#include "profiles_api.h"
|
||||||
#include "btm_api.h"
|
#include "btm_api.h"
|
||||||
#include "l2c_api.h"
|
#include "l2c_api.h"
|
||||||
|
@ -83,7 +83,7 @@ COMPONENT_SRCDIRS := bluedroid/bta/dm \
|
|||||||
bluedroid \
|
bluedroid \
|
||||||
.
|
.
|
||||||
|
|
||||||
include $(IDF_PATH)/make/component_common.mk
|
#include $(IDF_PATH)/make/component_common.mk
|
||||||
|
|
||||||
ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
|
ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
|
||||||
$(COMPONENT_LIBRARY): $(ALL_LIB_FILES)
|
$(COMPONENT_LIBRARY): $(ALL_LIB_FILES)
|
||||||
|
@ -27,4 +27,4 @@ COMPONENT_SRCDIRS := \
|
|||||||
CFLAGS += -Wno-error=unused-label -Wno-error=return-type -Wno-error=missing-braces -Wno-error=pointer-sign -Wno-error=parentheses -I./include
|
CFLAGS += -Wno-error=unused-label -Wno-error=return-type -Wno-error=missing-braces -Wno-error=pointer-sign -Wno-error=parentheses -I./include
|
||||||
|
|
||||||
|
|
||||||
include $(IDF_PATH)/make/component_common.mk
|
#include $(IDF_PATH)/make/component_common.mk
|
||||||
|
Loading…
x
Reference in New Issue
Block a user