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

📄 nwk_globals.lst

📁 cc2430应用实例
💻 LST
📖 第 1 页 / 共 3 页
字号:
   \                     gNWK_INDIRECT_MSG_MAX_ALL:
   \   000000   09           DB 9
     99          
    100          #if defined ( RTR_NWK )
    101            // change this if using a different stack profile...
    102            // Cskip array
    103            uint16 *Cskip;
    104          
    105            #if ( STACK_PROFILE_ID == HOME_CONTROLS )
    106              byte CskipRtrs[MAX_NODE_DEPTH+1] = {6,6,6,6,6,0};
    107              byte CskipChldrn[MAX_NODE_DEPTH+1] = {20,20,20,20,20,0};
    108            #elif ( STACK_PROFILE_ID == GENERIC_STAR )
    109              byte CskipRtrs[MAX_NODE_DEPTH+1] = {5,5,5,5,5,0};
    110              byte CskipChldrn[MAX_NODE_DEPTH+1] = {5,5,5,5,5,0};
    111            #elif ( STACK_PROFILE_ID == NETWORK_SPECIFIC )
    112              byte CskipRtrs[MAX_NODE_DEPTH+1] = {5,5,5,5,5,0};
    113              byte CskipChldrn[MAX_NODE_DEPTH+1] = {5,5,5,5,5,0};
    114            #endif // STACK_PROFILE_ID
    115          #endif  // RTR_NWK
    116          
    117          
    118          // Minimum lqi value that is required for association

   \                                 In segment XDATA_I, align 1, keep-with-next
    119          byte gMIN_TREE_LINK_COST = MIN_LQI_COST_3;
   \                     gMIN_TREE_LINK_COST:
   \   000000                DS 1
   \   000001                REQUIRE `?<Initializer for gMIN_TREE_LINK_COST>`
   \   000001                REQUIRE __INIT_XDATA_I
    120          
    121          #if defined(RTR_NWK)
    122            // Statically defined Associated Device List
    123            associated_devices_t AssociatedDevList[NWK_MAX_DEVICES];
    124          #endif
    125          

   \                                 In segment CODE_C, align 1
    126          CONST byte gMAX_RTG_ENTRIES = MAX_RTG_ENTRIES;
   \                     gMAX_RTG_ENTRIES:
   \   000000   14           DB 20

   \                                 In segment CODE_C, align 1
    127          CONST byte gMAX_UNRESERVED_RTG_ENTRIES = MAX_UNRESERVED_RTG_ENTRIES;
   \                     gMAX_UNRESERVED_RTG_ENTRIES:
   \   000000   10           DB 16

   \                                 In segment CODE_C, align 1
    128          CONST byte gMAX_RREQ_ENTRIES = MAX_RREQ_ENTRIES;
   \                     gMAX_RREQ_ENTRIES:
   \   000000   0A           DB 10
    129          

   \                                 In segment CODE_C, align 1
    130          CONST byte gMAX_NEIGHBOR_ENTRIES = MAX_NEIGHBOR_ENTRIES;
   \                     gMAX_NEIGHBOR_ENTRIES:
   \   000000   04           DB 4
    131          
    132           // Table of neighboring nodes (not including child nodes)

   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    133          neighborEntry_t neighborTable[MAX_NEIGHBOR_ENTRIES];
   \                     neighborTable:
   \   000000                DS 44
    134          
    135          #if defined ( RTR_NWK )
    136            // Routing table
    137            rtgEntry_t rtgTable[MAX_RTG_ENTRIES];
    138          
    139            // Table of current RREQ packets in the network
    140            rtDiscEntry_t rtDiscTable[MAX_RREQ_ENTRIES];
    141            
    142            // Table of data broadcast packets currently in circulation.
    143            bcastEntry_t bcastTable[MAX_BCAST];
    144            
    145            // These 2 arrays are to be used as an array of struct { uint8, uint32 }.
    146            uint8 bcastHoldHandle[MAX_BCAST];
    147            uint32 bcastHoldAckMask[MAX_BCAST];
    148            
    149            CONST byte gMAX_BCAST = MAX_BCAST;
    150          #endif
    151          
    152          /*********************************************************************
    153           * APS GLOBAL VARIABLES
    154           */
    155          
    156          #if defined ( REFLECTOR )
    157            // The Maximum number of binding records
    158            // This number is defined in BindingTable.h - change it there.
    159            CONST uint16 gNWK_MAX_BINDING_ENTRIES = NWK_MAX_BINDING_ENTRIES;
    160          
    161            // The Maximum number of cluster IDs in a binding record
    162            // This number is defined in BindingTable.h - change it there.
    163            CONST byte gMAX_BINDING_CLUSTER_IDS = MAX_BINDING_CLUSTER_IDS;
    164          
    165            CONST uint16 gBIND_REC_SIZE = sizeof( BindingEntry_t );
    166          
    167            // Binding Table
    168            BindingEntry_t BindingTable[NWK_MAX_BINDING_ENTRIES];
    169          #endif
    170          
    171          // Maximum number allowed in the groups table.

   \                                 In segment CODE_C, align 1
    172          CONST uint8 gAPS_MAX_GROUPS = APS_MAX_GROUPS;
   \                     gAPS_MAX_GROUPS:
   \   000000   10           DB 16
    173          
    174          // The size of a tx window when using fragmentation

   \                                 In segment CODE_C, align 1
    175          CONST uint8 apscMaxWindowSize = APS_DEFAULT_WINDOW_SIZE;
   \                     apscMaxWindowSize:
   \   000000   05           DB 5
    176          
    177          // The delay between tx packets when using fragmentaition

   \                                 In segment CODE_C, align 1
    178          CONST uint16 gAPS_INTERFRAME_DELAY = APS_DEFAULT_INTERFRAME_DELAY;
   \                     gAPS_INTERFRAME_DELAY:
   \   000000   3200         DW 50
    179          
    180          
    181          /*********************************************************************
    182           * SECURITY GLOBAL VARIABLES
    183           */
    184          
    185          // This is the default pre-configured key,
    186          // change this to make a unique key
    187          // SEC_KEY_LEN is defined in ssp.h.

   \                                 In segment CODE_C, align 1
    188          CONST byte defaultKey[SEC_KEY_LEN] =
   \                     defaultKey:
   \   000000   00010203     DB 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
   \            04050607
   \            08090A0B
   \            0C0D0E0F
    189          {
    190          #if defined ( APP_TP ) || defined ( APP_TP2 )
    191            // Key for ZigBee Conformance Testing
    192            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    193            0x89, 0x67, 0x45, 0x23, 0x01, 0xEF, 0xCD, 0xAB
    194          #else
    195            // Key for In-House Testing
    196            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
    197            0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
    198          #endif
    199          };
    200          
    201          
    202          /*********************************************************************
    203           * STATUS STRINGS
    204           */
    205          #if defined ( LCD_SUPPORTED )
    206            const char PingStr[]         = "Ping Rcvd from";
    207            const char AssocCnfStr[]     = "Assoc Cnf";
    208            const char SuccessStr[]      = "Success";
    209            const char EndDeviceStr[]    = "EndDevice:";
    210            const char ParentStr[]       = "Parent:";
    211            const char ZigbeeCoordStr[]  = "ZigBee Coord";
    212            const char NetworkIDStr[]    = "Network ID:";
    213            const char RouterStr[]       = "Router:";
    214            const char OrphanRspStr[]    = "Orphan Response";
    215            const char SentStr[]         = "Sent";
    216            const char FailedStr[]       = "Failed";
    217            const char AssocRspFailStr[] = "Assoc Rsp fail";
    218            const char AssocIndStr[]     = "Assoc Ind";
    219            const char AssocCnfFailStr[] = "Assoc Cnf fail";
    220            const char EnergyLevelStr[]  = "Energy Level";
    221            const char ScanFailedStr[]   = "Scan Failed";
    222          #endif
    223          
    224          /*********************************************************************
    225           * @fn       nwk_globals_init()
    226           *
    227           * @brief
    228           *
    229           *   Initialize nwk layer globals.  These are the system defaults and
    230           *   should be changed by the user here.  The default definitions are
    231           *   defined in nwk.h or NLMEDE.h.
    232           *
    233           * @param   none
    234           *
    235           * @return  none
    236           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    237          void nwk_globals_init( void )
   \                     nwk_globals_init:
    238          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    239            AddrMgrInit( NWK_MAX_ADDRESSES );
   \   000004                ; Setup parameters for call to function AddrMgrInit
   \   000004   7A16         MOV     R2,#0x16
   \   000006   7B00         MOV     R3,#0x0
   \   000008   90....       MOV     DPTR,#(AddrMgrInit & 0xffff)
   \   00000B   74..         MOV     A,#((AddrMgrInit >> 16) & 0xff)
   \   00000D   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    240          
    241          #if defined ( RTR_NWK )
    242            // Initialize the Cskip Table
    243            Cskip = osal_mem_alloc(sizeof(uint16) *(MAX_NODE_DEPTH+1));
    244            RTG_FillCSkipTable(CskipChldrn, CskipRtrs, MAX_NODE_DEPTH, Cskip);
    245          #endif
    246          }
   \   000010                REQUIRE ?Subroutine0
   \   000010                ; // Fall through to label ?Subroutine0

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine0:
   \   000000   D083         POP     DPH
   \   000002   D082         POP     DPL
   \   000004   02....       LJMP    ?BRET
    247          
    248          /*********************************************************************
    249           * @fn       NIB_init()
    250           *
    251           * @brief
    252           *
    253           *   Initialize attribute values in NIB
    254           *
    255           * @param   none
    256           *
    257           * @return  none
    258           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    259          void NIB_init()
   \                     NIB_init:
    260          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    261          #if defined ( AUTO_SOFT_START )
    262            byte extAddr[Z_EXTADDR_LEN];
    263            ZMacGetReq( ZMacExtAddr, extAddr );
    264            _NIB.SequenceNum = extAddr[0];
    265          #else
    266            _NIB.SequenceNum = 1;
   \   000004   7401         MOV     A,#0x1
   \   000006   90....       MOV     DPTR,#_NIB
   \   000009   F0           MOVX    @DPTR,A
    267          #endif
    268          
    269            _NIB.MaxDepth = MAX_NODE_DEPTH;
   \   00000A   7405         MOV     A,#0x5
   \   00000C   90....       MOV     DPTR,#(_NIB + 4)
   \   00000F   F0           MOVX    @DPTR,A
    270          
    271          #if ( NWK_MODE == NWK_MODE_MESH )
    272            _NIB.beaconOrder = BEACON_ORDER_NO_BEACONS;
   \   000010   740F         MOV     A,#0xf
   \   000012   90....       MOV     DPTR,#(_NIB + 40)
   \   000015   F0           MOVX    @DPTR,A
    273            _NIB.superFrameOrder = BEACON_ORDER_NO_BEACONS;

⌨️ 快捷键说明

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