]> granicus.if.org Git - esp-idf/commitdiff
component/bt: some miscellaneous modifications for BLE
authorTree <island@espressif.com>
Wed, 26 Dec 2018 12:36:33 +0000 (20:36 +0800)
committerTree <island@espressif.com>
Wed, 26 Dec 2018 12:36:33 +0000 (20:36 +0800)
components/bt/Kconfig
components/bt/bluedroid/bta/dm/bta_dm_api.c
components/bt/bluedroid/bta/gatt/bta_gatt_common.c
components/bt/bluedroid/bta/include/bta/bta_gatt_common.h
components/bt/bluedroid/hci/include/hci/packet_fragmenter.h
components/bt/bluedroid/osi/include/osi/alarm.h
components/bt/bluedroid/osi/include/osi/thread.h

index ab44cf18de4277c0f2665057957253dd91989e1e..cf4f648b130f8ba5634c6566cc42c8edc6af6919 100644 (file)
@@ -286,6 +286,13 @@ config BTC_TASK_STACK_SIZE
     help
         This select btc task stack size
 
+config BTU_TASK_STACK_SIZE
+    int "Bluetooth Bluedroid Host Stack task stack size"
+    depends on BLUEDROID_ENABLED
+    default 4096
+    help
+        This select btu task stack size
+
 config BLUEDROID_MEM_DEBUG
     bool "Bluedroid memory debug"
     depends on BLUEDROID_ENABLED
index f4b1ac3f5cad72183bbb6a8e16829e9217e87982..c5d5440fc531275c74518f05881fb56706caabf9 100644 (file)
@@ -1222,10 +1222,11 @@ void BTA_DmBleSetAdvConfigRaw (UINT8 *p_raw_adv, UINT32 raw_adv_len,
     tBTA_DM_API_SET_ADV_CONFIG_RAW  *p_msg;
 
     if ((p_msg = (tBTA_DM_API_SET_ADV_CONFIG_RAW *)
-                 osi_malloc(sizeof(tBTA_DM_API_SET_ADV_CONFIG_RAW))) != NULL) {
+                 osi_malloc(sizeof(tBTA_DM_API_SET_ADV_CONFIG_RAW) + raw_adv_len)) != NULL) {
         p_msg->hdr.event = BTA_DM_API_BLE_SET_ADV_CONFIG_RAW_EVT;
         p_msg->p_adv_data_cback = p_adv_data_cback;
-        p_msg->p_raw_adv = p_raw_adv;
+        p_msg->p_raw_adv = (UINT8 *)(p_msg + 1);
+        memcpy(p_msg->p_raw_adv, p_raw_adv, raw_adv_len);
         p_msg->raw_adv_len = raw_adv_len;
 
         bta_sys_sendmsg(p_msg);
@@ -1307,10 +1308,11 @@ void BTA_DmBleSetScanRspRaw (UINT8 *p_raw_scan_rsp, UINT32 raw_scan_rsp_len,
     tBTA_DM_API_SET_ADV_CONFIG_RAW  *p_msg;
 
     if ((p_msg = (tBTA_DM_API_SET_ADV_CONFIG_RAW *)
-                 osi_malloc(sizeof(tBTA_DM_API_SET_ADV_CONFIG_RAW))) != NULL) {
+                 osi_malloc(sizeof(tBTA_DM_API_SET_ADV_CONFIG_RAW) + raw_scan_rsp_len)) != NULL) {
         p_msg->hdr.event = BTA_DM_API_BLE_SET_SCAN_RSP_RAW_EVT;
         p_msg->p_adv_data_cback = p_scan_rsp_data_cback;
-        p_msg->p_raw_adv = p_raw_scan_rsp;
+        p_msg->p_raw_adv = (UINT8 *)(p_msg + 1);
+        memcpy(p_msg->p_raw_adv, p_raw_scan_rsp, raw_scan_rsp_len);
         p_msg->raw_adv_len = raw_scan_rsp_len;
 
         bta_sys_sendmsg(p_msg);
index cd36966a58bfce7ca69debef1f286ba29e56cb58..10a58f58211d8a89447ac12ddde350c8396c9b3a 100644 (file)
 void BTA_GATT_SetLocalMTU(uint16_t mtu)
 {
     gatt_set_local_mtu(mtu);
-}
\ No newline at end of file
+}
+
+uint16_t BTA_GATT_GetLocalMTU(void)
+{
+    return gatt_get_local_mtu();
+}
+
index 96bd348021c02a23ac7dafce6a9f4219ce59f956..d4c60fe2b026cea61b318c76f7178aa3d650a7f6 100644 (file)
@@ -31,6 +31,8 @@ extern "C"
 
 extern void BTA_GATT_SetLocalMTU(uint16_t mtu);
 
+extern uint16_t BTA_GATT_GetLocalMTU(void);
+
 #ifdef __cplusplus
 }
 #endif
index 80b442f287824df7da8e5324740d412e7cd30747..285555427590bf16c17e8e954c0d094b7d4e911c 100644 (file)
@@ -46,7 +46,7 @@ typedef struct packet_fragmenter_t {
     // Release all resources associated with the fragmenter.
     void (*cleanup)(void);
 
-    // CHeck if Current fragmenter is ongoing
+    // Check if Current fragmenter is ongoing
     BT_HDR *(*fragment_current_packet)(void);
 
     // Fragments |packet| if necessary and hands off everything to the fragmented callback.
index 3dc177c7a1dfc44d1067c206ed73ab0b651e5348..a1d3fa8961bdf927df50ffa95f95dac652d107b0 100644 (file)
@@ -33,7 +33,7 @@ typedef enum {
     OSI_ALARM_ERR_INVALID_STATE = -3,
 } osi_alarm_err_t;
 
-#define ALARM_CBS_NUM   30
+#define ALARM_CBS_NUM   50
 #define ALARM_ID_BASE   1000
 
 int osi_alarm_create_mux(void);
index 1aa773c0184b4b86dd82b0917924faeaddecf6d1..e3b51ed281426d19f941a6d931b08cdc4838a611 100644 (file)
@@ -72,7 +72,7 @@ typedef enum {
 #define HCI_H4_QUEUE_LEN                1
 
 #define BTU_TASK_PINNED_TO_CORE         (TASK_PINNED_TO_CORE)
-#define BTU_TASK_STACK_SIZE             (4096 + BT_TASK_EXTRA_STACK_SIZE)
+#define BTU_TASK_STACK_SIZE             (CONFIG_BTU_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE)
 #define BTU_TASK_PRIO                   (configMAX_PRIORITIES - 5)
 #define BTU_TASK_NAME                   "btuT"
 #define BTU_QUEUE_LEN                   50