Skip to content

Commit

Permalink
Rename duplicate Application struct in ApplicationBasic and Applicati…
Browse files Browse the repository at this point in the history
…onLauncher clusters. (#13510)
  • Loading branch information
austinh0 authored Jan 13, 2022
1 parent 39736f3 commit c3222b5
Show file tree
Hide file tree
Showing 31 changed files with 128 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ uint16_t ApplicationBasicManager::HandleGetProductId()
return 1;
}

chip::app::Clusters::ApplicationBasic::Structs::Application::Type ApplicationBasicManager::HandleGetApplication()
chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type ApplicationBasicManager::HandleGetApplication()
{
chip::app::Clusters::ApplicationBasic::Structs::Application::Type application;
chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type application;
application.catalogVendorId = 123;
application.applicationId = chip::CharSpan("applicationId", strlen("applicationId"));
return application;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ApplicationBasicManager : public chip::app::Clusters::ApplicationBasic::De
uint16_t HandleGetVendorId() override;
chip::CharSpan HandleGetApplicationName() override;
uint16_t HandleGetProductId() override;
chip::app::Clusters::ApplicationBasic::Structs::Application::Type HandleGetApplication() override;
chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type HandleGetApplication() override;
chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum HandleGetStatus() override;
chip::CharSpan HandleGetApplicationVersion() override;
std::list<uint16_t> HandleGetAllowedVendorList() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ std::list<uint16_t> ApplicationLauncherManager::HandleGetCatalogList()
}

Commands::LauncherResponse::Type ApplicationLauncherManager::HandleLaunchApp(
const chip::CharSpan & data, const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application)
const chip::CharSpan & data,
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application)
{
// TODO: Insert code here
Commands::LauncherResponse::Type response;
Expand All @@ -45,8 +46,8 @@ Commands::LauncherResponse::Type ApplicationLauncherManager::HandleLaunchApp(
return response;
}

Commands::LauncherResponse::Type
ApplicationLauncherManager::HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application)
Commands::LauncherResponse::Type ApplicationLauncherManager::HandleStopApp(
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application)
{
// TODO: Insert code here
Commands::LauncherResponse::Type response;
Expand All @@ -55,8 +56,8 @@ ApplicationLauncherManager::HandleStopApp(const chip::app::Clusters::Application
return response;
}

Commands::LauncherResponse::Type
ApplicationLauncherManager::HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application)
Commands::LauncherResponse::Type ApplicationLauncherManager::HandleHideApp(
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application)
{
// TODO: Insert code here
Commands::LauncherResponse::Type response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class ApplicationLauncherManager : public chip::app::Clusters::ApplicationLaunch
chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type HandleGetCurrentApp() override;
std::list<uint16_t> HandleGetCatalogList() override;

chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type
HandleLaunchApp(const chip::CharSpan & data,
const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override;
chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type
HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override;
chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type
HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override;
chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type HandleLaunchApp(
const chip::CharSpan & data,
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application) override;
chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type HandleStopApp(
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application) override;
chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type HandleHideApp(
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application) override;
};
4 changes: 2 additions & 2 deletions examples/tv-app/linux/AppImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ uint32_t AccountLoginImpl::GetSetupPIN(const char * tempAccountId)
}

chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type
ApplicationLauncherImpl::LaunchApp(Application application, std::string data)
ApplicationLauncherImpl::LaunchApp(ApplicationLauncherApplication application, std::string data)
{
std::string appId(application.applicationId.data(), application.applicationId.size());
ChipLogProgress(DeviceLayer,
Expand Down Expand Up @@ -239,7 +239,7 @@ ContentApp * ContentAppFactoryImpl::LoadContentAppByVendorId(uint16_t vendorId)
return nullptr;
}

ContentApp * ContentAppFactoryImpl::LoadContentAppByAppId(Application application)
ContentApp * ContentAppFactoryImpl::LoadContentAppByAppId(ApplicationLauncherApplication application)
{
std::string appId(application.applicationId.data(), application.applicationId.size());
ChipLogProgress(DeviceLayer,
Expand Down
4 changes: 2 additions & 2 deletions examples/tv-app/linux/AppImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class DLL_EXPORT ApplicationLauncherImpl : public ApplicationLauncher
public:
virtual ~ApplicationLauncherImpl() {}

chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type LaunchApp(Application application,
chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type LaunchApp(ApplicationLauncherApplication application,
std::string data) override;

protected:
Expand Down Expand Up @@ -175,7 +175,7 @@ class DLL_EXPORT ContentAppFactoryImpl : public ContentAppFactory
virtual ~ContentAppFactoryImpl() {}

ContentApp * LoadContentAppByVendorId(uint16_t vendorId);
ContentApp * LoadContentAppByAppId(Application application);
ContentApp * LoadContentAppByAppId(ApplicationLauncherApplication application);

protected:
ContentAppImpl mContentApps[APP_LIBRARY_SIZE] = { ContentAppImpl("Vendor1", 1, "App1", 11, "Version1"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ uint16_t ApplicationBasicManager::HandleGetProductId()
return 1;
}

chip::app::Clusters::ApplicationBasic::Structs::Application::Type ApplicationBasicManager::HandleGetApplication()
chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type ApplicationBasicManager::HandleGetApplication()
{
chip::app::Clusters::ApplicationBasic::Structs::Application::Type application;
chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type application;
application.catalogVendorId = 123;
application.applicationId = chip::CharSpan("applicationId", strlen("applicationId"));
return application;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ApplicationBasicManager : public chip::app::Clusters::ApplicationBasic::De
uint16_t HandleGetVendorId() override;
chip::CharSpan HandleGetApplicationName() override;
uint16_t HandleGetProductId() override;
chip::app::Clusters::ApplicationBasic::Structs::Application::Type HandleGetApplication() override;
chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type HandleGetApplication() override;
chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum HandleGetStatus() override;
chip::CharSpan HandleGetApplicationVersion() override;
std::list<uint16_t> HandleGetAllowedVendorList() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ std::list<uint16_t> ApplicationLauncherManager::HandleGetCatalogList()
}

Commands::LauncherResponse::Type ApplicationLauncherManager::HandleLaunchApp(
const chip::CharSpan & data, const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application)
const chip::CharSpan & data,
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application)
{
// TODO: Insert code here
Commands::LauncherResponse::Type response;
Expand All @@ -45,8 +46,8 @@ Commands::LauncherResponse::Type ApplicationLauncherManager::HandleLaunchApp(
return response;
}

Commands::LauncherResponse::Type
ApplicationLauncherManager::HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application)
Commands::LauncherResponse::Type ApplicationLauncherManager::HandleStopApp(
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application)
{
// TODO: Insert code here
Commands::LauncherResponse::Type response;
Expand All @@ -55,8 +56,8 @@ ApplicationLauncherManager::HandleStopApp(const chip::app::Clusters::Application
return response;
}

Commands::LauncherResponse::Type
ApplicationLauncherManager::HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application)
Commands::LauncherResponse::Type ApplicationLauncherManager::HandleHideApp(
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application)
{
// TODO: Insert code here
Commands::LauncherResponse::Type response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class ApplicationLauncherManager : public chip::app::Clusters::ApplicationLaunch
chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type HandleGetCurrentApp() override;
std::list<uint16_t> HandleGetCatalogList() override;

chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type
HandleLaunchApp(const chip::CharSpan & data,
const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override;
chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type
HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override;
chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type
HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override;
chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type HandleLaunchApp(
const chip::CharSpan & data,
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application) override;
chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type HandleStopApp(
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application) override;
chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type HandleHideApp(
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application) override;
};
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ namespace ApplicationBasic {
class Delegate
{
public:
virtual chip::CharSpan HandleGetVendorName() = 0;
virtual uint16_t HandleGetVendorId() = 0;
virtual chip::CharSpan HandleGetApplicationName() = 0;
virtual uint16_t HandleGetProductId() = 0;
virtual chip::app::Clusters::ApplicationBasic::Structs::Application::Type HandleGetApplication() = 0;
virtual ApplicationStatusEnum HandleGetStatus() = 0;
virtual chip::CharSpan HandleGetApplicationVersion() = 0;
virtual std::list<uint16_t> HandleGetAllowedVendorList() = 0;
virtual chip::CharSpan HandleGetVendorName() = 0;
virtual uint16_t HandleGetVendorId() = 0;
virtual chip::CharSpan HandleGetApplicationName() = 0;
virtual uint16_t HandleGetProductId() = 0;
virtual chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type HandleGetApplication() = 0;
virtual ApplicationStatusEnum HandleGetStatus() = 0;
virtual chip::CharSpan HandleGetApplicationVersion() = 0;
virtual std::list<uint16_t> HandleGetAllowedVendorList() = 0;

virtual ~Delegate() = default;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ CHIP_ERROR ApplicationBasicAttrAccess::ReadProductIdAttribute(app::AttributeValu

CHIP_ERROR ApplicationBasicAttrAccess::ReadApplicationAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate)
{
Structs::Application::Type application = delegate->HandleGetApplication();
Structs::ApplicationBasicApplication::Type application = delegate->HandleGetApplication();
return aEncoder.Encode(application);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ class Delegate
virtual chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type HandleGetCurrentApp() = 0;
virtual std::list<uint16_t> HandleGetCatalogList() = 0;

virtual Commands::LauncherResponse::Type HandleLaunchApp(
const chip::CharSpan & data,
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application) = 0;
virtual Commands::LauncherResponse::Type
HandleLaunchApp(const chip::CharSpan & data,
const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) = 0;
HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application) = 0;
virtual Commands::LauncherResponse::Type
HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) = 0;
virtual Commands::LauncherResponse::Type
HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) = 0;
HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::Type & application) = 0;

virtual ~Delegate() = default;
};
Expand Down
4 changes: 2 additions & 2 deletions src/app/util/ContentApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ class DLL_EXPORT ApplicationLauncher : public ContentAppCluster
public:
virtual ~ApplicationLauncher() = default;

virtual app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type LaunchApp(Application application,
std::string data) = 0;
virtual app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type
LaunchApp(ApplicationLauncherApplication application, std::string data) = 0;

EmberAfStatus HandleReadAttribute(chip::AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength) override;
EmberAfStatus HandleWriteAttribute(chip::AttributeId attributeId, uint8_t * buffer) override;
Expand Down
2 changes: 1 addition & 1 deletion src/app/util/ContentAppPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ ContentApp * AppPlatform::GetLoadContentAppByVendorId(uint16_t vendorId)
return NULL;
}

ContentApp * AppPlatform::GetLoadContentAppByAppId(Application application)
ContentApp * AppPlatform::GetLoadContentAppByAppId(ApplicationLauncherApplication application)
{
ChipLogProgress(DeviceLayer, "GetLoadContentAppByAppId()");
if (mContentAppFactory != NULL)
Expand Down
8 changes: 4 additions & 4 deletions src/app/util/ContentAppPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ namespace AppPlatform {
class DLL_EXPORT ContentAppFactory
{
public:
virtual ~ContentAppFactory() = default;
virtual ContentApp * LoadContentAppByVendorId(uint16_t vendorId) = 0;
virtual ContentApp * LoadContentAppByAppId(Application application) = 0;
virtual ~ContentAppFactory() = default;
virtual ContentApp * LoadContentAppByVendorId(uint16_t vendorId) = 0;
virtual ContentApp * LoadContentAppByAppId(ApplicationLauncherApplication application) = 0;
};

class DLL_EXPORT AppPlatform
Expand All @@ -63,7 +63,7 @@ class DLL_EXPORT AppPlatform
// load and unload by vendor id
void UnloadContentAppByVendorId(uint16_t vendorId);
ContentApp * GetLoadContentAppByVendorId(uint16_t vendorId);
ContentApp * GetLoadContentAppByAppId(Application application);
ContentApp * GetLoadContentAppByAppId(ApplicationLauncherApplication application);

// helpful method to get a Content App by endpoint in order to perform attribute or command ops
ContentApp * GetContentAppByEndpointId(chip::EndpointId id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ limitations under the License.
<attribute side="server" code="0x0001" define="APPLICATION_VENDOR_ID" type="INT16U" min="0x0000" max="0xFFFF" writable="false" optional="false">vendor id</attribute>
<attribute side="server" code="0x0002" define="APPLICATION_NAME" type="CHAR_STRING" length="32" writable="false" optional="false">application name</attribute>
<attribute side="server" code="0x0003" define="APPLICATION_PRODUCT_ID" type="INT16U" min="0x0000" max="0xFFFF" writable="false" optional="false">product id</attribute>
<attribute side="server" code="0x0004" define="APPLICATION_APP" type="Application" writable="true" optional="false">application app</attribute>
<attribute side="server" code="0x0004" define="APPLICATION_APP" type="ApplicationBasicApplication" writable="true" optional="false">application app</attribute>
<attribute side="server" code="0x0005" define="APPLICATION_STATUS" type="ApplicationStatusEnum" min="0x00" max="0xFF" default="0x01" writable="false" optional="false">application status</attribute>
<attribute side="server" code="0x0006" define="APPLICATION_VERSION" type="CHAR_STRING" length="32" writable="false" optional="false">application version</attribute>
<attribute side="server" code="0x0007" define="APPLICATION_ALLOWED_VENDOR_LIST" type="ARRAY" entryType="vendor_id" length="32" writable="false" optional="false">allowed vendor list</attribute>
</cluster>

<struct name="Application">
<struct name="ApplicationBasicApplication">
<cluster code="0x050d"/>
<item name="catalogVendorId" type="INT16U"/>
<item name="applicationId" type="CHAR_STRING"/>
Expand Down
Loading

0 comments on commit c3222b5

Please sign in to comment.