Skip to content

Commit

Permalink
Restyle fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarkov committed Dec 15, 2021
1 parent 42f25ce commit 0cc0e62
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 71 deletions.
11 changes: 5 additions & 6 deletions examples/tv-app/android/java/ContentLauncherManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ using namespace chip;
ContentLauncherManager ContentLauncherManager::sInstance;

ContentLaunchResponse ContentLauncherManager::HandleLaunchContent(chip::EndpointId endpointId,
const std::list<ContentLaunchParamater> & parameterList,
bool autoplay,
const chip::CharSpan & data)
const std::list<ContentLaunchParamater> & parameterList,
bool autoplay, const chip::CharSpan & data)
{
ContentLaunchResponse response;
CHIP_ERROR err = CHIP_NO_ERROR;
Expand Down Expand Up @@ -101,9 +100,9 @@ ContentLaunchResponse ContentLauncherManager::HandleLaunchContent(chip::Endpoint
return response;
}

ContentLaunchResponse ContentLauncherManager::HandleLaunchUrl(const chip::CharSpan & contentUrl,
const chip::CharSpan & displayString,
const ContentLaunchBrandingInformation & brandingInformation)
ContentLaunchResponse
ContentLauncherManager::HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString,
const std::list<ContentLaunchBrandingInformation> & brandingInformation)
{
ContentLaunchResponse response;
CHIP_ERROR err = CHIP_NO_ERROR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ using namespace std;
using namespace chip::AppPlatform;

ContentLaunchResponse ContentLauncherManager::HandleLaunchContent(chip::EndpointId endpointId,
const std::list<ContentLaunchParamater> & parameterList, bool autoplay,
const chip::CharSpan & data)
const std::list<ContentLaunchParamater> & parameterList,
bool autoplay, const chip::CharSpan & data)
{
ChipLogProgress(Zcl, "ContentLauncherManager::HandleLaunchContent ");
string dataString(data.data(), data.size());
Expand All @@ -61,9 +61,9 @@ ContentLaunchResponse ContentLauncherManager::HandleLaunchContent(chip::Endpoint
return response;
}

ContentLaunchResponse ContentLauncherManager::HandleLaunchUrl(const chip::CharSpan & contentUrl,
const chip::CharSpan & displayString,
const std::list<ContentLaunchBrandingInformation> & brandingInformation)
ContentLaunchResponse
ContentLauncherManager::HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString,
const std::list<ContentLaunchBrandingInformation> & brandingInformation)
{
ChipLogProgress(Zcl, "ContentLauncherManager::HandleLaunchUrl");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ namespace ContentLauncher {
class Delegate
{
public:
virtual ContentLaunchResponse HandleLaunchContent(chip::EndpointId endpointId, const std::list<ContentLaunchParamater> & parameterList,
bool autoplay, const chip::CharSpan & data) = 0;
virtual ContentLaunchResponse HandleLaunchContent(chip::EndpointId endpointId,
const std::list<ContentLaunchParamater> & parameterList, bool autoplay,
const chip::CharSpan & data) = 0;

virtual ContentLaunchResponse HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString,
const std::list<ContentLaunchBrandingInformation> & brandingInformation) = 0;
Expand Down
58 changes: 27 additions & 31 deletions src/app/clusters/content-launch-server/content-launch-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ Delegate * GetDelegate(EndpointId endpoint)
return (ep == 0xFFFF ? NULL : gDelegateTable[ep]);
}

bool SendStatusIfDelegateNull(Delegate * delegate, EndpointId endpoint)
bool isDelegateNull(Delegate * delegate, EndpointId endpoint)
{
if (delegate == nullptr)
{
ChipLogError(Zcl, "No ContentLauncher Delegate set for ep:%" PRIu16, endpoint);
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_UNSUP_COMMAND);
ChipLogError(Zcl, "Content Launcher has no delegate set for endpoint:%" PRIu16, endpoint);
return true;
}
return false;
Expand Down Expand Up @@ -129,8 +128,8 @@ CHIP_ERROR ContentLauncherAttrAccess::Read(const app::ConcreteReadAttributePath
{
EndpointId endpoint = aPath.mEndpointId;
Delegate * delegate = GetDelegate(endpoint);
if (SendStatusIfDelegateNull(delegate, endpoint))
{

if(isDelegateNull(delegate, endpoint)) {
return CHIP_NO_ERROR;
}

Expand All @@ -146,6 +145,7 @@ CHIP_ERROR ContentLauncherAttrAccess::Read(const app::ConcreteReadAttributePath
break;
}
}

return CHIP_NO_ERROR;
}

Expand Down Expand Up @@ -181,26 +181,25 @@ bool emberAfContentLauncherClusterLaunchContentCallback(
chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::Type response;
EndpointId endpoint = commandPath.mEndpointId;

auto & autoplay = commandData.autoPlay;
auto & data = commandData.data;
auto & autoplay = commandData.autoPlay;
auto & data = commandData.data;
// TODO: Decode the paramater and pass it to delegate
// auto searchIterator = commandData.search.begin();
std::list<ContentLaunchParamater> parameterList;

Delegate * delegate = GetDelegate(endpoint);
if (SendStatusIfDelegateNull(delegate, endpoint))
{
return true;
}
VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE);

ContentLaunchResponse resp = delegate->HandleLaunchContent(emberAfCurrentEndpoint(), parameterList, autoplay, data);
VerifyOrExit(resp.err == CHIP_NO_ERROR, err = resp.err);
{
ContentLaunchResponse resp = delegate->HandleLaunchContent(emberAfCurrentEndpoint(), parameterList, autoplay, data);
VerifyOrExit(resp.err == CHIP_NO_ERROR, err = resp.err);

response.contentLaunchStatus = resp.status;
response.data = resp.data;
response.contentLaunchStatus = resp.status;
response.data = resp.data;

err = commandObj->AddResponseData(commandPath, response);
SuccessOrExit(err);
err = commandObj->AddResponseData(commandPath, response);
SuccessOrExit(err);
}

exit:
if (err != CHIP_NO_ERROR)
Expand All @@ -221,28 +220,25 @@ bool emberAfContentLauncherClusterLaunchURLCallback(
chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::Type response;
EndpointId endpoint = commandPath.mEndpointId;


auto & contentUrl = commandData.contentURL;
auto & displayString = commandData.displayString;
auto & contentUrl = commandData.contentURL;
auto & displayString = commandData.displayString;
// TODO: Decode the paramater and pass it to delegate
// auto brandingInformationIterator = commandData.brandingInformation.begin();
std::list<ContentLaunchBrandingInformation> brandingInformationList;


Delegate * delegate = GetDelegate(endpoint);
if (SendStatusIfDelegateNull(delegate, endpoint))
{
return true;
}
VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE);

ContentLaunchResponse resp = delegate->HandleLaunchUrl(contentUrl, displayString, brandingInformationList);
VerifyOrExit(resp.err == CHIP_NO_ERROR, err = resp.err);
{
ContentLaunchResponse resp = delegate->HandleLaunchUrl(contentUrl, displayString, brandingInformationList);
VerifyOrExit(resp.err == CHIP_NO_ERROR, err = resp.err);

response.contentLaunchStatus = resp.status;
response.data = resp.data;
response.contentLaunchStatus = resp.status;
response.data = resp.data;

err = commandObj->AddResponseData(commandPath, response);
SuccessOrExit(err);
err = commandObj->AddResponseData(commandPath, response);
SuccessOrExit(err);
}

exit:
if (err != CHIP_NO_ERROR)
Expand Down
2 changes: 1 addition & 1 deletion third_party/qpg_sdk/repo
Submodule repo updated from 874261 to edb134
16 changes: 8 additions & 8 deletions zzz_generated/chip-tool/zap-generated/reporting/Commands.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions zzz_generated/tv-app/zap-generated/attribute-size.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions zzz_generated/tv-casting-app/zap-generated/attribute-size.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0cc0e62

Please sign in to comment.