⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nwk_neighbor.h

📁 ucos在NEC平台下的移植
💻 H
字号:
 #ifndef NWK_NEIGHBOR_H
 #define NWK_NEIGHBOR_H

//-------------------------------------------------------------------------------------------------------
// void neighborTableInit(void);
//
//  DESCRIPTION:
//     Init neighbor table. Called when Network is formed by PAN coordinator or when a Router successfully joins a network.
//     This also initializes the address table block.
//
//  PARAMETERS:
//      NO
//  RETURN VALUE:
//      NO
//-------------------------------------------------------------------------------------------------------
void neighborTableInit(void); 

//-------------------------------------------------------------------------------------------------------
// void ntInitAddressMap(void);
//
//  DESCRIPTION:
//     This function called anytime the Coordinator forms a network or a router joins a network.
//      the first entry in the address map is always our own.
//  PARAMETERS:
//      NO
//  RETURN VALUE:
//      NO
//-------------------------------------------------------------------------------------------------------
void ntInitAddressMap(void);

//-------------------------------------------------------------------------------
// NEIGHBOR_INDEX NWKLookupNodeByLongAddr(BYTE *longAddr)
//
// DESCRIPTION:
//          Searches neighbor table for matching short address
// PARAMETER:
//          QWORD *longAddr,
//              Long address of node that is to be looked up in the neighbor  table.
// RETURN-VALUE:
//          The index  of the matched entry in the neighbor table,
//           if there is no matched entry,return INVALID_NEIGHBOR_KEY;
//Side Effects:    If found, the matching neighbor table entry is in
//                  currentNeighborRecord and pCurrentNeighborRecord
//                 points to its location in the table.
//----------------------------------------------------------------------------------
NEIGHBOR_INDEX  NWKLookupNodeByLongAddr(BYTE *longAddr);

//-------------------------------------------------------------------------------
// NEIGHBOR_INDEX NWKLookupNodeByShortAddr(UINT16 shortAddr)
//
// DESCRIPTION:
//          Searches neighbor table for matching long address
// PARAMETER:
//          UINT16 shortAddr,
//              Short address of node that is to be looked up in the neighbor  table.
// RETURN-VALUE:
//          The index  of the matched entry in the neighbor table,
//           if there is no matched entry,return INVALID_NEIGHBOR_INDEX;
//Side Effects:    If found, the matching neighbor table entry is in
//                  currentNeighborRecord and pCurrentNeighborRecord
//                 points to its location in the table.
//----------------------------------------------------------------------------------
NEIGHBOR_INDEX  NWKLookupNodeByShortAddr( UINT16  shortAddr);



//----------------------------------------------------------------------------------
// NEIGHBOR_INDEX CanAddNeighborNode( void )
//
// DESCRIPTION:
//           This routine determines if there is a free space in the neighbor table and returns a handle to it.
// PARAMETER:
//           NO
// RETURN-VALUE:
//           The index to the available space
// Note:            If the function is successful, pCurrentNeighborRecord
//                 points to the available location.
//----------------------------------------------------------------------------------
NEIGHBOR_INDEX CanAddNeighborNode( void );

//----------------------------------------------------------------------------------
//ZBOOL CanAddChildNode ( void );
//
//DESCRIPTION:
//         This function determines if there is capacity to add a child node of the given type.
//         First:the macAssociationPermit must be TRUE
//         Second:the given device haven't exhausted its address block.
//         example:if the device is RFD,if we want to add this RFD to the FFD or PAN coordinator
//                       successfully,the FFD or PAN coordinator mustn't havn't exhausted its address
//                        block for the RFD.
//PARAMETER:
//          NO
//RETURN-VALUE:
//         If we have the capacity to add the node as our child
//
//note: This function must be called from either the mlmeAssociateIndication()
//         or nlmeDirectJoinRequest() functions.
//----------------------------------------------------------------------------
 ZBOOL CanAddChildNode( void );

//---------------------------------------------------------------------------
// //void AddChildNode(  )

// DESCRIPTION 
//        Creates new child entry for given node at the input location.
// NOTE:
//        The node must not be already in the neighbor table,
//        and pCurrentNeighborRecord must point to a free location.
//        This routine can be called from either
//        mlmeAsspciateIndication() or nlmeDirectJoinRequest() function.
//
//Input:           index       - handle to a free location
//
//RETURN-VALUE:
//         NO
//
//-------------------------------------------------------------------
//#ifndef NWK_OPT_RFD
void AddChildNode( );
//#endif

//-------------------------------------------------------------------
//   ADDRESS * SearchOutChildDeviceFromNeighborTable();
//
//   DESCRIPTION:
//           This function will search out the child devices from the neighbor table.
//   PARAMETER:
//            NO
//   RETURN-VALUE:
//            A pointer points to the address array formed by the child device's address
//-------------------------------------------------------------------
 void SearchOutChildDeviceFromNeighborTable(ADDRESS * childLongAddress);

//-----------------------------------------------------------------
//      UINT16 SearchOutParentDeviceFromNeighborTable();
//
//     DESCRIPTION:
//             This function will search out the parent devices from the neighbor table.
//     PARAMETER:
//            NO
//     RETURN-VALUE:
//            A pointer points to the device's parent device's address.
//-----------------------------------------------------------------
 UINT16 SearchOutParentDeviceFromNeighborTable();

//-----------------------------------------------------------------
//    void  SearchLogicalChannelFromNeighborTable(BYTE*logicalChannel);
//
//    DESCRIPTION:
//            This function will search out the parent's logiclaChannel from the neighbor table
//    PARAMETER:
//            A 'value-result' parameter used to take back the 'logicalChannel'.
//    RETURN-VALUE:
//            NO
//-----------------------------------------------------------------
void  SearchLogicalChannelFromNeighborTable(BYTE*logicalChannel);


//-----------------------------------------------------------------------------------------
//     UINT16 SearchDestPANIDFromNeighborTable(UINT16 macShortAddress);
//
//     DESCRIPTION:
//            This function will search out the destionation device's PANID from the 
//            neighbor table.
//     PARAMETER:
//            UINT16 macShortAddress,
//              The destination device's short address.
//     RETURN-VALUE:
//            NO.
//------------------------------------------------------------------------------------------
UINT16 SearchDestPANIDFromNeighborTable(UINT16 macShortAddress);

//--------------------------------------------------------------------------
//      BYTE    NumberOfEntriesInNeighborTable();
//
//      DESCRIPTION:
//              This function will calculate the total entries in device's neighbor table.
//      PARAMETER:
//              NO
//      RETURN-VALUE:
//              The total number of entries in neighbor table.
//----------------------------------------------------------------------------
BYTE NumberOfEntriesInNeighborTable();

//---------------------------------------------------------------------------
//      UINT8 NumberOfChildrenInNeighborTable();
//
//      DESCRIPTION:
//             This function will calculate the number of remained children in device's 
//             neighborTable.
//      PARAMETER:
//              NO
//      RETURN-VALUE:
//              The total number of child device in neighbor table.
//----------------------------------------------------------------------------
void  NumberOfChildrenInNeighborTable(UINT8 *numberOfChildren);
#endif 





















⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -