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 b549632 commit f54046f
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 132 deletions.
7 changes: 3 additions & 4 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 @@ -103,7 +102,7 @@ ContentLaunchResponse ContentLauncherManager::HandleLaunchContent(chip::Endpoint

ContentLaunchResponse ContentLauncherManager::HandleLaunchUrl(const chip::CharSpan & contentUrl,
const chip::CharSpan & displayString,
const ContentLaunchBrandingInformation & brandingInformation)
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
45 changes: 0 additions & 45 deletions examples/tv-app/tv-common/tv-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -9389,21 +9389,6 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "allowed vendor list",
"code": 7,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x01",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
Expand Down Expand Up @@ -9868,21 +9853,6 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "allowed vendor list",
"code": 7,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x01",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
Expand Down Expand Up @@ -10145,21 +10115,6 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "allowed vendor list",
"code": 7,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x01",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
Expand Down
29 changes: 7 additions & 22 deletions examples/tv-casting-app/tv-casting-common/tv-casting-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,7 @@
"reportableChange": 0
},
{
"name": "NetworkDisabled",
"name": "InterfaceEnabled",
"code": 4,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -11934,7 +11934,7 @@
],
"attributes": [
{
"name": "tv channel list",
"name": "channel list",
"code": 0,
"mfgCode": null,
"side": "server",
Expand All @@ -11949,7 +11949,7 @@
"reportableChange": 0
},
{
"name": "tv channel lineup",
"name": "channel lineup",
"code": 1,
"mfgCode": null,
"side": "server",
Expand All @@ -11964,7 +11964,7 @@
"reportableChange": 0
},
{
"name": "current tv channel",
"name": "current channel",
"code": 2,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -12557,7 +12557,7 @@
"reportableChange": 0
},
{
"name": "supported streaming types",
"name": "supported streaming protocols",
"code": 1,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -12853,7 +12853,7 @@
"reportableChange": 0
},
{
"name": "application id",
"name": "application status",
"code": 5,
"mfgCode": null,
"side": "server",
Expand All @@ -12868,7 +12868,7 @@
"reportableChange": 0
},
{
"name": "catalog vendor id",
"name": "application version",
"code": 6,
"mfgCode": null,
"side": "server",
Expand All @@ -12882,21 +12882,6 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "application status",
"code": 7,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x01",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
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
68 changes: 35 additions & 33 deletions src/app/clusters/content-launch-server/content-launch-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ bool SendStatusIfDelegateNull(Delegate * delegate, EndpointId endpoint)
if (delegate == nullptr)
{
ChipLogError(Zcl, "No ContentLauncher Delegate set for ep:%" PRIu16, endpoint);
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_UNSUP_COMMAND);
return true;
}
return false;
Expand Down Expand Up @@ -127,12 +126,10 @@ ContentLauncherAttrAccess gContentLauncherAttrAccess;

CHIP_ERROR ContentLauncherAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder)
{
CHIP_ERROR err = CHIP_NO_ERROR;
EndpointId endpoint = aPath.mEndpointId;
Delegate * delegate = GetDelegate(endpoint);
if (SendStatusIfDelegateNull(delegate, endpoint))
{
return CHIP_NO_ERROR;
}
VerifyOrExit(SendStatusIfDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE);

switch (aPath.mAttributeId)
{
Expand All @@ -146,7 +143,16 @@ CHIP_ERROR ContentLauncherAttrAccess::Read(const app::ConcreteReadAttributePath
break;
}
}
return CHIP_NO_ERROR;

exit:
if (err != CHIP_NO_ERROR)
{
ChipLogError(Zcl, "ContentLauncherAttrAccess::Read error: %s", err.AsString());

emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE);
}

return err;
}

CHIP_ERROR ContentLauncherAttrAccess::ReadAcceptHeaderAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate)
Expand Down Expand Up @@ -181,27 +187,26 @@ 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))
VerifyOrExit(SendStatusIfDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE);

{
return true;
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;

err = commandObj->AddResponseData(commandPath, response);
SuccessOrExit(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;

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

exit:
if (err != CHIP_NO_ERROR)
{
Expand All @@ -221,28 +226,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(SendStatusIfDelegateNull(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
20 changes: 10 additions & 10 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.

Loading

0 comments on commit f54046f

Please sign in to comment.