esp_gatt_common_api.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #include <stdint.h>
  14. #include <stdbool.h>
  15. #include "esp_err.h"
  16. #include "esp_bt_defs.h"
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. // Maximum Transmission Unit used in GATT
  21. #define ESP_GATT_DEF_BLE_MTU_SIZE 23 /* relate to GATT_DEF_BLE_MTU_SIZE in gatt_api.h */
  22. // Maximum Transmission Unit allowed in GATT
  23. #define ESP_GATT_MAX_MTU_SIZE 517 /* relate to GATT_MAX_MTU_SIZE in gatt_api.h */
  24. /**
  25. * @brief This function is called to set local MTU,
  26. * the function is called before BLE connection.
  27. *
  28. * @param[in] mtu: the size of MTU.
  29. *
  30. * @return
  31. * - ESP_OK: success
  32. * - other: failed
  33. *
  34. */
  35. extern esp_err_t esp_ble_gatt_set_local_mtu (uint16_t mtu);
  36. #ifdef __cplusplus
  37. }
  38. #endif