http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/158/3323.zdo.7z
There is some bug in xxx.lib files,so I have chaged correct file. 2014-5-15 PM 18:00
http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/158/0160.LIB.7z
I have make a lib file to deal with the joining by IEEE addr whitelist. By this way,U can input the Un-joined device's 8-byte IEEE address into any FFD(coordination or router) .
First,download this file “zdo.7z” and decompression,instead of the folder in your z-stack project "Components->stack->zdo".This lib is based on z-stack 2.6.1,so U should add it into a project with z-stack 2.6.1.
Then,U can open your project by IAR 8.20(for CC2530)or IAR 6.50(for CC2538).Now U can see, in Workspace ,many xxx.c files in the Group "ZDO " can't be found.Delete all xxx.c files except ZDConfig.c,and add the 3-lib files and ZDEnhanced.h Into Workspace like this.
Now U can use functions to add whitelist.
1,In file ZDEhanced.h,U can find function ZDE_Init and ZDE_event_loop,add them into OSAL task like this
const pTaskEventHandlerFn tasksArr[] = {
macEventLoop,
nwk_event_loop,
Hal_ProcessEvent,
#if defined( MT_TASK )
MT_ProcessEvent,
#endif
APS_event_loop,
#if defined ( ZIGBEE_FRAGMENTATION )
APSF_ProcessEvent,
#endif
ZDApp_event_loop,
#if defined ( ZIGBEE_FREQ_AGILITY ) || defined ( ZIGBEE_PANID_CONFLICT )
ZDNwkMgr_event_loop,
#endif
ZDE_event_loop,
zcl_event_loop,
zclSampleLight_event_loop
};
void osalInitTasks( void )
{
uint8 taskID = 0;
tasksEvents = (uint16 *)osal_mem_alloc( sizeof( uint16 ) * tasksCnt);
osal_memset( tasksEvents, 0, (sizeof( uint16 ) * tasksCnt));
macTaskInit( taskID++ );
nwk_init( taskID++ );
Hal_Init( taskID++ );
#if defined( MT_TASK )
MT_TaskInit( taskID++ );
#endif
APS_Init( taskID++ );
#if defined ( ZIGBEE_FRAGMENTATION )
APSF_Init( taskID++ );
#endif
ZDApp_Init( taskID++ );
#if defined ( ZIGBEE_FREQ_AGILITY ) || defined ( ZIGBEE_PANID_CONFLICT )
ZDNwkMgr_Init( taskID++ );
#endif
ZDE_Init( taskID++ );
zcl_Init( taskID++ );
zclSampleLight_Init( taskID );
}
2,Run "ZDO_RegisterForZdoCB(ZDO_JOIN_DENIED_CBID,xxx_function)" in your source,it is better run in your task-init.The xxx_function must follow this type that U can see what joining was denied by FFD.
void* xxx_function(void* p)
{
zdoJoinDenied_t *pInd = p;
print("FFD-%x had denied new joining",pInd->parentAddr);
print("%x,%x,%x,%x,%x,%x,%x,%x",pInd->extAddr[0],pInd->extAddr[1],pInd->extAddr[2],pInd->extAddr[3],pInd->extAddr[4],pInd->extAddr[5],pInd->extAddr[6],pInd->extAddr[7],);
return NULL;
}
3,Add Whitelist,function "ZDE_AcceptListInput" is to add one Whitelist into local device,and "ZDE_JoinAcceptReq" is to post one Whitelist into other FFD (can be "coord->routers" or "router->coord" or broadcast 0xFFFC) by new ZDO cluster "ZDE_Join_Accept_req"(0x0041).
