Hi,everyone:
I wrote a string attribute to the coordinator in TestUI, it responsed 0x15.
Does not support sending character attributes?
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.
It errors
a label can only be part of a statement and a declaration is not a statement
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.
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
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.