2016-11-24 19:57:47 +08: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.
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2017-11-10 10:54:50 +08:00
|
|
|
typedef enum {
|
|
|
|
COEX_PREFER_WIFI = 0,
|
|
|
|
COEX_PREFER_BT,
|
|
|
|
COEX_PREFER_BALANCE,
|
|
|
|
COEX_PREFER_NUM,
|
|
|
|
} coex_prefer_t;
|
|
|
|
|
2016-11-24 19:57:47 +08:00
|
|
|
/**
|
|
|
|
* @brief Init software coexist
|
2017-11-10 10:54:50 +08:00
|
|
|
* extern function for internal use.
|
2016-11-24 19:57:47 +08:00
|
|
|
*
|
|
|
|
* @return Init ok or failed.
|
|
|
|
*/
|
2016-11-24 20:09:52 +08:00
|
|
|
esp_err_t coex_init(void);
|
2016-11-24 19:57:47 +08:00
|
|
|
|
2017-02-20 23:53:25 +08:00
|
|
|
/**
|
|
|
|
* @brief De-init software coexist
|
2017-11-10 10:54:50 +08:00
|
|
|
* extern function for internal use.
|
2017-02-20 23:53:25 +08:00
|
|
|
*/
|
|
|
|
void coex_deinit(void);
|
|
|
|
|
2016-11-24 19:57:47 +08:00
|
|
|
/**
|
2017-11-10 10:54:50 +08:00
|
|
|
* @brief Pause software coexist
|
|
|
|
* extern function for internal use.
|
|
|
|
*/
|
|
|
|
void coex_pause(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resume software coexist
|
|
|
|
* extern function for internal use.
|
|
|
|
*/
|
|
|
|
void coex_resume(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get software coexist version string
|
|
|
|
* extern function for internal use.
|
|
|
|
* @return : version string
|
|
|
|
*/
|
|
|
|
const char *coex_version_get(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Coexist performance preference set from libbt.a
|
|
|
|
* extern function for internal use.
|
2016-11-24 19:57:47 +08:00
|
|
|
*
|
2017-11-10 10:54:50 +08:00
|
|
|
* @param prefer : the prefer enumeration value
|
|
|
|
* @return : ESP_OK - success, other - failed
|
2016-11-24 19:57:47 +08:00
|
|
|
*/
|
2017-11-10 10:54:50 +08:00
|
|
|
esp_err_t coex_preference_set(coex_prefer_t prefer);
|
2016-11-24 19:57:47 +08:00
|
|
|
|
|
|
|
/**
|
2017-11-10 10:54:50 +08:00
|
|
|
* @brief Get software coexist version string
|
2016-11-24 19:57:47 +08:00
|
|
|
*
|
2017-11-10 10:54:50 +08:00
|
|
|
* @return : version string
|
|
|
|
*/
|
|
|
|
static inline const char *esp_coex_version_get(void)
|
|
|
|
{
|
|
|
|
return coex_version_get();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set coexist preference of performance
|
|
|
|
* For example, if prefer to bluetooth, then it will make A2DP(play audio via classic bt)
|
|
|
|
* more smooth while wifi is runnning something.
|
|
|
|
* If prefer to wifi, it will do similar things as prefer to bluetooth.
|
|
|
|
* Default, it prefer to balance.
|
2016-11-24 19:57:47 +08:00
|
|
|
*
|
2017-11-10 10:54:50 +08:00
|
|
|
* @param prefer : the prefer enumeration value
|
|
|
|
* @return : ESP_OK - success, other - failed
|
2016-11-24 19:57:47 +08:00
|
|
|
*/
|
2017-11-10 10:54:50 +08:00
|
|
|
static inline esp_err_t esp_coex_preference_set(coex_prefer_t prefer)
|
|
|
|
{
|
|
|
|
return coex_preference_set(prefer);
|
|
|
|
}
|
2016-11-24 19:57:47 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|