Skip to content

Commit

Permalink
Fixed tests, recompiled code, all green
Browse files Browse the repository at this point in the history
Fixed application launcher cluster

Restyle fix

Fixed tests

Restyle fix

Updated allowed vendor list attribute

Restyle fix

Disabled application basic cluster - allowed vendor list

Run zap tool regen

Restyle fix

Re-Run of zap regen script

Restyle fix

Enable current navigator attribute in all cluster app.

Restyle fix

Re-run zap regen

Restyle fix

Updated tests per comments

Added zap_regen

Restyle fix

Run zap regen tool

Restyle fix

Re-run zap regen code, to resolve conflicts

Restyle fix

Re-run zap regen code, to resolve conflicts

Restyle fix

Re-run zap regen code, to resolve conflicts

Restyle fix

Re-run zap regen code, to resolve conflicts

Restyle fix

Run zap regen code & restyle

Run zap regen code & restyle
  • Loading branch information
lazarkov committed Dec 10, 2021
1 parent 092e0b7 commit 11ca777
Show file tree
Hide file tree
Showing 74 changed files with 2,845 additions and 4,092 deletions.
35 changes: 18 additions & 17 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -13625,6 +13625,21 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "current navigator target",
"code": 1,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
Expand Down Expand Up @@ -14308,7 +14323,7 @@
"reportableChange": 0
},
{
"name": "supported streaming types",
"name": "supported streaming protocols",
"code": 1,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -14663,21 +14678,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 @@ -19428,5 +19428,6 @@
"endpointVersion": 1,
"deviceIdentifier": 22
}
]
],
"log": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,22 @@ string AccountLoginManager::proxySetupPinRequest(string requestTempAccountIdenti
return "tempPin123";
}

bool AccountLoginManager::proxyLogout()
{
// TODO: Insert your code here to send logout request
return true;
}

bool accountLoginClusterIsUserLoggedIn(std::string requestTempAccountIdentifier, std::string requestSetupPin)
{
return AccountLoginManager().GetInstance().isUserLoggedIn(requestTempAccountIdentifier, requestSetupPin);
}

bool accountLoginClusterLogout()
{
return AccountLoginManager().GetInstance().proxyLogout();
}

