MT_NWK.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /**************************************************************************************************
  2. Filename: MT_NWK.h
  3. Revised: $Date: 2010-02-04 14:28:44 -0800 (Thu, 04 Feb 2010) $
  4. Revision: $Revision: 21656 $
  5. Description: MonitorTest functions for the NWK layer.
  6. Copyright 2007-2010 Texas Instruments Incorporated. All rights reserved.
  7. IMPORTANT: Your use of this Software is limited to those specific rights
  8. granted under the terms of a software license agreement between the user
  9. who downloaded the software, his/her employer (which must be your employer)
  10. and Texas Instruments Incorporated (the "License"). You may not use this
  11. Software unless you agree to abide by the terms of the License. The License
  12. limits your use, and you acknowledge, that the Software may not be modified,
  13. copied or distributed unless embedded on a Texas Instruments microcontroller
  14. or used solely and exclusively in conjunction with a Texas Instruments radio
  15. frequency transceiver, which is integrated into your product. Other than for
  16. the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  17. works of, modify, distribute, perform, display or sell this Software and/or
  18. its documentation for any purpose.
  19. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  20. PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  21. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  22. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  23. TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  24. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  25. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  26. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  27. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  28. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  29. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  30. Should you have any questions regarding your right to use this Software,
  31. contact Texas Instruments Incorporated at www.TI.com.
  32. **************************************************************************************************/
  33. /***************************************************************************************************
  34. * INCLUDES
  35. ***************************************************************************************************/
  36. #include "hal_types.h"
  37. #include "NLMEDE.h"
  38. /***************************************************************************************************
  39. * MACROS
  40. ***************************************************************************************************/
  41. #define NWKCB_CHECK(cbi) (_nwkCallbackSub & (cbi))
  42. /***************************************************************************************************
  43. * CONSTANTS
  44. ***************************************************************************************************/
  45. /* NWK Callback subscription IDs */
  46. #define CB_ID_NLDE_DATA_CNF 0x0001
  47. #define CB_ID_NLDE_DATA_IND 0x0002
  48. #define CB_ID_NLME_INIT_COORD_CNF 0x0004
  49. #define CB_ID_NLME_JOIN_CNF 0x0008
  50. #define CB_ID_NLME_JOIN_IND 0x0010
  51. #define CB_ID_NLME_LEAVE_CNF 0x0020
  52. #define CB_ID_NLME_LEAVE_IND 0x0040
  53. #define CB_ID_NLME_POLL_CNF 0x0080
  54. #define CB_ID_NLME_SYNC_IND 0x0200
  55. #define CB_ID_NLME_NWK_DISC_CNF 0x2000
  56. #define CB_ID_NLME_START_ROUTER_CNF 0x8000
  57. /***************************************************************************************************
  58. * GLOBAL VARIABLES
  59. ***************************************************************************************************/
  60. extern uint16 _nwkCallbackSub;
  61. /***************************************************************************************************
  62. * EXTERNAL FUNCTIONS
  63. ***************************************************************************************************/
  64. #ifdef MT_NWK_FUNC
  65. /*
  66. * Process all the NWK commands that are issued by test tool
  67. */
  68. extern uint8 MT_NwkCommandProcessing (byte *pBuf);
  69. #endif /* NWK Command Processing in MT */
  70. #ifdef MT_NWK_CB_FUNC
  71. /*
  72. * Process the callback subscription for NLDE-DATA.confirm
  73. */
  74. extern void nwk_MTCallbackSubDataConfirm(byte nsduHandle, ZStatus_t status);
  75. /*
  76. * Process the callback subscription for NLDE-DATA.indication
  77. */
  78. extern void nwk_MTCallbackSubDataIndication(uint16 SrcAddress, int16 nsduLength,
  79. byte *nsdu, byte LinkQuality);
  80. /*
  81. * Process the callback subscription for NLME-INIT-COORD.confirm
  82. */
  83. extern void nwk_MTCallbackSubInitCoordConfirm(ZStatus_t Status);
  84. /*
  85. * Process the callback subscription for NLME-START-ROUTER.confirm
  86. */
  87. extern void nwk_MTCallbackSubStartRouterConfirm(ZStatus_t Status);
  88. /*
  89. * Process the callback subscription for NLME_NWK-DISC.confirm
  90. */
  91. extern void nwk_MTCallbackSubNetworkDiscoveryConfirm(byte ResultCount, networkDesc_t *NetworkList);
  92. /*
  93. * Process the callback subscription for NLME-JOIN.confirm
  94. */
  95. extern void nwk_MTCallbackSubJoinConfirm(uint16 PanId, ZStatus_t Status);
  96. /*
  97. * Process the callback subscription for NLME-INIT-COORD.indication
  98. */
  99. extern void nwk_MTCallbackSubJoinIndication(uint16 ShortAddress, byte *ExtendedAddress,
  100. byte CapabilityFlags);
  101. /*
  102. * Process the callback subscription for NLME-LEAVE.confirm
  103. */
  104. extern void nwk_MTCallbackSubLeaveConfirm(byte *DeviceAddress, ZStatus_t Status);
  105. /*
  106. * Process the callback subscription for NLME-LEAVE.indication
  107. */
  108. extern void nwk_MTCallbackSubLeaveIndication(byte *DeviceAddress);
  109. /*
  110. * Process the callback subscription for NLME-SYNC.indication
  111. */
  112. extern void nwk_MTCallbackSubSyncIndication(void);
  113. /*
  114. * Process the callback subscription for NLME-POLL.confirm
  115. */
  116. extern void nwk_MTCallbackSubPollConfirm(byte status);
  117. #endif /*NWK Callback Processing in MT*/
  118. /*
  119. * Process the callback for Ping
  120. *
  121. */
  122. extern void nwk_MTCallbackPingConfirm(uint16 DstAddress, byte pingSeqNo,
  123. uint16 delay, byte routeCnt, byte *routeAddr);
  124. /*********************************************************************
  125. *********************************************************************/