2025-10-03 1:32 AM
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
2025-10-03 5:36 AM
Sorry. I was using the same pointer, which is actually the input for the stack.
Solved.