mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-07 20:00:53 +00:00
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)
|
||||
{
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
const char *ver_str = esp_coex_version_get();
|
||||
if (ver_str != NULL) {
|
||||
unsigned int _major = 0, _minor = 0, _patch = 0;
|
||||
if (sscanf(ver_str, "%u.%u.%u", &_major, &_minor, &_patch) != 3) {
|
||||
return -1;
|
||||
}
|
||||
if (major != NULL) {
|
||||
*major = _major;
|
||||
}
|
||||
if (minor != NULL) {
|
||||
*minor = _minor;
|
||||
}
|
||||
if (patch != NULL) {
|
||||
*patch = _patch;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
coex_version_t version;
|
||||
ESP_ERROR_CHECK(coex_version_get_value(&version));
|
||||
*major = (unsigned int)version.major;
|
||||
*minor = (unsigned int)version.minor;
|
||||
*patch = (unsigned int)version.patch;
|
||||
return 0;
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user