I wrote a string attribute to the coordinator in TestUI

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I wrote a string attribute to the coordinator in TestUI

1,892 Views
Janson
Contributor I

Hi,everyone:

  

 



I wrote a string attribute to the coordinator in TestUI, it responsed 0x15.

Does not support sending character attributes?

Screenshot 2023-11-27 at 17.15.30.png

0 Kudos
Reply
5 Replies

1,873 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello @Janson

Hope you are doing well.

You can try the following:

Add the following portion of code inside APP_u16ZncWriteDataPattern in app_zcl_event_handler.c

case (E_ZCL_CSTRING):
{
uint8 size=*pu8Struct;
*( uint8 * ) pu8Data++ =  *pu8Struct++;
memcpy(pu8Data,pu8Struct,size);
break;
}

Locate the following code inside APP_eSendWriteAttributesRequest in app_Znc_cmds.c:

u16offset += APP_u16ZncWriteDataPattern ( &pu8Data [ u16offset ],
pu8AttributeRequestList [ i + 2 ],
&pu8AttributeRequestList [ i + 3 ],
u16Size );

and add the following lines after that:

if (pu8AttributeRequestList[i+2]==E_ZCL_CSTRING)
break;

Try writing a 16 bytes (max) attribute data. Hope it helps.

Regards,
Eduardo. 

0 Kudos
Reply

1,864 Views
Janson
Contributor I

It errors

a label can only be part of a statement and a declaration is not a statement

 

1701137288807.jpg

 

0 Kudos
Reply

1,850 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi,

Please, wrap the content of the case in braces { }:

case (E_ZCL_CSTRING):
{
uint8 size=*pu8Struct;
*( uint8 * ) pu8Data++ =  *pu8Struct++;
memcpy(pu8Data,pu8Struct,size);
break;
}

Regards,
Eduardo.

0 Kudos
Reply

1,833 Views
Janson
Contributor I

It works ,thank you, but I encounter new problem . 
where can I get a attribute value in section code from router

 

such as 
APP_ZCL_cbEndpointCallback

 

0 Kudos
Reply

1,822 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi,

Please, consider taking a look at the JN-UG-3132 ZigBee3 Cluster Library (from JN5189 SDK > docs > wireless > Zigbee), Chapter 3 ZCL Fundamentals and Features, Section 2.3 Accessing Attributes.

Regards,
Eduardo.

0 Kudos
Reply