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

📄 nwk_cluster_tree_route.h

📁 ucos在NEC平台下的移植
💻 H
字号:
/*
 *******************************************************************************************************
 * CONFIDENTIAL                                                                                        *
 * The use of this file is restricted by SkywiseSystems                    *
 *                                                                                                     *
 * Copyright liquanling 06/09/2006                                                                          *
 *******************************************************************************************************
 * This module contains general types, constants, macros and functions used by many other NWK modules.  
 *******************************************************************************************************
 * Compiler: NEC-CC78K0                                                                                  *
 * Target platform:                                                   *
 *******************************************************************************************************
 * The revision history is located at the bottom of this file                                          *
 *******************************************************************************************************/
 #ifndef NWK_CLUSTER_TREE_ROUTE_H
 #define NWK_CLUSTER_TREE_ROUTE_H


//Coord at depth 0, only endpoints are at depth MAX_DEPTH
//NWK_CSKIP_(NWK_MAX_DEPTH) must be a value of 0.


#define NWK_CSKIP_0     13
#define NWK_CSKIP_1      4
#define NWK_CSKIP_2       1
#define NWK_CSKIP_3       0
#define NWK_CSKIP_4       0

//------------------------------------------------------------------------------------------
//    int GetCskipVal(UINT8 depth);
// 
//    DESCRIPTION:
//           Return the cSkip value (the device's address size) based on the 'depth'.
//    PARAMETER:
//           UINT8 depth,
//             The device's depth in the tree.
//    RETURN-VALUE:
//           The cSkip value.
//------------------------------------------------------------------------------------------
  int GetCskipVal(UINT8 depth);

//-----------------------------------------------------------------------------------------
//    void ntInitAddressAssignment(void);	
//
//    DESCRIPTION:
//             Initialize the address information.
//    PARAMETER:
//             NO.
//    RETURN-VALUE:
//             NO.
//------------------------------------------------------------------------------------------
 void ntInitAddressAssignment(void);	

//------------------------------------------------------------------------------------------
//    PACKET_ROUTING_STATUS UseTreeRouting(SHORT_ADDR nwkAddress, SHORT_ADDR macAddress );
//    
//    DESCRIPTION:
//                 In the program,RN+ node can do AODVjr routing and cluster-tree routing.
//                 when there is  no routing capacity,the RN+node may choose to do cluster-tree routing.
//                 This function wraps the concret operation of the cluster-tree routing.
//    PARAMETER:
//                 SHORT_ADDR nwkAddress,
//                        Desired destination network address.
//                 SHORT_ADDR *macAddress,
//                        A 'value-result' parameter,used to take back the network address of the next hop.
//    RETURN-VALUE:
//                 The routing status.
//--------------------------------------------------------------------------------------------
#ifdef NWK_SUPPORT_ROUTING
PACKET_ROUTING_STATUS UseTreeRouting(UINT16 nwkAddress, UINT16* macAddress );
#endif
//---------------------------------------------------------------------------------
//     ZBOOL IsDescendant( SHORT_ADDR parentAddr, SHORT_ADDR childAddr, BYTE parentDepth );
//
//     DESCRIPTION:
//                  This function determines if the child device is a descendant of the parent device.  
//     PARAMETER:
//                  SHORT_ADDR parentAddr, 
//                             Short address of the parent device.
//                  SHORT_ADDR childAddr,
//                              Short address of the child device
//                  BYTE parentDepth
//                              Depth of the parent
//     RETURN-VALUE:
//                  TRUE:the child of the address'childAddr'is a descendant of the parent.
//     NOTE:   If I am the coordinator, the device is always my descendant.  
//                 Otherwise, the device is my descendant if its address is within the address 
//                 range that I can allocate.
//--------------------------------------------------------------------------------                   
#ifdef NWK_SUPPORT_ROUTING
ZBOOL IsDescendant( UINT16 parentAddr, UINT16 childAddr, BYTE parentDepth );
#endif
//------------------------------------------------------------------------
//    ZBOOL RouteAlongTree( UINT16 destTarget, UINT16 *destNextHop );
//
//    DESCRIPTION:
//                 This function determines the address of the next node to send a routing message to based on
//                  tree hierarchy. 
//    PARAMETER:
//                 UINT16 destTarget,
//                 UINT16 *destNextHop,
//                        A 'value-result' parameter,when the function completes,the  address of the next hop 
//                        will be pointed by destNextHop.
//    RETURN-VALUE:
//                 TRUE:  find out the valid next hop.
//                 FALSE: don't find out the valid next hop.
//    NOTE:    If the packet is going to one of our descendants, pass
//                  it to the next level parent.  Otherwise, pass it to our parent.
//------------------------------------------------------------------------                 
#ifdef NWK_SUPPORT_ROUTING
ZBOOL RouteAlongTree( UINT16 destTarget, UINT16 *destNextHop );
#endif
 
 #endif

⌨️ 快捷键说明

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