I wrote a string attribute to the coordinator in TestUI

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

I wrote a string attribute to the coordinator in TestUI

1,941件の閲覧回数
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 件の賞賛
返信
5 返答(返信)

1,922件の閲覧回数
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 件の賞賛
返信

1,913件の閲覧回数
Janson
Contributor I

It errors

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

 

1701137288807.jpg

 

0 件の賞賛
返信

1,899件の閲覧回数
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 件の賞賛
返信

1,882件の閲覧回数
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 件の賞賛
返信

1,871件の閲覧回数
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 件の賞賛
返信