1 /* 2 * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __ESP_GATT_COMMON_API_H__ 8 #define __ESP_GATT_COMMON_API_H__ 9 10 #include <stdint.h> 11 #include <stdbool.h> 12 13 #include "esp_err.h" 14 #include "esp_bt_defs.h" 15 16 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 20 // Maximum Transmission Unit used in GATT 21 #define ESP_GATT_DEF_BLE_MTU_SIZE 23 /* relate to GATT_DEF_BLE_MTU_SIZE in stack/gatt_api.h */ 22 23 // Maximum Transmission Unit allowed in GATT 24 #define ESP_GATT_MAX_MTU_SIZE 517 /* relate to GATT_MAX_MTU_SIZE in stack/gatt_api.h */ 25 26 /** 27 * @brief This function is called to set local MTU, 28 * the function is called before BLE connection. 29 * 30 * @param[in] mtu: the size of MTU. 31 * 32 * @return 33 * - ESP_OK: success 34 * - other: failed 35 * 36 */ 37 extern esp_err_t esp_ble_gatt_set_local_mtu (uint16_t mtu); 38 39 #if (BLE_INCLUDED == TRUE) 40 extern uint16_t esp_ble_get_sendable_packets_num (void); 41 extern uint16_t esp_ble_get_cur_sendable_packets_num (uint16_t connid); 42 #endif 43 44 #ifdef __cplusplus 45 } 46 #endif 47 48 #endif /* __ESP_GATT_COMMON_API_H__ */ 49