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

📄 nwk_setup.h

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

//extern NWK_NIB nnib;
//-------------------------------------------------------------------------------------------------------

#define NWK_MAX_ADDRESS_MAP_ENTRIES   (NWK_MAX_CHILDREN_PER_PARENT*2)

/*
#ifndef NWK_OPT_ZIGBEE_PAN_COORDINATOR
  #define NWK_OPT_ZIGBEE_PAN_COORDINATOR 
#endif
*/

////如果设备是PAN协调器,则只需要将下边的代码进行解注释 0205测试完组网任务,所以注释掉
//#ifndef NWK_OPT_ZIGBEE_PAN_COORDINATOR
////#undef  NWK_OPT_ZIGBEE_PAN_COORDINATOR
//#define NWK_OPT_ZIGBEE_PAN_COORDINATOR
//#endif

#ifdef NWK_OPT_FFD
#undef  NWK_OPT_FFD
//#define NWK_OPT_FFD
#endif 
#ifndef NWK_OPT_RFD
 //#define NWK_OPT_RFD  
#undef  NWK_OPT_RFD
#endif



#ifndef NWK_OPT_SECURITY
    #define NWK_OPT_SECURITY 0
#endif

#ifndef NWK_OPT_MAX_NETWORK_DESCRIPTORS
    #define NWK_OPT_MAX_NETWORK_DESCRIPTORS 4
#endif


#ifndef NWK_OPT_RX_POOL_SIZE
   #ifdef NWK_OPT_FFD
    #define NWK_OPT_RX_POOL_SIZE 5
   #else
    #define NWK_OPT_RX_POOL_SIZE 1
   #endif
#endif


//-------------------------------------------------------------------------------------------------------
// The number of packets in the TX queue
#ifndef NWK_OPT_TX_QUEUE_SIZE
    #define NWK_OPT_TX_QUEUE_SIZE         6 
#endif
//-------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
/*some constant definition about the tree*/
#define NWK_DEPTH      3
#define NWK_MAX_ROUTERS_PER_PARENT 3
//The max children of  a device
#ifndef NWK_MAX_CHILDREN_PER_PARENT
   #define NWK_MAX_CHILDREN_PER_PARENT 3 //this is the total number of the childern,including the routers
#endif
//---------------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------
#define SWS_ZIGBEE_STACK_PROFILE_ID                 0x01
//--------------------------------------------------------------------------

//-------------------------------------------------------------------------
#define NWK_MAX_SCAN_NUMBER_PAN       0x05
//-------------------------------------------------------------------------
#ifndef NWK_OPT_RFD
#define DEVICE_CAPABILITY_INFO       0x8e                //the device is FFD
#else
#define DEVICE_CAPABILITY_INFO       0x88              //the device is RFD
#endif

//#ifndef  NWK_USE_TREE_ROUTING_ONLY
//#define   NWK_USE_TREE_ROUTING_ONLY  
//#endif

#ifndef NWK_SUPPORT_ROUTING
#define  NWK_SUPPORT_ROUTING            
#endif

#ifndef NWK_ROUTE_DISCOVERY_TABLE_SIZE
#define NWK_ROUTE_DISCOVERY_TABLE_SIZE  8 //recommended by the zigbee specification
#endif

#ifndef NWK_ROUTE_TABLE_SIZE
#define  NWK_ROUTE_TABLE_SIZE            32//reference the zigbee specification
#endif

#ifndef NWK_RESERVED_ROUTE_TABLE_ENTRIES
#define  NWK_RESERVED_ROUTE_TABLE_ENTRIES   8//recommended by zigbee specification
#endif 

//An  RN+ may choose to buffer a frame pending route discovery or it may relay 
//it along the tree and preferably after a short delay,initiate route discovery.
#ifndef NWK_NUM_BUFFERED_FRAME_PENDING_ROUTE_DISCOVERY
//most 8-bit processors withe a RAM complement of 2-4K will not be able to afford
//more than 200 bytes of buffering for this purpose
#define  NWK_NUM_BUFFERED_FRAME_PENDING_ROUTE_DISCOVERY    2//recommended by zigbee specification
#endif

#ifndef NWK_NUM_BUFFERED_BROADCAST_MESSAGES
#define NWK_NUM_BUFFERED_BROADCAST_MESSAGES    2
#endif

//An FFD in the network can work as an END device,if the device work as an 
//END device,it doesn't have any child device.
//#ifndef NWK_WORK_AS_END_DEVICE
//#define  NWK_WORK_AS_END_DEVICE  
//#endif

//#ifndef NWK_CALCULATE_LINK_QUALITY
//#define  NWK_CALCULATE_LINK_QUALITY  
//#endif

#ifndef  NWK_DEFAULT_RADIUS
#define NWK_DEFAULT_RADIUS                  (2*nnib.nwkMaxDepth)
#endif

// The maximum number of PAN descriptors returned from a passive or active scan. This memory space
// is set up by a layer above the MAC
#ifndef MAC_OPT_MAX_PAN_DESCRIPTORS
   #define MAC_OPT_MAX_PAN_DESCRIPTORS 4
#endif

#ifndef CONSTANT_LQL_VALUE
 #define   CONSTANT_LQL_VALUE                                          7
#endif

#ifndef NWK_DEVICE_BYTE_ORDER_BIG_ENDIAN
#define  NWK_DEVICE_BYTE_ORDER_BIG_ENDIAN                 
#endif

#ifndef NWK_DEVICE_BYTE_ORDER_LITTLE_ENDIAN               
#define  NWK_DEVICE_BYTE_ORDER_LITTLE_ENDIAN              
#endif

//the following #define is used to test!
#define  FF                                255

#define NWK_EMULATION_GUI_PROCESS_PORT     10000

#define COMMUNICATION_DISTANCE             20

#define MIN_COORDINATES_X                  0
#define MAX_COORDINATES_X                  100
#define MIN_COORDINATES_Y                  0
#define MAX_COORDINATES_Y                  100

//#define NUMBERS_OF_DEVICE_IN_THIS_AREA     10

#define DEVICE_INFO_ARRAY_LENGTH           100
#define EMULATION_DEVICE_NEIGHBOR_INFO     0     //need to be change




//end of 'the following #define is used to test!' 

#endif























⌨️ 快捷键说明

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