Skip to content

Commit

Permalink
add codegen changes
Browse files Browse the repository at this point in the history
  • Loading branch information
plauric committed Aug 14, 2023
1 parent e4f42e4 commit 778a881
Show file tree
Hide file tree
Showing 134 changed files with 2,861 additions and 2,949 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,22 @@
package chip.devicecontroller.cluster.eventstructs

import chip.devicecontroller.cluster.*
import chip.tlv.AnonymousTag
import chip.tlv.ContextSpecificTag
import chip.tlv.Tag
import chip.tlv.TlvParsingException
import chip.tlv.TlvReader
import chip.tlv.TlvWriter

class AccessControlClusterAccessControlEntryChangedEvent(
val adminNodeID: Long?,
val adminPasscodeID: Int?,
val changeType: Int,
val latestValue:
chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlEntryStruct?,
val fabricIndex: Int
) {
override fun toString(): String = buildString {
import java.util.Optional

class AccessControlClusterAccessControlEntryChangedEvent (
val adminNodeID: Long?,
val adminPasscodeID: Int?,
val changeType: Int,
val latestValue: chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlEntryStruct?,
val fabricIndex: Int) {
override fun toString(): String = buildString {
append("AccessControlClusterAccessControlEntryChangedEvent {\n")
append("\tadminNodeID : $adminNodeID\n")
append("\tadminPasscodeID : $adminPasscodeID\n")
Expand All @@ -44,21 +46,21 @@ class AccessControlClusterAccessControlEntryChangedEvent(
tlvWriter.apply {
startStructure(tag)
if (adminNodeID != null) {
put(ContextSpecificTag(TAG_ADMIN_NODE_I_D), adminNodeID)
} else {
putNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D))
}
put(ContextSpecificTag(TAG_ADMIN_NODE_I_D), adminNodeID)
} else {
putNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D))
}
if (adminPasscodeID != null) {
put(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D), adminPasscodeID)
} else {
putNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D))
}
put(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D), adminPasscodeID)
} else {
putNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D))
}
put(ContextSpecificTag(TAG_CHANGE_TYPE), changeType)
if (latestValue != null) {
latestValue.toTlv(ContextSpecificTag(TAG_LATEST_VALUE), this)
} else {
putNull(ContextSpecificTag(TAG_LATEST_VALUE))
}
latestValue.toTlv(ContextSpecificTag(TAG_LATEST_VALUE), this)
} else {
putNull(ContextSpecificTag(TAG_LATEST_VALUE))
}
put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex)
endStructure()
}
Expand All @@ -71,45 +73,32 @@ class AccessControlClusterAccessControlEntryChangedEvent(
private const val TAG_LATEST_VALUE = 4
private const val TAG_FABRIC_INDEX = 254

fun fromTlv(
tag: Tag,
tlvReader: TlvReader
): AccessControlClusterAccessControlEntryChangedEvent {
fun fromTlv(tag: Tag, tlvReader: TlvReader) : AccessControlClusterAccessControlEntryChangedEvent {
tlvReader.enterStructure(tag)
val adminNodeID =
if (!tlvReader.isNull()) {
tlvReader.getLong(ContextSpecificTag(TAG_ADMIN_NODE_I_D))
} else {
tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D))
null
}
val adminPasscodeID =
if (!tlvReader.isNull()) {
tlvReader.getInt(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D))
} else {
tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D))
null
}
val adminNodeID = if (!tlvReader.isNull()) {
tlvReader.getLong(ContextSpecificTag(TAG_ADMIN_NODE_I_D))
} else {
tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D))
null
}
val adminPasscodeID = if (!tlvReader.isNull()) {
tlvReader.getInt(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D))
} else {
tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D))
null
}
val changeType = tlvReader.getInt(ContextSpecificTag(TAG_CHANGE_TYPE))
val latestValue =
if (!tlvReader.isNull()) {
chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlEntryStruct
.fromTlv(ContextSpecificTag(TAG_LATEST_VALUE), tlvReader)
} else {
tlvReader.getNull(ContextSpecificTag(TAG_LATEST_VALUE))
null
}
val latestValue = if (!tlvReader.isNull()) {
chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlEntryStruct.fromTlv(ContextSpecificTag(TAG_LATEST_VALUE), tlvReader)
} else {
tlvReader.getNull(ContextSpecificTag(TAG_LATEST_VALUE))
null
}
val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX))

tlvReader.exitContainer()

return AccessControlClusterAccessControlEntryChangedEvent(
adminNodeID,
adminPasscodeID,
changeType,
latestValue,
fabricIndex
)
return AccessControlClusterAccessControlEntryChangedEvent(adminNodeID, adminPasscodeID, changeType, latestValue, fabricIndex)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,22 @@
package chip.devicecontroller.cluster.eventstructs

