Skip to content

Commit

Permalink
Run codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Jan 14, 2022
1 parent 6cf9675 commit e15c265
Show file tree
Hide file tree
Showing 45 changed files with 886 additions and 237 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,23 @@ class OperationalCredentialsAttrAccess : public AttributeAccessInterface

CHIP_ERROR OperationalCredentialsAttrAccess::ReadNOCs(EndpointId endpoint, AttributeValueEncoder & aEncoder)
{
return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR {
auto accessingFabricIndex = aEncoder.AccessingFabricIndex();

return aEncoder.EncodeList([accessingFabricIndex](const auto & encoder) -> CHIP_ERROR {
for (auto & fabricInfo : Server::GetInstance().GetFabricTable())
{
if (!fabricInfo.IsInitialized())
continue;

Clusters::OperationalCredentials::Structs::NOCStruct::Type noc;

noc.fabricIndex = fabricInfo.GetFabricIndex();
if (accessingFabricIndex == fabricInfo.GetFabricIndex())
{
Clusters::OperationalCredentials::Structs::NOCStruct::Type noc;

ReturnErrorOnFailure(fabricInfo.GetNOCCert(noc.noc));
ReturnErrorOnFailure(fabricInfo.GetICACert(noc.icac));
ReturnErrorOnFailure(encoder.Encode(noc));
noc.fabricIndex = fabricInfo.GetFabricIndex();
ReturnErrorOnFailure(fabricInfo.GetNOCCert(noc.noc));
ReturnErrorOnFailure(fabricInfo.GetICACert(noc.icac));
ReturnErrorOnFailure(encoder.Encode(noc));
}
}

return CHIP_NO_ERROR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.

<struct name="FabricDescriptor">
<cluster code="0x003E"/>
<item name="FabricIndex" type="INT8U"/>
<item name="FabricIndex" type="fabric_idx"/>
<item name="RootPublicKey" type="OCTET_STRING" length="65"/>
<item name="VendorId" type="INT16U"/> <!-- Change INT16U to new type VendorID #2395 -->
<item name="FabricId" type="FABRIC_ID"/>
Expand All @@ -43,7 +43,7 @@ limitations under the License.

<struct name="NOCStruct">
<cluster code="0x003E"/>
<item name="FabricIndex" type="INT8U"/>
<item name="FabricIndex" type="fabric_idx"/>
<item name="NOC" type="OCTET_STRING"/>
<item name="ICAC" type="OCTET_STRING"/>
</struct>
Expand All @@ -55,7 +55,7 @@ limitations under the License.
<define>OPERATIONAL_CREDENTIALS_CLUSTER</define>
<description>This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics.</description>

<attribute side="server" code="0x0000" define="NOCS" type="ARRAY" entryType="NOCStruct" length="254" writable="false" optional="false">NOCs</attribute>
<attribute side="server" code="0x0000" define="NOCS" type="ARRAY" entryType="NOCStruct" writable="false" optional="false">NOCs</attribute>
<attribute side="server" code="0x0001" define="FABRICS" type="ARRAY" entryType="FabricDescriptor" length="320" writable="false" optional="false">fabrics list</attribute>
<attribute side="server" code="0x0002" define="SUPPORTED_FABRICS" type="INT8U" writable="false" optional="false">SupportedFabrics</attribute>
<attribute side="server" code="0x0003" define="COMMISSIONED_FABRICS" type="INT8U" writable="false" optional="false">CommissionedFabrics</attribute>
Expand Down
2 changes: 2 additions & 0 deletions src/controller/java/zap-generated/CHIPCallbackTypes.h

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

36 changes: 36 additions & 0 deletions src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp

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

133 changes: 132 additions & 1 deletion src/controller/java/zap-generated/CHIPReadCallbacks.cpp

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

33 changes: 33 additions & 0 deletions src/controller/java/zap-generated/CHIPReadCallbacks.h

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

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

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

Loading

0 comments on commit e15c265

Please sign in to comment.