esp_coexist.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright 2015-2018 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. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef __ESP_COEXIST_H__
  15. #define __ESP_COEXIST_H__
  16. #include <stdbool.h>
  17. #include "esp_err.h"
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /**
  22. * @brief coex prefer value
  23. */
  24. typedef enum {
  25. ESP_COEX_PREFER_WIFI = 0, /*!< Prefer to WiFi, WiFi will have more opportunity to use RF */
  26. ESP_COEX_PREFER_BT, /*!< Prefer to bluetooth, bluetooth will have more opportunity to use RF */
  27. ESP_COEX_PREFER_BALANCE, /*!< Do balance of WiFi and bluetooth */
  28. ESP_COEX_PREFER_NUM, /*!< Prefer value numbers */
  29. } esp_coex_prefer_t;
  30. /**
  31. * @brief Get software coexist version string
  32. *
  33. * @return : version string
  34. */
  35. const char *esp_coex_version_get(void);
  36. /**
  37. * @brief Set coexist preference of performance
  38. * For example, if prefer to bluetooth, then it will make A2DP(play audio via classic bt)
  39. * more smooth while wifi is runnning something.
  40. * If prefer to wifi, it will do similar things as prefer to bluetooth.
  41. * Default, it prefer to balance.
  42. *
  43. * @param prefer : the prefer enumeration value
  44. * @return : ESP_OK - success, other - failed
  45. */
  46. esp_err_t esp_coex_preference_set(esp_coex_prefer_t prefer);
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif /* __ESP_COEXIST_H__ */