sample-apps-for-matter-android
sample-apps-for-matter-android copied to clipboard
Regrading the device custom attributes through sample app, app getting crash with 195 error, But in iOS its working fine
Hi Team,
I added the one smart Wi-Fi light device through matter while using the your sample app. While controlling and reading the on off its working fine. But while reading the attributes the below errors are observed also app getting crashed.
FATAL EXCEPTION: main Process: package PID: 30323 chip.devicecontroller.ChipClusterException: CHIP cluster error: 195 Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@9b56298, Dispatchers.Main.immediate]
We tried different methods, but the same issues occurs every time. Please look into it and provide the solution for this?
suspend fun readBasicClusters(nodeId: Long) { /* val endpointId = 1 val clusterId = 0x00000090 val attributeName = "power" val attributeId = 0x00000008*/
/* val chipAttribute = ChipAttributePath.newInstance(1, 0x00000090, 0x00000008) val chipAttribute1 = ChipAttributePath.newInstance(1, 0x00000090, 0x0000000C) val chipAttribute2 = ChipAttributePath.newInstance(1, 0x00000090, 0x0000000B)*/
val chipAttribute =
ChipAttributePath.newInstance(1, 144, 8)
val chipAttribute1 =
ChipAttributePath.newInstance(1, 144, 12)
val chipAttribute2 =
ChipAttributePath.newInstance(1, 144, 11)
val attributePaths = listOf(chipAttribute, chipAttribute1, chipAttribute2)
val devicePtr =
try {
chipClient.getConnectedDevicePointer(nodeId)
} catch (e: IllegalStateException) {
Timber.d("getConnectedDevicePointer--> exception $e")
return
}
/*chipClient.readAttributes(nodeId, attributePaths)*/
/*chipClient.chipDeviceController.readAttributePath(
object : ReportCallback {
override fun onError(
attributePath: ChipAttributePath?,
eventPath: ChipEventPath?,
e: Exception?
) {
Timber.d("readAttributes onError--> $e")
}
override fun onReport(nodeState: NodeState?) {
Timber.d("readAttributes onReport--> $nodeState")
val states: HashMap<ChipAttributePath, AttributeState> = HashMap()
for (path in attributePaths) {
var endpoint: Int = path.endpointId.id.toInt()
states[path] =
nodeState!!
.getEndpointState(endpoint)!!
.getClusterState(path.clusterId.id)!!
.getAttributeState(path.attributeId.id)!!
}
Timber.d("readAttributes states--> $states")
}
override fun onDone() {
super.onDone()
}
},
nodeId,
attributePaths
)*/
/*chipClient.chipDeviceController.readPath(
object : ReportCallback {
override fun onError(
attributePath: ChipAttributePath?,
eventPath: ChipEventPath?,
ex: java.lang.Exception
) {
Timber.e("TAG->Read $attributeName failure $ex")
}
override fun onReport(nodeState: NodeState?) {
Timber.d("TAG->onReport $nodeState")
val tlv = nodeState?.getEndpointState(endpointId)
?.getClusterState(clusterId.toLong())
?.getAttributeState(attributeId.toLong())
?.tlv
*//*val value = tlv?.let { TlvReader(it) }*//*
Timber.d("TAG->[Read Success] $attributeName: $tlv")
}
},
devicePtr,
listOf(chipAttribute, chipAttribute1, chipAttribute2),
null,
false
)*/
/*clustersHelper.readApplicationBasicClusterAttributeList(nodeId, 1)
clustersHelper.readBasicClusterAttributeList(nodeId, 1)*/