Skip to content

Commit

Permalink
Undo nullable update
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Oct 30, 2023
1 parent 33b1676 commit db08c7a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void AccountLoginManager::HandleGetSetupPin(CommandResponseHelper<GetSetupPINRes
GetSetupPINResponse response;
ChipLogProgress(Zcl, "temporary account id: %s returning pin: %s", tempAccountIdentifierString.c_str(), mSetupPin);

response.setupPIN.SetNonNull(CharSpan::fromCharString(mSetupPin));
response.setupPIN = CharSpan::fromCharString(mSetupPin);
helper.Success(response);
}

Expand Down Expand Up @@ -93,14 +93,7 @@ void AccountLoginManager::GetSetupPin(char * setupPin, size_t setupPinSize, cons
GetSetupPINResponse pinResponse = mCommandDelegate->FormatGetSetupPINResponse(response, status);
if (status == chip::Protocols::InteractionModel::Status::Success)
{
if (pinResponse.setupPIN.IsNull())
{
setupPin[0] = '\0';
}
else
{
CopyString(setupPin, setupPinSize, pinResponse.setupPIN.Value());
}
CopyString(setupPin, setupPinSize, pinResponse.setupPIN);
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions examples/tv-app/android/java/ContentAppCommandDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ GetSetupPINResponseType ContentAppCommandDelegate::FormatGetSetupPINResponse(Jso
std::to_string(to_underlying(app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Fields::kSetupPIN));
if (!value[setupPINFieldId].empty())
{
getSetupPINresponse.setupPIN.SetNonNull(CharSpan::fromCharString(value[setupPINFieldId].asCString()));
getSetupPINresponse.setupPIN = CharSpan::fromCharString(value[setupPINFieldId].asCString());
}
else
{
getSetupPINresponse.setupPIN.SetNull();
getSetupPINresponse.setupPIN = "";
}
return getSetupPINresponse;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ void AccountLoginManager::HandleGetSetupPin(CommandResponseHelper<GetSetupPINRes
GetSetupPINResponse response;
ChipLogProgress(Zcl, "temporary account id: %s returning pin: %s", tempAccountIdentifierString.c_str(), mSetupPin);

response.setupPIN = chip::app::DataModel::MakeNullable(CharSpan::fromCharString(mSetupPin));
response.setupPIN = CharSpan::fromCharString(mSetupPin);
helper.Success(response);
}

0 comments on commit db08c7a

Please sign in to comment.