std::string accountLoginClusterGetSetupPin(std::string requestTempAccountIdentifier, chip::EndpointId endpoint)
{
string responseSetupPin = AccountLoginManager().proxySetupPinRequest(requestTempAccountIdentifier, endpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class AccountLoginManager
{
public:
bool isUserLoggedIn(std::string requestTempAccountIdentifier, std::string requestSetupPin);
bool proxyLogout();
std::string proxySetupPinRequest(std::string requestTempAccountIdentifier, chip::EndpointId endpoint);
void setTempAccountIdentifierForPin(std::string requestTempAccountIdentifier, std::string requestSetupPin);

Expand Down
18 changes: 10 additions & 8 deletions examples/tv-app/android/include/application-basic/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@

struct Application
{
using ApplicationBasicStatus = chip::app::Clusters::ApplicationBasic::ApplicationBasicStatus;
char vendorName[32] = "";
char name[32] = "";
char id[32] = "";
uint16_t vendorId = 0;
uint16_t productId = 0;
uint16_t catalogVendorId = 0;
ApplicationBasicStatus status = ApplicationBasicStatus::kStopped;
using ApplicationBasicStatus = chip::app::Clusters::ApplicationBasic::ApplicationBasicStatus;
char vendorName[32] = "";
char name[32] = "";
char id[32] = "";
char version[32] = "";
uint16_t vendorId = 0;
uint16_t productId = 0;
uint16_t catalogVendorId = 0;
uint16_t allowedVendorList[32] = { 123, 456 };
ApplicationBasicStatus status = ApplicationBasicStatus::kStopped;
};
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ void ApplicationBasicManager::store(chip::EndpointId endpoint, Application * app
ChipLogError(Zcl, "Failed to store name attribute.");
}

MakeZclCharString(zclString, application->version);
EmberAfStatus versionStatus =
emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_VERSION_ATTRIBUTE_ID,
zclString.data(), ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
if (versionStatus != EMBER_ZCL_STATUS_SUCCESS)
{
ChipLogError(Zcl, "Failed to store version attribute.");
}

EmberAfStatus productIdStatus =
emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_PRODUCT_ID_ATTRIBUTE_ID,
(uint8_t *) &application->productId, ZCL_INT16U_ATTRIBUTE_TYPE);
Expand All @@ -82,23 +91,6 @@ void ApplicationBasicManager::store(chip::EndpointId endpoint, Application * app
ChipLogError(Zcl, "Failed to store product id attribute.");
}

MakeZclCharString(zclString, application->id);
EmberAfStatus idStatus =
emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_ID_ATTRIBUTE_ID, zclString.data(),
ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
if (idStatus != EMBER_ZCL_STATUS_SUCCESS)
{
ChipLogError(Zcl, "Failed to store id attribute.");
}

EmberAfStatus catalogVendorIdStatus =
emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_CATALOG_VENDOR_ID_ATTRIBUTE_ID,
(uint8_t *) &application->catalogVendorId, ZCL_INT16U_ATTRIBUTE_TYPE);
if (catalogVendorIdStatus != EMBER_ZCL_STATUS_SUCCESS)
{
ChipLogError(Zcl, "Failed to store catalog vendor id attribute.");
}

EmberAfStatus applicationStatus =
emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_STATUS_ATTRIBUTE_ID,
(uint8_t *) &application->status, ZCL_ENUM8_ATTRIBUTE_TYPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ name=exampleName1
productId=1
id=1
catalogVendorId=1
version=exampleVersion

[endpoint4]
type=app
Expand All @@ -22,6 +23,7 @@ name=exampleName2
productId=2
id=2
catalogVendorId=2
version=exampleVersion

[endpoint5]
type=app
Expand All @@ -31,6 +33,7 @@ name=exampleName3
productId=3
id= 3
catalogVendorId=3
version=exampleVersion

[endpoint6]
type=app
Expand All @@ -39,4 +42,5 @@ vendorId=4
name=exampleName4
productId=4
id=4
catalogVendorId=4
catalogVendorId=4
version=exampleVersion
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/ContentLauncherManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ContentLauncherAttrAccess : public app::AttributeAccessInterface
{
return ContentLauncherMgr().GetAcceptsHeader(aEncoder);
}
else if (aPath.mAttributeId == app::Clusters::ContentLauncher::Attributes::SupportedStreamingTypes::Id)
else if (aPath.mAttributeId == app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::Id)
{
return ContentLauncherMgr().GetSupportedStreamingTypes(aEncoder);
}
Expand Down
4 changes: 0 additions & 4 deletions examples/tv-app/android/java/MediaPlaybackManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ class MediaPlayBackAttrAccess : public app::AttributeAccessInterface
attrId = ZCL_MEDIA_PLAYBACK_DURATION_ATTRIBUTE_ID;
break;
}
case app::Clusters::MediaPlayback::Attributes::PositionUpdatedAt::Id: {
attrId = ZCL_MEDIA_PLAYBACK_PLAYBACK_POSITION_UPDATED_AT_ATTRIBUTE_ID;
break;
}
case app::Clusters::MediaPlayback::Attributes::Position::Id: {
attrId = ZCL_MEDIA_PLAYBACK_PLAYBACK_POSITION_ATTRIBUTE_ID;
break;
Expand Down
6 changes: 3 additions & 3 deletions examples/tv-app/android/java/TvChannelManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ class ChannelInfoAttrAccess : public app::AttributeAccessInterface
ChannelInfoAttrAccess() : app::AttributeAccessInterface(Optional<EndpointId>::Missing(), app::Clusters::TvChannel::Id) {}
CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override
{
if (aPath.mAttributeId == app::Clusters::TvChannel::Attributes::TvChannelList::Id)
if (aPath.mAttributeId == app::Clusters::TvChannel::Attributes::ChannelList::Id)
{
return TvChannelMgr().getTvChannelList(aEncoder);
}
else if (aPath.mAttributeId == app::Clusters::TvChannel::Attributes::TvChannelLineup::Id)
else if (aPath.mAttributeId == app::Clusters::TvChannel::Attributes::ChannelLineup::Id)
{
return TvChannelMgr().getTvChannelLineup(aEncoder);
}
else if (aPath.mAttributeId == app::Clusters::TvChannel::Attributes::CurrentTvChannel::Id)
else if (aPath.mAttributeId == app::Clusters::TvChannel::Attributes::CurrentChannel::Id)
{
return TvChannelMgr().getCurrentTvChannel(aEncoder);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/linux/AppImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ DECLARE_DYNAMIC_ATTRIBUTE_LIST_END();
DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(contentLauncherAttrs)
DECLARE_DYNAMIC_ATTRIBUTE(ZCL_CONTENT_LAUNCHER_ACCEPTS_HEADER_ATTRIBUTE_ID, ARRAY, kDescriptorAttributeArraySize,
0), /* accept header list */
DECLARE_DYNAMIC_ATTRIBUTE(ZCL_CONTENT_LAUNCHER_SUPPORTED_STREAMING_TYPES_ATTRIBUTE_ID, BITMAP32, 1,
DECLARE_DYNAMIC_ATTRIBUTE(ZCL_CONTENT_LAUNCHER_SUPPORTED_STREAMING_PROTOCOLS_ATTRIBUTE_ID, BITMAP32, 1,
0), /* streaming protocols */
DECLARE_DYNAMIC_ATTRIBUTE_LIST_END();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,22 @@ string AccountLoginManager::proxySetupPinRequest(string requestTempAccountIdenti
return "tempPin123";
}

bool AccountLoginManager::proxyLogout()
{
// TODO: Insert your code here to send logout request
return true;
}

bool accountLoginClusterIsUserLoggedIn(std::string requestTempAccountIdentifier, std::string requestSetupPin)
{
return AccountLoginManager().GetInstance().isUserLoggedIn(requestTempAccountIdentifier, requestSetupPin);
}

bool accountLoginClusterLogout()
{
return AccountLoginManager().GetInstance().proxyLogout();
}

std::string accountLoginClusterGetSetupPin(std::string requestTempAccountIdentifier, chip::EndpointId endpoint)
{
string responseSetupPin = AccountLoginManager().proxySetupPinRequest(requestTempAccountIdentifier, endpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class AccountLoginManager
{
public:
bool isUserLoggedIn(std::string requestTempAccountIdentifier, std::string requestSetupPin);
bool proxyLogout();
std::string proxySetupPinRequest(std::string requestTempAccountIdentifier, chip::EndpointId endpoint);
void setTempAccountIdentifierForPin(std::string requestTempAccountIdentifier, std::string requestSetupPin);

Expand Down
19 changes: 10 additions & 9 deletions examples/tv-app/linux/include/application-basic/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@

struct Application
{
using ApplicationBasicStatus = chip::app::Clusters::ApplicationBasic::ApplicationBasicStatus;

char vendorName[32] = "";
char name[32] = "";
char id[32] = "";
uint16_t vendorId = 0;
uint16_t productId = 0;
uint16_t catalogVendorId = 0;
ApplicationBasicStatus status = ApplicationBasicStatus::kStopped;
using ApplicationBasicStatus = chip::app::Clusters::ApplicationBasic::ApplicationBasicStatus;
char vendorName[32] = "";
char name[32] = "";
char id[32] = "";
char version[32] = "";
uint16_t vendorId = 0;
uint16_t productId = 0;
uint16_t catalogVendorId = 0;
uint16_t allowedVendorList[32] = { 123, 456 };
ApplicationBasicStatus status = ApplicationBasicStatus::kStopped;
};
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ void ApplicationBasicManager::store(chip::EndpointId endpoint, Application * app
ChipLogError(Zcl, "Failed to store name attribute.");
}

MakeZclCharString(zclString, application->version);
EmberAfStatus versionStatus =
emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_VERSION_ATTRIBUTE_ID,
zclString.data(), ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
if (versionStatus != EMBER_ZCL_STATUS_SUCCESS)
{
ChipLogError(Zcl, "Failed to store version attribute.");
}

EmberAfStatus productIdStatus =
emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_PRODUCT_ID_ATTRIBUTE_ID,
(uint8_t *) &application->productId, ZCL_INT16U_ATTRIBUTE_TYPE);
Expand Down Expand Up @@ -112,6 +121,12 @@ Application ApplicationBasicManager::getApplicationForEndpoint(chip::EndpointId
ChipLogError(Zcl, "Failed to get app vendor name. Error:%s", chip::ErrorStr(err));
}

err = es->get(section, "version", app.version, size);
if (err != CHIP_NO_ERROR)
{
ChipLogError(Zcl, "Failed to get application version. Error:%s", chip::ErrorStr(err));
}

err = es->get(section, "id", app.id, size);
if (err != CHIP_NO_ERROR)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type=speaker
[endpoint3]
type=app
vendorName=exampleVendorName1
version=exampleVersion
vendorId=1
name=exampleName1
productId=1
Expand All @@ -17,6 +18,7 @@ catalogVendorId=1
[endpoint4]
type=app
vendorName=exampleVendorName2
version=exampleVersion
vendorId=2
name=exampleName2
productId=2
Expand All @@ -26,6 +28,7 @@ catalogVendorId=2
[endpoint5]
type=app
vendorName=exampleVendorName3
version=exampleVersion
vendorId=3
name=exampleName3
productId=3
Expand All @@ -35,6 +38,7 @@ catalogVendorId=3
[endpoint6]
type=app
vendorName=exampleVendorName4
version=exampleVersion
vendorId=4
name=exampleName4
productId=4
Expand Down
Loading

0 comments on commit 11ca777

Please sign in to comment.