esp_gap_bt_api.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2015-2016 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. #ifndef __ESP_GAP_BT_API_H__
  14. #define __ESP_GAP_BT_API_H__
  15. #include <stdint.h>
  16. #include "esp_err.h"
  17. #include "esp_bt_defs.h"
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /// Discoverability and Connectability mode
  22. typedef enum {
  23. ESP_BT_SCAN_MODE_NONE = 0, /*!< Neither discoverable nor connectable */
  24. ESP_BT_SCAN_MODE_CONNECTABLE, /*!< Connectable but not discoverable */
  25. ESP_BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE /*!< both discoverable and connectaable */
  26. } esp_bt_scan_mode_t;
  27. /**
  28. * @brief Set discoverability and connectability mode for legacy bluetooth. This function should
  29. * be called after esp_bluedroid_enable() completes successfully
  30. *
  31. * @param[in] mode : one of the enums of bt_scan_mode_t
  32. *
  33. * @return
  34. * - ESP_OK : Succeed
  35. * - ESP_ERR_INVALID_ARG: if argument invalid
  36. * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
  37. * - ESP_FAIL: others
  38. */
  39. esp_err_t esp_bt_gap_set_scan_mode(esp_bt_scan_mode_t mode);
  40. #ifdef __cplusplus
  41. }
  42. #endif
  43. #endif /* __ESP_GAP_BT_API_H__ */