diff --git a/src/platform/Ameba/AmebaConfig.cpp b/src/platform/Ameba/AmebaConfig.cpp index 68810da2695aa1..b9ac5d05b789f2 100644 --- a/src/platform/Ameba/AmebaConfig.cpp +++ b/src/platform/Ameba/AmebaConfig.cpp @@ -192,6 +192,8 @@ CHIP_ERROR AmebaConfig::WriteConfigValue(Key key, bool val) success = setPref_new(key.Namespace, key.Name, &value, 1); if (!success) ChipLogError(DeviceLayer, "setPref: %s/%s = %s failed\n", key.Namespace, key.Name, value ? "true" : "false"); + else + ChipLogProgress(DeviceLayer, "NVS set: %s/%s = %s", key.Namespace, key.Name, val ? "true" : "false"); return CHIP_NO_ERROR; } @@ -203,6 +205,8 @@ CHIP_ERROR AmebaConfig::WriteConfigValue(Key key, uint32_t val) success = setPref_new(key.Namespace, key.Name, (uint8_t *) &val, sizeof(uint32_t)); if (!success) ChipLogError(DeviceLayer, "setPref: %s/%s = %d(0x%x) failed\n", key.Namespace, key.Name, val, val); + else + ChipLogProgress(DeviceLayer, "NVS set: %s/%s = %" PRIu32 " (0x%" PRIX32 ")", key.Namespace, key.Name, val, val); return CHIP_NO_ERROR; } @@ -214,6 +218,8 @@ CHIP_ERROR AmebaConfig::WriteConfigValue(Key key, uint64_t val) success = setPref_new(key.Namespace, key.Name, (uint8_t *) &val, sizeof(uint64_t)); if (!success) ChipLogError(DeviceLayer, "setPref: %s/%s = %d(0x%x) failed\n", key.Namespace, key.Name, val, val); + else + ChipLogProgress(DeviceLayer, "NVS set: %s/%s = %" PRIu64 " (0x%" PRIX64 ")", key.Namespace, key.Name, val, val); return CHIP_NO_ERROR; } @@ -225,6 +231,8 @@ CHIP_ERROR AmebaConfig::WriteConfigValueStr(Key key, const char * str) success = setPref_new(key.Namespace, key.Name, (uint8_t *) str, strlen(str) + 1); if (!success) ChipLogError(DeviceLayer, "setPref: %s/%s = %s failed\n", key.Namespace, key.Name, str); + else + ChipLogProgress(DeviceLayer, "NVS set: %s/%s = \"%s\"", key.Namespace, key.Name, str); return CHIP_NO_ERROR; } @@ -251,6 +259,8 @@ CHIP_ERROR AmebaConfig::WriteConfigValueBin(Key key, const uint8_t * data, size_ success = setPref_new(key.Namespace, key.Name, (uint8_t *) data, dataLen); if (!success) ChipLogError(DeviceLayer, "setPref: %s/%s failed\n", key.Namespace, key.Name); + else + ChipLogProgress(DeviceLayer, "NVS set: %s/%s = (blob length %" PRId32 ")", key.Namespace, key.Name, dataLen); return CHIP_NO_ERROR; } @@ -262,6 +272,8 @@ CHIP_ERROR AmebaConfig::ClearConfigValue(Key key) success = deleteKey(key.Namespace, key.Name); if (!success) ChipLogProgress(DeviceLayer, "%s : %s/%s failed\n", __FUNCTION__, key.Namespace, key.Name); + else + ChipLogProgress(DeviceLayer, "NVS erase: %s/%s", key.Namespace, key.Name); return CHIP_NO_ERROR; }