Other Parts Discussed in Thread: Z-STACK
Hello,
I'm developing a ZigBee Home Automation compliant application. I'd like to be able to send a "READ attribute" command to one of the connected device (an On/Off switch).
zclReadCmd_t * readCmd;
readCmd = osal_mem_alloc(sizeof(zclReadCmd_t) + sizeof(uint16));
if(readCmd)
{
readCmd->numAttr = 1;
readCmd->attrID[0] = ATTRID_ON_OFF;
zcl_SendRead(HOMIPRL_ENDPOINT, &addr, ZCL_CLUSTER_ID_GEN_ON_OFF, readCmd, ZCL_FRAME_CLIENT_SERVER_DIR, 0, 0);
osal_mem_free(readCmd);
}
This code works. I receive the right cluster and value. But if I retry this same piece of code, the osal_mem_alloc returns NULL.
First I thank that it comes from somewhere else in the code but curiously if I increase the size to allocate in the previous mem_alloc (+10 instead of sizeof(uint16)) the code works fine and we can go through this read command many times with no issue.
So I'd like to know if anyone knows where we can find more information about the ZCL. I've searched in the docs, there's only one (Z-Stack ZCL API) but it doesn't cover the READ attributes. There's no information at all on read, write etc attributes commands, callbacks etc.
If someone from Ti reads me, it would be great to have more documentation on this subject. I've heard about a zcl_testapp.c that has never been added to the Z-Stack.
Thanks for your support,
Regards,
Michaël Ughetti