stub_aps.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /**************************************************************************************************
  2. Filename: stub_aps.h
  3. Revised: $Date: 2008-1-04 13:13:13 -0700 (Fri, 04 Jan 2008) $
  4. Revision: $Revision: 1 $
  5. Description: Primitives of the Stub Application Support Sub Layer Task functions.
  6. Copyright 2004-2011 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. #ifndef SAPS_H
  34. #define SAPS_H
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. /*********************************************************************
  39. * INCLUDES
  40. */
  41. /*********************************************************************
  42. * MACROS
  43. */
  44. /*********************************************************************
  45. * CONSTANTS
  46. */
  47. // Inter-PAN frame doesn't include endpoints. Use this endpoint to distinguish the
  48. // Inter-PAN frames passed between the Stub APS and Application.
  49. // Note: Endpoints 0xF1 - 0xFE are currently reserved.
  50. #define STUBAPS_INTER_PAN_EP 0xFE
  51. /*********************************************************************
  52. * TYPEDEFS
  53. */
  54. /*********************************************************************
  55. * GLOBAL VARIABLES
  56. */
  57. extern uint8 StubAPS_TaskID;
  58. /*********************************************************************
  59. * STUB APS FUNCTIONS
  60. */
  61. /*
  62. * Stub APS Task Initialization
  63. */
  64. extern void StubAPS_Init( uint8 task_id );
  65. /*
  66. * Stub APS Event Loop
  67. */
  68. extern UINT16 StubAPS_ProcessEvent( uint8 task_id, uint16 events );
  69. /*
  70. * This function changes the device's channel for inter-PAN communication.
  71. */
  72. extern ZStatus_t StubAPS_SetInterPanChannel( uint8 channel );
  73. /*
  74. * This function sets the device's channel back to the NIB channel.
  75. */
  76. extern ZStatus_t StubAPS_SetIntraPanChannel( void );
  77. /*
  78. * This function checks to see if a PAN is an Inter-PAN.
  79. */
  80. extern uint8 StubAPS_InterPan( uint16 panId, uint8 endPoint );
  81. /*
  82. * This function is used to register the application with Stub APS.
  83. */
  84. extern void StubAPS_RegisterApp( endPointDesc_t *epDesc );
  85. /*********************************************************************
  86. * INTER-PAN FUNCTIONS
  87. */
  88. /*
  89. * This function requests the transfer of data from the next higher layer
  90. * to a single peer entity.
  91. */
  92. extern ZStatus_t INTERP_DataReq( APSDE_DataReq_t *req );
  93. /*
  94. * This function requests the MTU (Max Transport Unit) of the Inter-PAN
  95. * Data Service.
  96. */
  97. extern uint8 INTERP_DataReqMTU( void );
  98. /*
  99. * This function processes the data confirm from the MAC layer.
  100. */
  101. extern void INTERP_DataConfirm( ZMacDataCnf_t *dataCnf );
  102. /*
  103. * This function indicates the transfer of a data SPDU (MSDU)
  104. * from the MAC layer to the local application layer entity.
  105. */
  106. extern void INTERP_DataIndication( macMcpsDataInd_t *dataInd );
  107. /*********************************************************************
  108. *********************************************************************/
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112. #endif /* SAPS_H */