Skip to content

Commit

Permalink
update the function logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry-ESP committed Sep 10, 2024
1 parent c239028 commit e097ca7
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/platform/ESP32/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,24 +271,19 @@ CHIP_ERROR ConfigurationManagerImpl::GetLocationCapability(uint8_t & location)

CHIP_ERROR ConfigurationManagerImpl::GetDeviceTypeId(uint32_t & deviceType)
{
#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE
uint32_t value = 0;
CHIP_ERROR err = ReadConfigValue(ESP32Config::kConfigKey_PrimaryDeviceType, value);

if (err == CHIP_NO_ERROR)
if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND)
{
deviceType = value;
deviceType = CHIP_DEVICE_CONFIG_DEVICE_TYPE;
}
else
{
deviceType = CHIP_DEVICE_CONFIG_DEVICE_TYPE;
deviceType = value;
}

return err;
#else
deviceType = 0;
return CHIP_NO_ERROR;
#endif // CONFIG_ENABLE_ESP32_LOCATIONCAPABILITY
}

CHIP_ERROR ConfigurationManagerImpl::StoreCountryCode(const char * code, size_t codeLen)
Expand Down

0 comments on commit e097ca7

Please sign in to comment.