forked from espressif/esp-idf
feat(coex): apply struct for coex version
This commit is contained in:
@ -1197,23 +1197,12 @@ static int coex_register_wifi_channel_change_callback_wrapper(void *cb)
|
|||||||
static int coex_version_get_wrapper(unsigned int *major, unsigned int *minor, unsigned int *patch)
|
static int coex_version_get_wrapper(unsigned int *major, unsigned int *minor, unsigned int *patch)
|
||||||
{
|
{
|
||||||
#if CONFIG_SW_COEXIST_ENABLE
|
#if CONFIG_SW_COEXIST_ENABLE
|
||||||
const char *ver_str = esp_coex_version_get();
|
coex_version_t version;
|
||||||
if (ver_str != NULL) {
|
ESP_ERROR_CHECK(coex_version_get_value(&version));
|
||||||
unsigned int _major = 0, _minor = 0, _patch = 0;
|
*major = (unsigned int)version.major;
|
||||||
if (sscanf(ver_str, "%u.%u.%u", &_major, &_minor, &_patch) != 3) {
|
*minor = (unsigned int)version.minor;
|
||||||
return -1;
|
*patch = (unsigned int)version.patch;
|
||||||
}
|
return 0;
|
||||||
if (major != NULL) {
|
|
||||||
*major = _major;
|
|
||||||
}
|
|
||||||
if (minor != NULL) {
|
|
||||||
*minor = _minor;
|
|
||||||
}
|
|
||||||
if (patch != NULL) {
|
|
||||||
*patch = _patch;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -51,6 +51,12 @@ typedef struct {
|
|||||||
|
|
||||||
extern coex_adapter_funcs_t g_coex_adapter_funcs;
|
extern coex_adapter_funcs_t g_coex_adapter_funcs;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint8_t major;
|
||||||
|
uint8_t minor;
|
||||||
|
uint8_t patch;
|
||||||
|
} coex_version_t;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -75,6 +75,14 @@ void coex_disable(void);
|
|||||||
*/
|
*/
|
||||||
const char *coex_version_get(void);
|
const char *coex_version_get(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get software coexist version value
|
||||||
|
* extern function for internal use.
|
||||||
|
* @param ptr_version : points to version structure
|
||||||
|
* @return : ESP_OK - success, other - failed
|
||||||
|
*/
|
||||||
|
esp_err_t coex_version_get_value(coex_version_t* ptr_version);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Coexist performance preference set from libbt.a
|
* @brief Coexist performance preference set from libbt.a
|
||||||
* extern function for internal use.
|
* extern function for internal use.
|
||||||
|
Submodule components/esp_coex/lib updated: 68cbbdb45c...cc027a4382
Reference in New Issue
Block a user