SerialApp.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /**************************************************************************************************
  2. Filename: SerialApp.h
  3. Revised: $Date: 2009-02-25 17:31:49 -0800 (Wed, 25 Feb 2009) $
  4. Revision: $Revision: 19273 $
  5. Description: This file contains the Serial Transfer Application definitions.
  6. Copyright 2004-2007 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 SERIALAPP_H
  34. #define SERIALAPP_H
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. /*********************************************************************
  40. * INCLUDES
  41. */
  42. #include "ZComDef.h"
  43. /*********************************************************************
  44. * CONSTANTS
  45. */
  46. // These constants are only for example and should be changed to the
  47. // device's needs
  48. #define SERIALAPP_ENDPOINT 11
  49. #define SERIALAPP_PROFID 0x0F05
  50. #define SERIALAPP_DEVICEID 0x0001
  51. #define SERIALAPP_DEVICE_VERSION 0
  52. #define SERIALAPP_FLAGS 0
  53. #define SERIALAPP_MAX_CLUSTERS 2
  54. #define SERIALAPP_CLUSTERID1 1
  55. #define SERIALAPP_CLUSTERID2 2
  56. #define SERIALAPP_SEND_EVT 0x0001
  57. #define SERIALAPP_RESP_EVT 0x0002
  58. // OTA Flow Control Delays
  59. #define SERIALAPP_ACK_DELAY 1
  60. #define SERIALAPP_NAK_DELAY 16
  61. // OTA Flow Control Status
  62. #define OTA_SUCCESS ZSuccess
  63. #define OTA_DUP_MSG (ZSuccess+1)
  64. #define OTA_SER_BUSY (ZSuccess+2)
  65. /*********************************************************************
  66. * MACROS
  67. */
  68. /*********************************************************************
  69. * GLOBAL VARIABLES
  70. */
  71. extern byte SerialApp_TaskID;
  72. /*********************************************************************
  73. * FUNCTIONS
  74. */
  75. /*
  76. * Task Initialization for the Serial Transfer Application
  77. */
  78. extern void SerialApp_Init( byte task_id );
  79. /*
  80. * Task Event Processor for the Serial Transfer Application
  81. */
  82. extern UINT16 SerialApp_ProcessEvent( byte task_id, UINT16 events );
  83. /*********************************************************************
  84. *********************************************************************/
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88. #endif /* SERIALAPP_H */