Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regrading the device custom attributes through sample app, app getting crash with 195 error, But in iOS its working fine #215

Open
NagendraMudadla opened this issue Jun 26, 2024 · 2 comments

Comments

@NagendraMudadla
Copy link

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)*/
@law-ko
Copy link

law-ko commented Jul 17, 2024

@NagendraMudadla Any solutions to this?

@NagendraMudadla
Copy link
Author

@NagendraMudadla Any solutions to this?

No still we are facing this custom attribute reading?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants