Skip to content

Commit 0e5529d

Browse files
committed
Support Feature bit conformance in errata
1 parent 2e9d4ab commit 0e5529d

5 files changed

Lines changed: 16 additions & 2 deletions

File tree

matter/bitmap.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ type Bit interface {
177177
SetName(name string)
178178
Summary() string
179179
Conformance() conformance.Set
180+
SetConformance(conformance conformance.Set)
180181
SetParent(parent types.Entity)
181182

182183
Inherit(parent Bit) error
@@ -240,6 +241,10 @@ func (bmb *BitmapBit) Conformance() conformance.Set {
240241
return bmb.conformance
241242
}
242243

244+
func (bmb *BitmapBit) SetConformance(conformance conformance.Set) {
245+
bmb.conformance = conformance
246+
}
247+
243248
func (bmb *BitmapBit) Clone() Bit {
244249
return bmb.CloneTo(bmb.parent)
245250
}

matter/spec/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func (sp *Builder) buildSpec(cxt context.Context, libraries []*Library) (referen
147147

148148
sp.resolveClusterDataTypeReferences(false)
149149

150-
sp.resolveConformances()
150+
sp.ResolveConformances()
151151
sp.resolveConstraints()
152152
err = updateBridgedBasicInformationCluster(spec, basicInformationCluster, bridgedDeviceBasicInformationCluster)
153153
if err != nil {

matter/spec/conformance.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ import (
1010
"github.com/project-chip/alchemy/matter/types"
1111
)
1212

13-
func (sp *Builder) resolveConformances() {
13+
func (spec *Specification) ResolveConformances() {
14+
sp := &Builder{Spec: spec}
15+
sp.ResolveConformances()
16+
}
17+
18+
func (sp *Builder) ResolveConformances() {
1419
specEntityFinder := newSpecEntityFinder(sp.Spec, nil, nil)
1520
for cluster := range sp.Spec.Clusters {
1621
specEntityFinder.cluster = cluster

sdk/bitmap.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ func applyBitmapOverride(bitmap *matter.Bitmap, override *errata.SDKType) {
4040
if f.OverrideName != "" {
4141
b.SetName(f.OverrideName)
4242
}
43+
if f.Conformance != "" {
44+
b.SetConformance(conformance.ParseConformance(f.Conformance))
45+
}
4346
break
4447
}
4548
}

sdk/errata.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ func ApplyErrata(spec *spec.Specification) (err error) {
5252
spec.BuildDataTypeReferences()
5353
spec.BuildClusterReferences()
5454
}
55+
spec.ResolveConformances()
5556
return
5657
}
5758

0 commit comments

Comments
 (0)