void delete_asso( uint8 index) { uint8 i; AddrMgrEntry_t addrEntry; NLME_LeaveReq_t req; addrEntry.user = ADDRMGR_USER_DEFAULT; addrEntry.index = index; if (AddrMgrEntryGet( &addrEntry )) { for (i = 0; i < Z_EXTADDR_LEN; i++ ) { if ( addrEntry.extAddr != 0 ){ break;} } } if(i < Z_EXTADDR_LEN){ // Remove device req.extAddr = addrEntry.extAddr; req.removeChildren = TRUE; req.rejoin = TRUE; req.silent = FALSE; NLME_LeaveReq( &req ); }else{ AssocRemove(addrEntry.extAddr); ZDApp_NVUpdate(); } }
/********************************************************************* * @fn bindingAddrMgsHelperConvertShort * * @brief Convert an index into a short address * * @param idx - * * @return INVALID_NODE_ADDR if not available, otherwise the short address */ uint16 bindingAddrMgsHelperConvertShort( uint16 idx ) { AddrMgrEntry_t entry; // Resolve addresses with the address manager entry.user = ADDRMGR_USER_BINDING; entry.index = idx; AddrMgrEntryGet( &entry ); return ( entry.nwkAddr ); }
/********************************************************************* * @fn bindingAddrMgsHelperConvert * * @brief Convert an index into an zAddrType_t * * @param idx - * @param addr - zAddrType_t * * @return TRUE if found, FALSE if not */ uint8 bindingAddrMgsHelperConvert( uint16 idx, zAddrType_t *addr ) { AddrMgrEntry_t entry; uint8 stat; // Resolve addresses with the address manager entry.user = ADDRMGR_USER_BINDING; entry.index = idx; stat = AddrMgrEntryGet( &entry ); if ( stat ) { addr->addrMode = Addr64Bit; osal_cpyExtAddr( addr->addr.extAddr, entry.extAddr ); } return ( stat ); }