Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
yunhanw-google committed Nov 13, 2023
1 parent 13a79be commit a214863
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import chip.devicecontroller.model.AttributeState
import chip.devicecontroller.model.ChipAttributePath
import chip.devicecontroller.model.ChipEventPath
import chip.devicecontroller.model.ChipPathId
import chip.devicecontroller.model.DataVersionFilter
import chip.devicecontroller.model.EventState
import chip.devicecontroller.model.NodeState
import com.matter.controller.commands.common.CredentialsIssuer
Expand Down Expand Up @@ -169,6 +170,15 @@ class PairOnNetworkLongImReadCommand(
)
)

val dataVersionFilterList =
listOf(
DataVersionFilter.newInstance(
ChipPathId.forId(/* endpointId= */ 0),
ChipPathId.forId(CLUSTER_ID_BASIC),
CLUSTER_ID_BASIC_VERSION,
)
)

currentCommissioner()
.pairDeviceWithAddress(
getNodeId(),
Expand All @@ -184,7 +194,15 @@ class PairOnNetworkLongImReadCommand(
.getConnectedDevicePointer(getNodeId(), InternalGetConnectedDeviceCallback())
clear()
currentCommissioner()
.readPath(InternalReportCallback(), devicePointer, attributePathList, eventPathList, false, 0)
.readPath(
InternalReportCallback(),
devicePointer,
attributePathList,
eventPathList,
dataVersionFilterList,
false,
0
)
waitCompleteMs(getTimeoutMillis())
}

Expand All @@ -198,5 +216,6 @@ class PairOnNetworkLongImReadCommand(
private const val ATTR_ID_LOCAL_CONFIG_DISABLED = 16L
private const val EVENT_ID_START_UP = 0L
private const val GLOBAL_ATTRIBUTE_LIST = 65531L
private const val CLUSTER_ID_BASIC_VERSION = 0L
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import chip.devicecontroller.ResubscriptionAttemptCallback
import chip.devicecontroller.SubscriptionEstablishedCallback
import chip.devicecontroller.model.ChipAttributePath
import chip.devicecontroller.model.ChipEventPath
import chip.devicecontroller.model.ChipPathId
import chip.devicecontroller.model.DataVersionFilter
import chip.devicecontroller.model.NodeState
import com.matter.controller.commands.common.CredentialsIssuer
import java.util.Collections
Expand Down Expand Up @@ -81,6 +83,15 @@ class PairOnNetworkLongImSubscribeCommand(
)
)

val dataVersionFilterList =
listOf(
DataVersionFilter.newInstance(
ChipPathId.forId(/* endpointId= */ 0),
ChipPathId.forId(CLUSTER_ID_BASIC),
CLUSTER_ID_BASIC_VERSION,
)
)

currentCommissioner()
.pairDeviceWithAddress(
getNodeId(),
Expand All @@ -103,6 +114,7 @@ class PairOnNetworkLongImSubscribeCommand(
devicePointer,
attributePathList,
Collections.emptyList(),
dataVersionFilterList,
0,
5,
false,
Expand All @@ -120,5 +132,6 @@ class PairOnNetworkLongImSubscribeCommand(
private const val MATTER_PORT = 5540
private const val CLUSTER_ID_BASIC = 0x0028L
private const val ATTR_ID_LOCAL_CONFIG_DISABLED = 16L
private const val CLUSTER_ID_BASIC_VERSION = 0L
}
}

0 comments on commit a214863

Please sign in to comment.