import chip.devicecontroller.cluster.*
import chip.tlv.AnonymousTag
import chip.tlv.ContextSpecificTag
import chip.tlv.Tag
import chip.tlv.TlvParsingException
import chip.tlv.TlvReader
import chip.tlv.TlvWriter

class AccessControlClusterAccessControlExtensionChangedEvent(
val adminNodeID: Long?,
val adminPasscodeID: Int?,
val changeType: Int,
val latestValue:
chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlExtensionStruct?,
val fabricIndex: Int
) {
override fun toString(): String = buildString {
import java.util.Optional

class AccessControlClusterAccessControlExtensionChangedEvent (
val adminNodeID: Long?,
val adminPasscodeID: Int?,
val changeType: Int,
val latestValue: chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlExtensionStruct?,
val fabricIndex: Int) {
override fun toString(): String = buildString {
append("AccessControlClusterAccessControlExtensionChangedEvent {\n")
append("\tadminNodeID : $adminNodeID\n")
append("\tadminPasscodeID : $adminPasscodeID\n")
Expand All @@ -44,21 +46,21 @@ class AccessControlClusterAccessControlExtensionChangedEvent(
tlvWriter.apply {
startStructure(tag)
if (adminNodeID != null) {
put(ContextSpecificTag(TAG_ADMIN_NODE_I_D), adminNodeID)
} else {
putNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D))
}
put(ContextSpecificTag(TAG_ADMIN_NODE_I_D), adminNodeID)
} else {
putNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D))
}
if (adminPasscodeID != null) {
put(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D), adminPasscodeID)
} else {
putNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D))
}
put(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D), adminPasscodeID)
} else {
putNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D))
}
put(ContextSpecificTag(TAG_CHANGE_TYPE), changeType)
if (latestValue != null) {
latestValue.toTlv(ContextSpecificTag(TAG_LATEST_VALUE), this)
} else {
putNull(ContextSpecificTag(TAG_LATEST_VALUE))
}
latestValue.toTlv(ContextSpecificTag(TAG_LATEST_VALUE), this)
} else {
putNull(ContextSpecificTag(TAG_LATEST_VALUE))
}
put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex)
endStructure()
}
Expand All @@ -71,45 +73,32 @@ class AccessControlClusterAccessControlExtensionChangedEvent(
private const val TAG_LATEST_VALUE = 4
private const val TAG_FABRIC_INDEX = 254

fun fromTlv(
tag: Tag,
tlvReader: TlvReader
): AccessControlClusterAccessControlExtensionChangedEvent {
fun fromTlv(tag: Tag, tlvReader: TlvReader) : AccessControlClusterAccessControlExtensionChangedEvent {
tlvReader.enterStructure(tag)
val adminNodeID =
if (!tlvReader.isNull()) {
tlvReader.getLong(ContextSpecificTag(TAG_ADMIN_NODE_I_D))
} else {
tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D))
null
}
val adminPasscodeID =
if (!tlvReader.isNull()) {
tlvReader.getInt(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D))
} else {
tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D))
null
}
val adminNodeID = if (!tlvReader.isNull()) {
tlvReader.getLong(ContextSpecificTag(TAG_ADMIN_NODE_I_D))
} else {
tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D))
null
}
val adminPasscodeID = if (!tlvReader.isNull()) {
tlvReader.getInt(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D))
} else {
tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D))
null
}
val changeType = tlvReader.getInt(ContextSpecificTag(TAG_CHANGE_TYPE))
val latestValue =
if (!tlvReader.isNull()) {
chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlExtensionStruct
.fromTlv(ContextSpecificTag(TAG_LATEST_VALUE), tlvReader)
} else {
tlvReader.getNull(ContextSpecificTag(TAG_LATEST_VALUE))
null
}
val latestValue = if (!tlvReader.isNull()) {
chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlExtensionStruct.fromTlv(ContextSpecificTag(TAG_LATEST_VALUE), tlvReader)
} else {
tlvReader.getNull(ContextSpecificTag(TAG_LATEST_VALUE))
null
}
val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX))

tlvReader.exitContainer()

return AccessControlClusterAccessControlExtensionChangedEvent(
adminNodeID,
adminPasscodeID,
changeType,
latestValue,
fabricIndex
)
return AccessControlClusterAccessControlExtensionChangedEvent(adminNodeID, adminPasscodeID, changeType, latestValue, fabricIndex)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
package chip.devicecontroller.cluster.eventstructs

