Part Number: CC2651P3
I am trying to subscribe to ZDO_DEVICE_ANNOUNCE to receive the nwk and IEEE address of devices when they send the announce message. I am using zc_sampleapp_LP_CC2651P3_tirtos7_ticlang (simplelink_cc13xx_cc26xx_sdk_6_41_00_17). I receiving a bad pointer from the callback.
I have subscribed with this:
zdoCBReq.has_deviceAnnounce = true;
zdoCBReq.deviceAnnounce = true;
(void)Zstackapi_DevZDOCBReq(sampleApp_serviceTaskId, &zdoCBReq);
The handler is here:
static void sampleApp_processZStackMsgs(zstackmsg_genericReq_t *pMsg)
{
switch(pMsg->hdr.event)
{
case zstackmsg_CmdIDs_ZDO_DEVICE_ANNOUNCE:
{
zstackmsg_zdoDeviceAnnounceReq_t *pReq = (zstackmsg_zdoDeviceAnnounceReq_t *)pMsg;
processDeviceAnnounce(pReq->pReq);
}
break;
I have set a breakpoint at the processDeviceAnnounce() line. When I join a new device to the network, it sends Device Announce and then the breakpoint is triggered. Using the debugger, I look at pMsg. pMsg is a valid pointer.
This is the pMsg struct definition:
typedef struct _zstackmsg_genericreq_t
{
/** message header<br>
* event field must be set to @ref zstack_CmdIDs
*/
zstackmsg_HDR_t hdr;
/** Message command fields */
void *pReq;
} zstackmsg_genericReq_t;
with
typedef struct _zstackmsg_HDR_t
{
/** event */
uint8_t event;
/** Will hold the default response status field. */
uint8_t status;
#ifdef OSAL_PORT2TIRTOS
uint8_t srcServiceTask;
#endif
} zstackmsg_HDR_t;
These are the values observed using the debugger:
pMsg->hdr.event 0x48
pMsg->hdr.status 0
pMsg->hdr.srcServiceTask 0
pMsg->pReq 0x515D515D
0x515D515D is not a valid RAM address. In CC2651 RAM starts at 0x20000000.
The value 0x515D515D is not consistent. For example, in 3 attempts I saw 0x515D515D, 0x2A0B2A0B, and 0x5E735E73.
Thanks,
Andy