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

📄 nwk_globals.lst

📁 用IAR开发的ZIGBEE网络路由例子
💻 LST
📖 第 1 页 / 共 3 页
字号:
   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    123            associated_devices_t AssociatedDevList[NWK_MAX_DEVICES];
   \                     AssociatedDevList:
   \   000000                DS 294
    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   08           DB 8
    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 88
    134          
    135          #if defined ( RTR_NWK )
    136            // Routing table

   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    137            rtgEntry_t rtgTable[MAX_RTG_ENTRIES];
   \                     rtgTable:
   \   000000                DS 120
    138          
    139            // Table of current RREQ packets in the network

   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    140            rtDiscEntry_t rtDiscTable[MAX_RREQ_ENTRIES];
   \                     rtDiscTable:
   \   000000                DS 80
    141            
    142            // Table of data broadcast packets currently in circulation.

   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    143            bcastEntry_t bcastTable[MAX_BCAST];
   \                     bcastTable:
   \   000000                DS 72
    144            
    145            // These 2 arrays are to be used as an array of struct { uint8, uint32 }.

   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    146            uint8 bcastHoldHandle[MAX_BCAST];
   \                     bcastHoldHandle:
   \   000000                DS 9

   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    147            uint32 bcastHoldAckMask[MAX_BCAST];
   \                     bcastHoldAckMask:
   \   000000                DS 36
    148            

   \                                 In segment CODE_C, align 1
    149            CONST byte gMAX_BCAST = MAX_BCAST;
   \                     gMAX_BCAST:
   \   000000   09           DB 9
    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));
   \   000010                ; Setup parameters for call to function osal_mem_alloc
   \   000010   7A0C         MOV     R2,#0xc
   \   000012   7B00         MOV     R3,#0x0
   \   000014   90....       MOV     DPTR,#(osal_mem_alloc & 0xffff)
   \   000017   74..         MOV     A,#((osal_mem_alloc >> 16) & 0xff)
   \   000019   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \   00001C   90....       MOV     DPTR,#Cskip
   \   00001F   EA           MOV     A,R2
   \   000020   F0           MOVX    @DPTR,A
   \   000021   A3           INC     DPTR
   \   000022   EB           MOV     A,R3
   \   000023   F0           MOVX    @DPTR,A
    244            RTG_FillCSkipTable(CskipChldrn, CskipRtrs, MAX_NODE_DEPTH, Cskip);
   \   000024                ; Setup parameters for call to function RTG_FillCSkipTable
   \   000024   90....       MOV     DPTR,#Cskip
   \   000027   12....       LCALL   ?PUSH_XSTACK8_X_TWO
   \   00002A   7905         MOV     R1,#0x5
   \   00002C   7C..         MOV     R4,#(CskipRtrs & 0xff)
   \   00002E   7D..         MOV     R5,#((CskipRtrs >> 8) & 0xff)
   \   000030   7A..         MOV     R2,#(CskipChldrn & 0xff)
   \   000032   7B..         MOV     R3,#((CskipChldrn >> 8) & 0xff)
   \   000034   90....       MOV     DPTR,#(RTG_FillCSkipTable & 0xffff)
   \   000037   74..         MOV     A,#((RTG_FillCSkipTable >> 16) & 0xff)
   \   000039   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \   00003C   7402         MOV     A,#0x2
   \   00003E   12....       LCALL   ?DEALLOC_XSTACK8
    245          #endif
    246          }
   \   000041                REQUIRE ?Subroutine0
   \   000041                ; // 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

⌨️ 快捷键说明

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