cisAsynEntry.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #ifndef _OBJECT_DEFS_H_
  2. #define _OBJECT_DEFS_H_
  3. #include "cis_api.h"
  4. #include "cis_internals.h"
  5. #define SAMPLE_OBJECT_MAX 1
  6. #define SAMPLE_OID_A (3306)
  7. #define SAMPLE_A_INSTANCE_COUNT 1
  8. #define SAMPLE_A_INSTANCE_BITMAP "1"
  9. typedef struct st_sample_object
  10. {
  11. cis_oid_t oid;
  12. cis_instcount_t instCount;
  13. const char* instBitmap;
  14. const cis_rid_t* attrListPtr;
  15. uint16_t attrCount;
  16. const cis_rid_t* actListPtr;
  17. uint16_t actCount;
  18. } st_sample_object;
  19. //////////////////////////////////////////////////////////////////////////
  20. //a object
  21. typedef struct st_object_a{
  22. int32_t intValue;
  23. float floatValue;
  24. bool boolValue;
  25. char strValue[1024];
  26. uint8_t update;
  27. } st_object_a;
  28. typedef struct st_instance_a
  29. {
  30. cis_iid_t instId;
  31. bool enabled;
  32. st_object_a instance;
  33. } st_instance_a;
  34. enum{
  35. attributeA_intValue = 5851,
  36. attributeA_boolValue = 5850,
  37. attributeA_stringValue = 5750,
  38. };
  39. enum{
  40. actionA_1 = 100,
  41. };
  42. //at+mipldiscoverrsp=0,msgid1,1,14,"5750;5850;5851" string bool integer
  43. static const cis_rid_t const_AttrIds_a[] = {
  44. attributeA_intValue,
  45. attributeA_boolValue,
  46. attributeA_stringValue,
  47. };
  48. static const cis_rid_t const_ActIds_a[] = {
  49. actionA_1,
  50. };
  51. typedef enum{
  52. CIS_CALLBACK_UNKNOWN = 0,
  53. CIS_CALLBACK_READ,
  54. CIS_CALLBACK_WRITE,
  55. CIS_CALLBACK_EXECUTE,
  56. CIS_CALLBACK_OBSERVE,
  57. CIS_CALLBACK_SETPARAMS,
  58. CIS_CALLBACK_DISCOVER,
  59. } et_callback_type_t1;
  60. struct st_observe_info
  61. {
  62. struct st_observe_info* next;
  63. cis_listid_t mid;
  64. cis_uri_t uri;
  65. cis_observe_attr_t params;
  66. };
  67. struct store_observe_info
  68. {
  69. cis_listid_t mid;
  70. cis_uri_t uri;
  71. cis_observe_attr_t params;
  72. };
  73. struct st_callback_info
  74. {
  75. struct st_callback_info* next;
  76. cis_listid_t mid;
  77. et_callback_type_t flag;
  78. cis_uri_t uri;
  79. union
  80. {
  81. struct{
  82. cis_data_t* value;
  83. cis_attrcount_t count;
  84. }asWrite;
  85. struct{
  86. uint8_t* buffer;
  87. uint32_t length;
  88. }asExec;
  89. struct
  90. {
  91. bool flag;
  92. }asObserve;
  93. struct
  94. {
  95. cis_observe_attr_t params;
  96. }asObserveParam;
  97. }param;
  98. };
  99. typedef struct {
  100. et_client_state_t pumpState;
  101. uint8_t observeObjNum;
  102. observed_backup_t gObservedBackup[MAX_OBSERVED_COUNT]; // For CIS core save use
  103. } onenet_context_t;
  104. bool cisAsynGetShutdown(void);
  105. void cisAsynSetShutdown(bool shutdown);
  106. bool cisAsynGetNotifyOnceStatus(void);
  107. void cisAsynSetNotifyOnceStatus(bool success);
  108. bool cisAsyncCheckNotificationReady(void);
  109. void prvMakeUserdata(void);
  110. void cisOnenetInit(void);
  111. void cisDataObserveReport(void);
  112. #endif//_OBJECT_DEFS_H_