Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nivi-apple committed Jul 26, 2024
1 parent 362ca12 commit d0ba68d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions examples/thermostat/linux/thermostat-delegate-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ CHIP_ERROR ThermostatDelegate::GetActivePresetHandle(MutableByteSpan & activePre
{
if (mActivePresetHandleDataSize > 0)
{
ByteSpan presetHandleSpan(mActivePresetHandleData, mActivePresetHandleDataSize);
CopySpanToMutableSpan(presetHandleSpan, activePresetHandle);
CopySpanToMutableSpan(ByteSpan(mActivePresetHandleData, mActivePresetHandleDataSize), activePresetHandle);
}
else
{
Expand Down Expand Up @@ -183,14 +182,7 @@ CHIP_ERROR ThermostatDelegate::AppendToPendingPresetList(const PresetStruct::Typ
mPendingPresets[mNextFreeIndexInPendingPresetsList].SetName(preset.name);
mPendingPresets[mNextFreeIndexInPendingPresetsList].SetCoolingSetpoint(preset.coolingSetpoint);
mPendingPresets[mNextFreeIndexInPendingPresetsList].SetHeatingSetpoint(preset.heatingSetpoint);
if (!preset.builtIn.IsNull())
{
mPendingPresets[mNextFreeIndexInPendingPresetsList].SetBuiltIn(preset.builtIn);
}
else
{
mPendingPresets[mNextFreeIndexInPendingPresetsList].SetBuiltIn(NullOptional);
}
mPendingPresets[mNextFreeIndexInPendingPresetsList].SetBuiltIn(preset.builtIn);
mNextFreeIndexInPendingPresetsList++;
return CHIP_NO_ERROR;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ CHIP_ERROR PresetStructWithOwnedMembers::SetPresetHandle(const Nullable<ByteSpan
size_t newPresetHandleSize = newPresetHandle.Value().size();
if (newPresetHandleSize > kPresetHandleSize)
{
ChipLogError(Zcl, "Failed to set Preset handle. New preset handle size (%ld) > allowed preset handle size (%ld)",
ChipLogError(Zcl, "Failed to set Preset handle. New preset handle size (%lu) > allowed preset handle size (%lu)",
newPresetHandleSize, kPresetNameSize);
return CHIP_ERROR_NO_MEMORY;
}
Expand All @@ -85,7 +85,7 @@ CHIP_ERROR PresetStructWithOwnedMembers::SetName(const Optional<DataModel::Nulla
size_t newNameSize = newName.Value().Value().size();
if (newNameSize > kPresetNameSize)
{
ChipLogError(Zcl, "Failed to set Preset name. New name size (%ld) > allowed preset name size (%ld)", newNameSize,
ChipLogError(Zcl, "Failed to set Preset name. New name size (%lu) > allowed preset name size (%lu)", newNameSize,
kPresetNameSize);
return CHIP_ERROR_NO_MEMORY;
}
Expand Down

0 comments on commit d0ba68d

Please sign in to comment.