Other Parts Discussed in Thread: Z-STACK
Hello everyone,
I use ZStack-CC2530-2.4.0, and I'm trying to use the function
NLME_DirectJoinRequest()
but it doesn't give any result.
In "SampleApp.c", I defined 3 switches like this:
unsigned char device_address[8] = {0xD9, 0xA6, 0x17, 0x01, 0x00, 0x4B, 0x12, 0x00}; //external ZED address
byte mac_cap = CAPINFO_DEVICETYPE_RFD;
void SampleApp_HandleKeys( uint8 shift, uint8 keys )
{
(void)shift;
if ( keys & HAL_KEY_SW_1 )
{
// ZDP_MgmtDirectJoinReq( &ZAddr, device_address, mac_cap, 0 );
NLME_DirectJoinRequest( device_address, mac_cap );
}
if ( keys & HAL_KEY_SW_2 )
{
zAddrType_t ZAddr;
ZAddr.addr.shortAddr = NLME_GetShortAddr();
ZAddr.addrMode = Addr16Bit;
ZDP_MgmtLeaveReq( &ZAddr, device_address,1,1, 0 );
}
if ( keys & HAL_KEY_SW_4 )
{
NLME_RemoveChild( device_address, TRUE ); // second parametr dealloc
}
}
When I push SW1, it must join to my ZC or ZR, SW2 enables ZED to leave his current parent but nothing happens.
I'm trying SW4 NLME_RemoveChild but it also doesn't help removing child from his parent.
I turn on flags in ZDConfig.h
ZDO_MGMT_JOINDIRECT_REQUEST
ZDO_MGMT_LEAVE_REQUEST
ZDO_MGMT_LEAVE_RESPONSE
My questions are: What have i done wrong, or what did i forget to do that made this function not work?
How can i test these function to see that they work correctly?