2016-11-24 12:58:26 -05:00
|
|
|
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2016-11-15 07:56:15 -05:00
|
|
|
#ifndef __ESP_GAP_BT_API_H__
|
|
|
|
#define __ESP_GAP_BT_API_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "esp_err.h"
|
|
|
|
#include "esp_bt_defs.h"
|
|
|
|
|
2016-12-26 09:02:40 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2017-02-27 22:47:04 -05:00
|
|
|
#define ESP_BT_GAP_DEVICE_NAME_MAX (32)
|
|
|
|
|
2016-12-26 09:02:40 -05:00
|
|
|
/// Discoverability and Connectability mode
|
2016-11-15 07:56:15 -05:00
|
|
|
typedef enum {
|
2017-02-24 04:28:33 -05:00
|
|
|
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_bt_scan_mode_t;
|
2016-11-15 07:56:15 -05:00
|
|
|
|
2016-12-26 09:02:40 -05:00
|
|
|
/**
|
|
|
|
* @brief Set discoverability and connectability mode for legacy bluetooth
|
|
|
|
*
|
|
|
|
* @param[in] mode: one of the enums of bt_scan_mode_t
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* - ESP_OK : Succeed
|
|
|
|
* - ESP_ERR_INVALID_ARG: if argument invalid
|
|
|
|
*/
|
2017-02-24 04:28:33 -05:00
|
|
|
esp_err_t esp_bt_gap_set_scan_mode(esp_bt_scan_mode_t mode);
|
2016-11-15 07:56:15 -05:00
|
|
|
|
2016-12-26 09:02:40 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set bluetooth device name
|
|
|
|
*
|
|
|
|
* @param[in] name: device name to be set, will be truncated if more than 32 characters
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* - ESP_OK : Succeed
|
|
|
|
* - ESP_ERR_INVALID_ARG: if name is NULL pointer or empty string
|
|
|
|
*/
|
2016-12-26 04:26:54 -05:00
|
|
|
esp_err_t esp_bt_gap_set_device_name(const char *name);
|
2016-12-26 04:40:28 -05:00
|
|
|
|
2016-12-26 09:02:40 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-11-15 07:56:15 -05:00
|
|
|
#endif /* __ESP_GAP_BT_API_H__ */
|