mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Component/bt: modify mtu api in spp client demo
This commit is contained in:
parent
5aa52709c2
commit
31cb284967
@ -36,6 +36,7 @@
|
|||||||
#include "esp_bt_main.h"
|
#include "esp_bt_main.h"
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include "btc_main.h"
|
#include "btc_main.h"
|
||||||
|
#include "esp_gatt_common_api.h"
|
||||||
|
|
||||||
#define GATTC_TAG "GATTC_SPP_DEMO"
|
#define GATTC_TAG "GATTC_SPP_DEMO"
|
||||||
#define PROFILE_NUM 1
|
#define PROFILE_NUM 1
|
||||||
@ -727,7 +728,7 @@ static void gattc_profile_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_
|
|||||||
break;
|
break;
|
||||||
case ESP_GATTC_SEARCH_CMPL_EVT:
|
case ESP_GATTC_SEARCH_CMPL_EVT:
|
||||||
ESP_LOGI(GATTC_TAG, "SEARCH_CMPL: conn_id = %x, status %d", spp_conn_id, p_data->search_cmpl.status);
|
ESP_LOGI(GATTC_TAG, "SEARCH_CMPL: conn_id = %x, status %d", spp_conn_id, p_data->search_cmpl.status);
|
||||||
esp_ble_gattc_config_mtu(gattc_if,spp_conn_id, 200);
|
esp_ble_gattc_send_mtu_req(gattc_if,spp_conn_id);
|
||||||
break;
|
break;
|
||||||
case ESP_GATTC_GET_CHAR_EVT:
|
case ESP_GATTC_GET_CHAR_EVT:
|
||||||
if (p_data->get_char.status != ESP_GATT_OK) {
|
if (p_data->get_char.status != ESP_GATT_OK) {
|
||||||
@ -887,6 +888,11 @@ void ble_client_appRegister(void)
|
|||||||
}
|
}
|
||||||
esp_ble_gattc_app_register(PROFILE_APP_ID);
|
esp_ble_gattc_app_register(PROFILE_APP_ID);
|
||||||
|
|
||||||
|
esp_err_t local_mtu_ret = esp_ble_gatt_set_local_mtu(200);
|
||||||
|
if (local_mtu_ret){
|
||||||
|
ESP_LOGE(GATTC_TAG, "set local MTU failed, error code = %x", local_mtu_ret);
|
||||||
|
}
|
||||||
|
|
||||||
cmd_reg_queue = xQueueCreate(10, sizeof(uint32_t));
|
cmd_reg_queue = xQueueCreate(10, sizeof(uint32_t));
|
||||||
xTaskCreate(spp_client_reg_task, "spp_client_reg_task", 2048, NULL, 10, NULL);
|
xTaskCreate(spp_client_reg_task, "spp_client_reg_task", 2048, NULL, 10, NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user