cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55 Zigbee: ZbZclWriteReq fails with more than one attribute

mmen
Visitor
Spoiler
Hi,

When using ZbZclWriteReq to write Zigbee attributes remotely, it works OK if I write one attribute at a time, but I am not able to write several at once. Shouldn't the following code work with two attributes? Is there any limitation in the implemented stack?

memset(&writeReq, 0, sizeof(writeReq));

writeReq.dst.mode = ZB_APSDE_ADDRMODE_SHORT;

writeReq.dst.endpoint =SW1_ENDPOINT;

writeReq.dst.nwkAddr = 0x0000;

 

writeReq.count = 2U;

writeReq.attr[0].attrId=MY_ZCL_DEV_TEMP_CURRENT ;

writeReq.attr[0].type=ZCL_DATATYPE_SIGNED_16BIT;

 

writeReq.attr[0].value= (const uint8_t*) val;

writeReq.attr[0].length = 2;

 

writeReq.attr[1].attrId=MY_ZCL_DEV_PRESS_CURRENT ;

writeReq.attr[1].type=ZCL_DATATYPE_SIGNED_16BIT;


writeReq.attr[1].value= (
const uint8_t*) val2;

writeReq.attr[1].length = 2;

 

if(ZbZclWriteReq(zigbee_app_info.device_temp_client, &writeReq, APP_ZIGBEE_Write_cb,NULL) != ZCL_STATUS_SUCCESS)

{

APP_DBG("Error, ZbZclReadReq failed (SW1_ENDPOINT)");

}

This works perfectly if writeReq.count is 1 and I write the two attributes separately.

If I try to use count=2, I always get an error in the Callback function.

Thank you,

Mikel


 

1 REPLY 1
mmen
Visitor

Sorry. I was using the same pointer, which is actually the input for the stack.

Solved.