zigbee.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /**
  2. * @file zigbee.h
  3. * @brief define the macros which used in this SDK
  4. * @author qinlang
  5. * @date 2022.05.06
  6. * @par email:
  7. * @par email:qinlang.chen@tuya.com
  8. * @copyright HANGZHOU TUYA INFORMATION TECHNOLOGY CO.,LTD
  9. * @par company
  10. * http://www.tuya.com
  11. */
  12. #ifndef __ZIGBEE_H_
  13. #define __ZIGBEE_H_
  14. //#error "when other fils which have used the .c files in this SDK should include zigbee.h, and delete this line"
  15. #include "protocol.h"
  16. #include "system.h"
  17. #include "mcu_api.h"
  18. #ifdef __cplusplus
  19. extern "C"
  20. {
  21. #endif
  22. #define MCU_SDK_VER (1.0.3)
  23. ///< constant define
  24. #ifndef TRUE
  25. #define TRUE 1
  26. #endif
  27. #ifndef FALSE
  28. #define FALSE 0
  29. #endif
  30. #ifndef NULL
  31. #define NULL ((void *) 0)
  32. #endif
  33. #ifndef SUCCESS
  34. #define SUCCESS 1
  35. #endif
  36. #ifndef ERROR
  37. #define ERROR 0
  38. #endif
  39. #ifndef INVALID
  40. #define INVALID 0xFF
  41. #endif
  42. #ifndef ENABLE
  43. #define ENABLE 1
  44. #endif
  45. #ifndef DISABLE
  46. #define DISABLE 0
  47. #endif
  48. ///< dp type
  49. #define DP_TYPE_RAW 0x00 //RAW
  50. #define DP_TYPE_BOOL 0x01 //bool
  51. #define DP_TYPE_VALUE 0x02 //value
  52. #define DP_TYPE_STRING 0x03 //string
  53. #define DP_TYPE_ENUM 0x04 //enum
  54. #define DP_TYPE_BITMAP 0x05 //fault
  55. #define DP_TYPE_FAULT DP_TYPE_BITMAP
  56. //< work mode
  57. #define NORMAL_MODE 0x00 //normal mode
  58. #define FACTORY_MODE 0x01 //factory mode
  59. #define UPDATE_MODE 0X02 //updata mode
  60. #define ZG_NO_NWK 0x00
  61. #define ZG_JOIN_NWK 0x01
  62. #define ZG_JOIN_CLOUD 0X02
  63. #define ZG_NO_CLOUD 0x03
  64. #define ZG_REPORT_OK 0x10
  65. #define ZG_REPORT_ERR 0X20
  66. ///< dp struct
  67. typedef struct {
  68. unsigned char dp_id;
  69. unsigned char dp_type;
  70. } DOWNLOAD_CMD_S;
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif