经典蓝牙 GAP API

应用程序示例

Instructions

API 参考手册

类型定义

枚举

enum esp_bt_scan_mode_t

Discoverability and Connectability mode.

Values:

ESP_BT_SCAN_MODE_NONE = 0

Neither discoverable nor connectable

ESP_BT_SCAN_MODE_CONNECTABLE

Connectable but not discoverable

ESP_BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE

both discoverable and connectaable

结构体

函数

esp_err_t esp_bt_gap_set_scan_mode(esp_bt_scan_mode_t mode)

Set discoverability and connectability mode for legacy bluetooth. This function should be called after esp_bluedroid_enable() completes successfully.

Return
  • ESP_OK : Succeed
  • ESP_ERR_INVALID_ARG: if argument invalid
  • ESP_INVALID_STATE: if bluetooth stack is not yet enabled
  • ESP_FAIL: others
Parameters
  • mode: : one of the enums of bt_scan_mode_t