Documentation
¶
Overview ¶
Package groups is the generated definition of the Matter Groups cluster (0x0004, revision 4), from the matter.js model at 862ad75 (Matter 1.6.1).
It declares the cluster's ids, typed enums, bitmaps and structs with their TLV codecs, the command and event payloads, and Definition, the metadata the cluster/spec runtime derives lists, privileges and write checks from. Importing the package registers the definition with spec.Register, so the bridge decodes the cluster's request payloads.
Index ¶
- Constants
- Variables
- type AddGroupIfIdentifyingRequest
- type AddGroupRequest
- type AddGroupResponse
- type Feature
- type GetGroupMembershipRequest
- type GetGroupMembershipResponse
- type NameSupportBitmap
- type RemoveAllGroupsRequest
- type RemoveGroupRequest
- type RemoveGroupResponse
- type Status
- type ViewGroupRequest
- type ViewGroupResponse
Constants ¶
const ( ClusterID uint32 = 0x0004 Name = "Groups" Revision uint16 = 4 )
Cluster identity.
const ( CmdAddGroup uint32 = 0x00 // request → AddGroupResponse, M CmdAddGroupResponse uint32 = 0x00 // response, M CmdViewGroup uint32 = 0x01 // request → ViewGroupResponse, M CmdViewGroupResponse uint32 = 0x01 // response, M CmdGetGroupMembership uint32 = 0x02 // request → GetGroupMembershipResponse, M CmdGetGroupMembershipResponse uint32 = 0x02 // response, M CmdRemoveGroup uint32 = 0x03 // request → RemoveGroupResponse, M CmdRemoveGroupResponse uint32 = 0x03 // response, M CmdRemoveAllGroups uint32 = 0x04 // request → status, M CmdAddGroupIfIdentifying uint32 = 0x05 // request → status, M )
Command ids.
const (
AttrNameSupport uint32 = 0x0000 // NameSupportBitmap, M, R V, F
)
Attribute ids.
Variables ¶
var Definition = &spec.Cluster{ ID: ClusterID, Name: Name, Revision: Revision, Features: []spec.Feature{ {Name: "GN", Title: "GroupNames", Bit: 0, Conformance: spec.Conformance{Text: "O", Op: spec.ConfOptional}}, }, Attributes: []spec.Attribute{ { ID: AttrNameSupport, Name: "NameSupport", Type: spec.Type{Name: "NameSupportBitmap", Kind: spec.KindBitmap, Bits: 8, Bitmap: NameSupportBitmapDef}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Access: spec.Access{RW: "R", Read: spec.PrivilegeView}, Quality: spec.Quality{Fixed: true}, Constraint: spec.Constraint{Text: "desc", Desc: true}, }, }, Commands: []spec.Command{ { ID: CmdAddGroup, Name: "AddGroup", Direction: spec.Request, Response: "AddGroupResponse", Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Access: spec.Access{RW: "R", Read: spec.PrivilegeManage, Write: spec.PrivilegeManage, Fabric: "F"}, Fields: []spec.Field{ {ID: 0, Name: "GroupId", Type: spec.Type{Name: "group-id", Kind: spec.KindUint, Bits: 16}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "min 1", Min: &spec.Bound{Int: 1}}}, {ID: 1, Name: "GroupName", Type: spec.Type{Name: "string", Kind: spec.KindString}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "max 16", Max: &spec.Bound{Int: 16}}}, }, Decode: decodeAddGroupRequest, }, { ID: CmdAddGroupResponse, Name: "AddGroupResponse", Direction: spec.Response, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Access: spec.Access{RW: "RW", Read: spec.PrivilegeView, Write: spec.PrivilegeOperate}, Fields: []spec.Field{ {ID: 0, Name: "Status", Type: spec.Type{Name: "status", Kind: spec.KindEnum, Bits: 8, Enum: StatusDef}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "desc", Desc: true}}, {ID: 1, Name: "GroupId", Type: spec.Type{Name: "group-id", Kind: spec.KindUint, Bits: 16}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "min 1", Min: &spec.Bound{Int: 1}}}, }, Decode: decodeAddGroupResponse, }, { ID: CmdViewGroup, Name: "ViewGroup", Direction: spec.Request, Response: "ViewGroupResponse", Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Access: spec.Access{RW: "R", Read: spec.PrivilegeOperate, Write: spec.PrivilegeOperate, Fabric: "F"}, Fields: []spec.Field{ {ID: 0, Name: "GroupId", Type: spec.Type{Name: "group-id", Kind: spec.KindUint, Bits: 16}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "min 1", Min: &spec.Bound{Int: 1}}}, }, Decode: decodeViewGroupRequest, }, { ID: CmdViewGroupResponse, Name: "ViewGroupResponse", Direction: spec.Response, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Access: spec.Access{RW: "RW", Read: spec.PrivilegeView, Write: spec.PrivilegeOperate}, Fields: []spec.Field{ {ID: 0, Name: "Status", Type: spec.Type{Name: "status", Kind: spec.KindEnum, Bits: 8, Enum: StatusDef}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "desc", Desc: true}}, {ID: 1, Name: "GroupId", Type: spec.Type{Name: "group-id", Kind: spec.KindUint, Bits: 16}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "min 1", Min: &spec.Bound{Int: 1}}}, {ID: 2, Name: "GroupName", Type: spec.Type{Name: "string", Kind: spec.KindString}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "max 16", Max: &spec.Bound{Int: 16}}}, }, Decode: decodeViewGroupResponse, }, { ID: CmdGetGroupMembership, Name: "GetGroupMembership", Direction: spec.Request, Response: "GetGroupMembershipResponse", Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Access: spec.Access{RW: "R", Read: spec.PrivilegeOperate, Write: spec.PrivilegeOperate, Fabric: "F"}, Fields: []spec.Field{ {ID: 0, Name: "GroupList", Type: spec.Type{Name: "list", Kind: spec.KindList, Entry: &spec.Field{Name: "entry", Type: spec.Type{Name: "group-id", Kind: spec.KindUint, Bits: 16}}}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "all[min 1]", Entry: &spec.Constraint{Text: "min 1", Min: &spec.Bound{Int: 1}}}}, }, Decode: decodeGetGroupMembershipRequest, }, { ID: CmdGetGroupMembershipResponse, Name: "GetGroupMembershipResponse", Direction: spec.Response, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Access: spec.Access{RW: "RW", Read: spec.PrivilegeView, Write: spec.PrivilegeOperate}, Fields: []spec.Field{ {ID: 0, Name: "Capacity", Type: spec.Type{Name: "uint8", Kind: spec.KindUint, Bits: 8}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Quality: spec.Quality{Nullable: true}}, {ID: 1, Name: "GroupList", Type: spec.Type{Name: "list", Kind: spec.KindList, Entry: &spec.Field{Name: "entry", Type: spec.Type{Name: "group-id", Kind: spec.KindUint, Bits: 16}}}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "all[min 1]", Entry: &spec.Constraint{Text: "min 1", Min: &spec.Bound{Int: 1}}}}, }, Decode: decodeGetGroupMembershipResponse, }, { ID: CmdRemoveGroup, Name: "RemoveGroup", Direction: spec.Request, Response: "RemoveGroupResponse", Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Access: spec.Access{RW: "R", Read: spec.PrivilegeManage, Write: spec.PrivilegeManage, Fabric: "F"}, Fields: []spec.Field{ {ID: 0, Name: "GroupId", Type: spec.Type{Name: "group-id", Kind: spec.KindUint, Bits: 16}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "min 1", Min: &spec.Bound{Int: 1}}}, }, Decode: decodeRemoveGroupRequest, }, { ID: CmdRemoveGroupResponse, Name: "RemoveGroupResponse", Direction: spec.Response, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Access: spec.Access{RW: "RW", Read: spec.PrivilegeView, Write: spec.PrivilegeOperate}, Fields: []spec.Field{ {ID: 0, Name: "Status", Type: spec.Type{Name: "status", Kind: spec.KindEnum, Bits: 8, Enum: StatusDef}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "desc", Desc: true}}, {ID: 1, Name: "GroupId", Type: spec.Type{Name: "group-id", Kind: spec.KindUint, Bits: 16}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "min 1", Min: &spec.Bound{Int: 1}}}, }, Decode: decodeRemoveGroupResponse, }, { ID: CmdRemoveAllGroups, Name: "RemoveAllGroups", Direction: spec.Request, Response: "status", Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Access: spec.Access{RW: "R", Read: spec.PrivilegeManage, Write: spec.PrivilegeManage, Fabric: "F"}, Decode: decodeRemoveAllGroupsRequest, }, { ID: CmdAddGroupIfIdentifying, Name: "AddGroupIfIdentifying", Direction: spec.Request, Response: "status", Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Access: spec.Access{RW: "R", Read: spec.PrivilegeManage, Write: spec.PrivilegeManage, Fabric: "F"}, Fields: []spec.Field{ {ID: 0, Name: "GroupId", Type: spec.Type{Name: "group-id", Kind: spec.KindUint, Bits: 16}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "min 1", Min: &spec.Bound{Int: 1}}}, {ID: 1, Name: "GroupName", Type: spec.Type{Name: "string", Kind: spec.KindString}, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}, Constraint: spec.Constraint{Text: "max 16", Max: &spec.Bound{Int: 16}}}, }, Decode: decodeAddGroupIfIdentifyingRequest, }, }, }
Definition is the Groups cluster definition.
var NameSupportBitmapDef = &spec.Bitmap{Name: "NameSupportBitmap", Bits: 8, Members: []spec.BitmapMember{ {Name: "GroupNames", Bit: 7, Width: 1, Conformance: spec.Conformance{Text: "M", Op: spec.ConfMandatory}}, }}
NameSupportBitmapDef describes NameSupportBitmap.
fabric:reachable:reason="generated: referenced from Definition and the generated test; a package-level initializer, which RTA does not follow"
var StatusDef = &spec.Enum{Name: "status", Bits: 8, Values: []spec.EnumValue{ {Value: 0, Name: "Success"}, {Value: 1, Name: "Failure"}, {Value: 125, Name: "InvalidSubscription"}, {Value: 126, Name: "UnsupportedAccess"}, {Value: 127, Name: "UnsupportedEndpoint"}, {Value: 128, Name: "InvalidAction"}, {Value: 129, Name: "UnsupportedCommand"}, {Value: 133, Name: "InvalidCommand"}, {Value: 134, Name: "UnsupportedAttribute"}, {Value: 135, Name: "ConstraintError"}, {Value: 136, Name: "UnsupportedWrite"}, {Value: 137, Name: "ResourceExhausted"}, {Value: 139, Name: "NotFound"}, {Value: 141, Name: "InvalidDataType"}, {Value: 143, Name: "UnsupportedRead"}, {Value: 146, Name: "DataVersionMismatch"}, {Value: 148, Name: "Timeout"}, {Value: 155, Name: "UnsupportedNode"}, {Value: 156, Name: "Busy"}, {Value: 157, Name: "AccessRestricted"}, {Value: 195, Name: "UnsupportedCluster"}, {Value: 198, Name: "NeedsTimedInteraction"}, {Value: 199, Name: "UnsupportedEvent"}, {Value: 200, Name: "PathsExhausted"}, {Value: 201, Name: "TimedRequestMismatch"}, {Value: 202, Name: "FailsafeRequired"}, {Value: 203, Name: "InvalidInState"}, {Value: 204, Name: "NoCommandResponse"}, {Value: 205, Name: "TermsAndConditionsChanged"}, {Value: 206, Name: "MaintenanceRequired"}, {Value: 207, Name: "DynamicConstraintError"}, {Value: 208, Name: "AlreadyExists"}, {Value: 209, Name: "InvalidTransportType"}, }}
StatusDef describes status.
fabric:reachable:reason="generated: referenced from Definition and the generated test; a package-level initializer, which RTA does not follow"
Functions ¶
This section is empty.
Types ¶
type AddGroupIfIdentifyingRequest ¶
type AddGroupIfIdentifyingRequest struct {
GroupId uint16 // 0: group-id, M, min 1
GroupName string // 1: string, M, max 16
}
AddGroupIfIdentifyingRequest is the AddGroupIfIdentifying command payload.
type AddGroupRequest ¶
type AddGroupRequest struct {
GroupId uint16 // 0: group-id, M, min 1
GroupName string // 1: string, M, max 16
}
AddGroupRequest is the AddGroup command payload.
type AddGroupResponse ¶
type AddGroupResponse struct {
Status Status // 0: status, M, desc
GroupId uint16 // 1: group-id, M, min 1
}
AddGroupResponse is the AddGroupResponse command payload.
func (*AddGroupResponse) DecodeTLV ¶
func (v *AddGroupResponse) DecodeTLV(n spec.Node) error
DecodeTLV decodes the structure n into v.
func (AddGroupResponse) EncodeTLV ¶
func (v AddGroupResponse) EncodeTLV(enc *tlv.Encoder, tag tlv.Tag)
EncodeTLV implements spec.Encodable.
func (AddGroupResponse) ResponseCommand ¶
func (AddGroupResponse) ResponseCommand() (clusterID, commandID uint32)
ResponseCommand implements spec.ResponsePayload.
type Feature ¶
type Feature uint32
Feature is a Groups FeatureMap bit.
fabric:reachable:reason="generated: referenced from Definition and the generated test; a package-level initializer, which RTA does not follow"
const (
FeatureGroupNames Feature = 1 << 0 // GN, O
)
FeatureMap bits.
type GetGroupMembershipRequest ¶
type GetGroupMembershipRequest struct {
GroupList []uint16 // 0: list[group-id], M, all[min 1]
}
GetGroupMembershipRequest is the GetGroupMembership command payload.
type GetGroupMembershipResponse ¶
type GetGroupMembershipResponse struct {
Capacity spec.Nullable[uint8] // 0: uint8, M, X
GroupList []uint16 // 1: list[group-id], M, all[min 1]
}
GetGroupMembershipResponse is the GetGroupMembershipResponse command payload.
func (*GetGroupMembershipResponse) DecodeTLV ¶
func (v *GetGroupMembershipResponse) DecodeTLV(n spec.Node) error
DecodeTLV decodes the structure n into v.
func (GetGroupMembershipResponse) EncodeTLV ¶
func (v GetGroupMembershipResponse) EncodeTLV(enc *tlv.Encoder, tag tlv.Tag)
EncodeTLV implements spec.Encodable.
func (GetGroupMembershipResponse) ResponseCommand ¶
func (GetGroupMembershipResponse) ResponseCommand() (clusterID, commandID uint32)
ResponseCommand implements spec.ResponsePayload.
type NameSupportBitmap ¶
type NameSupportBitmap uint8
NameSupportBitmap is the NameSupportBitmap map8.
fabric:reachable:reason="generated: referenced from Definition and the generated test; a package-level initializer, which RTA does not follow"
const (
NameSupportGroupNames NameSupportBitmap = 1 << 7 // M
)
NameSupportBitmap bits; a member wider than one bit is its mask.
type RemoveAllGroupsRequest ¶
type RemoveAllGroupsRequest struct{}
RemoveAllGroupsRequest is the RemoveAllGroups command payload.
type RemoveGroupRequest ¶
type RemoveGroupRequest struct {
GroupId uint16 // 0: group-id, M, min 1
}
RemoveGroupRequest is the RemoveGroup command payload.
type RemoveGroupResponse ¶
type RemoveGroupResponse struct {
Status Status // 0: status, M, desc
GroupId uint16 // 1: group-id, M, min 1
}
RemoveGroupResponse is the RemoveGroupResponse command payload.
func (*RemoveGroupResponse) DecodeTLV ¶
func (v *RemoveGroupResponse) DecodeTLV(n spec.Node) error
DecodeTLV decodes the structure n into v.
func (RemoveGroupResponse) EncodeTLV ¶
func (v RemoveGroupResponse) EncodeTLV(enc *tlv.Encoder, tag tlv.Tag)
EncodeTLV implements spec.Encodable.
func (RemoveGroupResponse) ResponseCommand ¶
func (RemoveGroupResponse) ResponseCommand() (clusterID, commandID uint32)
ResponseCommand implements spec.ResponsePayload.
type Status ¶
type Status uint8
Status is the status enum8.
fabric:reachable:reason="generated: referenced from Definition and the generated test; a package-level initializer, which RTA does not follow"
const ( StatusSuccess Status = 0 StatusFailure Status = 1 StatusInvalidSubscription Status = 125 StatusUnsupportedAccess Status = 126 StatusUnsupportedEndpoint Status = 127 StatusInvalidAction Status = 128 StatusUnsupportedCommand Status = 129 StatusInvalidCommand Status = 133 StatusUnsupportedAttribute Status = 134 StatusConstraintError Status = 135 StatusUnsupportedWrite Status = 136 StatusResourceExhausted Status = 137 StatusNotFound Status = 139 StatusInvalidDataType Status = 141 StatusUnsupportedRead Status = 143 StatusDataVersionMismatch Status = 146 StatusTimeout Status = 148 StatusUnsupportedNode Status = 155 StatusBusy Status = 156 StatusAccessRestricted Status = 157 StatusUnsupportedCluster Status = 195 StatusNeedsTimedInteraction Status = 198 StatusUnsupportedEvent Status = 199 StatusPathsExhausted Status = 200 StatusTimedRequestMismatch Status = 201 StatusFailsafeRequired Status = 202 StatusInvalidInState Status = 203 StatusNoCommandResponse Status = 204 StatusTermsAndConditionsChanged Status = 205 StatusMaintenanceRequired Status = 206 StatusDynamicConstraintError Status = 207 StatusAlreadyExists Status = 208 StatusInvalidTransportType Status = 209 )
Status values.
type ViewGroupRequest ¶
type ViewGroupRequest struct {
GroupId uint16 // 0: group-id, M, min 1
}
ViewGroupRequest is the ViewGroup command payload.
type ViewGroupResponse ¶
type ViewGroupResponse struct {
Status Status // 0: status, M, desc
GroupId uint16 // 1: group-id, M, min 1
GroupName string // 2: string, M, max 16
}
ViewGroupResponse is the ViewGroupResponse command payload.
func (*ViewGroupResponse) DecodeTLV ¶
func (v *ViewGroupResponse) DecodeTLV(n spec.Node) error
DecodeTLV decodes the structure n into v.
func (ViewGroupResponse) EncodeTLV ¶
func (v ViewGroupResponse) EncodeTLV(enc *tlv.Encoder, tag tlv.Tag)
EncodeTLV implements spec.Encodable.
func (ViewGroupResponse) ResponseCommand ¶
func (ViewGroupResponse) ResponseCommand() (clusterID, commandID uint32)
ResponseCommand implements spec.ResponsePayload.