DebugTrace.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /**************************************************************************************************
  2. Filename: DebugTrace.h
  3. Revised: $Date: 2008-10-07 14:47:15 -0700 (Tue, 07 Oct 2008) $
  4. Revision: $Revision: 18212 $
  5. Description: This interface provides quick one-function-call functions to
  6. Monitor and Test reporting mechanisms.
  7. Copyright 2007 Texas Instruments Incorporated. All rights reserved.
  8. IMPORTANT: Your use of this Software is limited to those specific rights
  9. granted under the terms of a software license agreement between the user
  10. who downloaded the software, his/her employer (which must be your employer)
  11. and Texas Instruments Incorporated (the "License"). You may not use this
  12. Software unless you agree to abide by the terms of the License. The License
  13. limits your use, and you acknowledge, that the Software may not be modified,
  14. copied or distributed unless embedded on a Texas Instruments microcontroller
  15. or used solely and exclusively in conjunction with a Texas Instruments radio
  16. frequency transceiver, which is integrated into your product. Other than for
  17. the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  18. works of, modify, distribute, perform, display or sell this Software and/or
  19. its documentation for any purpose.
  20. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  21. PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  22. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  23. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  24. TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  25. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  26. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  27. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  28. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  29. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  30. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  31. Should you have any questions regarding your right to use this Software,
  32. contact Texas Instruments Incorporated at www.TI.com.
  33. **************************************************************************************************/
  34. #ifndef DEBUGTRACE_H
  35. #define DEBUGTRACE_H
  36. #ifdef __cplusplus
  37. extern "C"
  38. {
  39. #endif
  40. /*********************************************************************
  41. * INCLUDES
  42. */
  43. /*********************************************************************
  44. * MACROS
  45. */
  46. /*
  47. * Windows Print String
  48. */
  49. // command id's
  50. #define CMDID_RTG_ADD 1
  51. #define CMDID_RTG_EXP 0x81
  52. #define CMDID_RREQ_SEND 2
  53. #define CMDID_RREQ_DROP 0x82
  54. #define CMDID_RREP_SEND 3
  55. #define CMDID_RREP_DROP 0x83
  56. #define CMDID_RREQ_EXP 4
  57. #define CMDID_DATA_SEND 6
  58. #define CMDID_DATA_FORWARD 7
  59. #define CMDID_DATA_RECEIVE 8
  60. #define CMDID_BCAST_RCV 0x10
  61. #define CMDID_BCAST_ACK 0x11
  62. #define CMDID_BCAST_RETX 0x12
  63. #define CMDID_BCAST_EXP 0x13
  64. #define CMDID_BCAST_ERR 0x15
  65. #define WPRINTSTR( s )
  66. #if defined ( MT_TASK )
  67. /*
  68. * Trace Message
  69. * - Same as debug_msg with SEVERITY_TRACE already filled in
  70. * - Used to stand out in the source code.
  71. */
  72. #define TRACE_MSG( compID, nParams, p1, p2, p3 ) debug_msg( compID, SEVERITY_TRACE, nParams, p1, p2, p3 )
  73. /*
  74. * Debug Message (SEVERITY_INFORMATION)
  75. * - Use this macro instead of calling debug_msg directly
  76. * - So, it can be easily compiled out later
  77. */
  78. #define DEBUG_INFO( compID, subCompID, nParams, p1, p2, p3 ) debug_msg( compID, subCompID, nParams, p1, p2, p3 )
  79. /*** TEST MESSAGES ***/
  80. #define DBG_NWK_STARTUP debug_msg( COMPID_TEST_NWK_STARTUP, SEVERITY_INFORMATION, 0, 0, 0, 0 )
  81. #define DBG_SCAN_CONFIRM debug_msg( COMPID_TEST_SCAN_CONFIRM, SEVERITY_INFORMATION, 0, 0, 0, 0 )
  82. #define DBG_ASSOC_CONFIRM debug_msg( COMPID_TEST_ASSOC_CONFIRM, SEVERITY_INFORMATION, 0, 0, 0, 0 )
  83. #define DBG_REMOTE_DATA_CONFIRM debug_msg( COMPID_TEST_REMOTE_DATA_CONFIRM, SEVERITY_INFORMATION, 0, 0, 0, 0 )
  84. #else
  85. #define TRACE_MSG( compID, nParams, p1, p2, p3 )
  86. #define DEBUG_INFO( compID, subCompID, nParams, p1, p2, p3 )
  87. #define DBG_NWK_STARTUP
  88. #define DBG_SCAN_CONFIRM
  89. #define DBG_ASSOC_CONFIRM
  90. #define DBG_REMOTE_DATA_CONFIRM
  91. #endif
  92. /*********************************************************************
  93. * CONSTANTS
  94. */
  95. #define SEVERITY_CRITICAL 0x01
  96. #define SEVERITY_ERROR 0x02
  97. #define SEVERITY_INFORMATION 0x03
  98. #define SEVERITY_TRACE 0x04
  99. #define NO_PARAM_DEBUG_LEN 5
  100. /*********************************************************************
  101. * TYPEDEFS
  102. */
  103. /*********************************************************************
  104. * GLOBAL VARIABLES
  105. */
  106. /*********************************************************************
  107. * FUNCTIONS
  108. */
  109. /*
  110. * Debug Message - Sent out serial port
  111. */
  112. extern void debug_msg( uint8 compID, uint8 severity, uint8 numParams,
  113. uint16 param1, uint16 param2, uint16 param3 );
  114. extern void debug_str( uint8 *str_ptr );
  115. /*********************************************************************
  116. *********************************************************************/
  117. #ifdef __cplusplus
  118. }
  119. #endif
  120. #endif /* DEBUGTRACE_H */