import chip.devicecontroller.cluster.*
import chip.tlv.AnonymousTag
import chip.tlv.ContextSpecificTag
import chip.tlv.Tag
import chip.tlv.TlvParsingException
import chip.tlv.TlvReader
import chip.tlv.TlvWriter

class ActionsClusterActionFailedEvent(
val actionID: Int,
val invokeID: Long,
val newState: Int,
val error: Int
) {
override fun toString(): String = buildString {
import java.util.Optional

class ActionsClusterActionFailedEvent (
val actionID: Int,
val invokeID: Long,
val newState: Int,
val error: Int) {
override fun toString(): String = buildString {
append("ActionsClusterActionFailedEvent {\n")
append("\tactionID : $actionID\n")
append("\tinvokeID : $invokeID\n")
Expand All @@ -54,13 +57,13 @@ class ActionsClusterActionFailedEvent(
private const val TAG_NEW_STATE = 2
private const val TAG_ERROR = 3

fun fromTlv(tag: Tag, tlvReader: TlvReader): ActionsClusterActionFailedEvent {
fun fromTlv(tag: Tag, tlvReader: TlvReader) : ActionsClusterActionFailedEvent {
tlvReader.enterStructure(tag)
val actionID = tlvReader.getInt(ContextSpecificTag(TAG_ACTION_I_D))
val invokeID = tlvReader.getLong(ContextSpecificTag(TAG_INVOKE_I_D))
val newState = tlvReader.getInt(ContextSpecificTag(TAG_NEW_STATE))
val error = tlvReader.getInt(ContextSpecificTag(TAG_ERROR))

tlvReader.exitContainer()

return ActionsClusterActionFailedEvent(actionID, invokeID, newState, error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@
package chip.devicecontroller.cluster.eventstructs

import chip.devicecontroller.cluster.*
import chip.tlv.AnonymousTag
import chip.tlv.ContextSpecificTag
import chip.tlv.Tag
import chip.tlv.TlvParsingException
import chip.tlv.TlvReader
import chip.tlv.TlvWriter

class ActionsClusterStateChangedEvent(val actionID: Int, val invokeID: Long, val newState: Int) {
override fun toString(): String = buildString {
import java.util.Optional

class ActionsClusterStateChangedEvent (
val actionID: Int,
val invokeID: Long,
val newState: Int) {
override fun toString(): String = buildString {
append("ActionsClusterStateChangedEvent {\n")
append("\tactionID : $actionID\n")
append("\tinvokeID : $invokeID\n")
Expand All @@ -46,12 +53,12 @@ class ActionsClusterStateChangedEvent(val actionID: Int, val invokeID: Long, val
private const val TAG_INVOKE_I_D = 1
private const val TAG_NEW_STATE = 2

fun fromTlv(tag: Tag, tlvReader: TlvReader): ActionsClusterStateChangedEvent {
fun fromTlv(tag: Tag, tlvReader: TlvReader) : ActionsClusterStateChangedEvent {
tlvReader.enterStructure(tag)
val actionID = tlvReader.getInt(ContextSpecificTag(TAG_ACTION_I_D))
val invokeID = tlvReader.getLong(ContextSpecificTag(TAG_INVOKE_I_D))
val newState = tlvReader.getInt(ContextSpecificTag(TAG_NEW_STATE))

tlvReader.exitContainer()

return ActionsClusterStateChangedEvent(actionID, invokeID, newState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@
package chip.devicecontroller.cluster.eventstructs

import chip.devicecontroller.cluster.*
import chip.tlv.AnonymousTag
import chip.tlv.ContextSpecificTag
import chip.tlv.Tag
import chip.tlv.TlvParsingException
import chip.tlv.TlvReader
import chip.tlv.TlvWriter

class BasicInformationClusterLeaveEvent(val fabricIndex: Int) {
override fun toString(): String = buildString {
import java.util.Optional

class BasicInformationClusterLeaveEvent (
val fabricIndex: Int) {
override fun toString(): String = buildString {
append("BasicInformationClusterLeaveEvent {\n")
append("\tfabricIndex : $fabricIndex\n")
append("}\n")
Expand All @@ -40,10 +45,10 @@ class BasicInformationClusterLeaveEvent(val fabricIndex: Int) {
companion object {
private const val TAG_FABRIC_INDEX = 0

fun fromTlv(tag: Tag, tlvReader: TlvReader): BasicInformationClusterLeaveEvent {
fun fromTlv(tag: Tag, tlvReader: TlvReader) : BasicInformationClusterLeaveEvent {
tlvReader.enterStructure(tag)
val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX))

tlvReader.exitContainer()

return BasicInformationClusterLeaveEvent(fabricIndex)
Expand Down
Loading

0 comments on commit 778a881

Please sign in to comment.