joylink_dev.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. #ifndef _JOYLINK_DEV_H_
  2. #define _JOYLINK_DEV_H_
  3. #ifdef __cplusplus
  4. extern "C"{
  5. #endif /* __cplusplus */
  6. #include "joylink.h"
  7. #define LIGHT_CMD_NONE (-1)
  8. #define LIGHT_CMD_POWER (1)
  9. #define LIGHT_CTRL_NONE (-1)
  10. #define LIGHT_CTRL_ON (1)
  11. #define LIGHT_CTRL_OFF (0)
  12. typedef struct __light_ctrl{
  13. char cmd;
  14. int para_power;
  15. int para_state;
  16. int para_look;
  17. int para_move;
  18. }LightCtrl_t;
  19. /**
  20. * brief:
  21. *
  22. * @Returns:
  23. */
  24. E_JLRetCode_t
  25. joylink_dev_is_net_ok();
  26. /**
  27. * brief:
  28. *
  29. * @Param: st
  30. *
  31. * @Returns:
  32. */
  33. E_JLRetCode_t
  34. joylink_dev_set_connect_st(int st);
  35. /**
  36. * brief:
  37. *
  38. * @Param: jlp
  39. *
  40. * @Returns:
  41. */
  42. E_JLRetCode_t
  43. joylink_dev_set_attr_jlp(JLPInfo_t *jlp);
  44. /**
  45. * brief:
  46. *
  47. * @Param: jlp
  48. *
  49. * @Returns:
  50. */
  51. E_JLRetCode_t
  52. joylink_dev_get_jlp_info(JLPInfo_t *jlp);
  53. /**
  54. * brief:
  55. *
  56. * @Param: out_modelcode
  57. * @Param: out_max
  58. *
  59. * @Returns:
  60. */
  61. int
  62. joylink_dev_get_modelcode(char *out_modelcode, int32_t out_max);
  63. /**
  64. * brief:
  65. *
  66. * @Param: out_snap
  67. * @Param: out_max
  68. *
  69. * @Returns:
  70. */
  71. int
  72. joylink_dev_get_snap_shot(char *out_snap, int32_t out_max);
  73. /**
  74. * brief:
  75. *
  76. * @Param: out_snap
  77. * @Param: out_max
  78. * @Param: code
  79. * @Param: feedid
  80. *
  81. * @Returns:
  82. */
  83. int
  84. joylink_dev_get_json_snap_shot(char *out_snap, int32_t out_max, int code, char *feedid);
  85. /**
  86. * brief:
  87. *
  88. * @Param: json_cmd
  89. *
  90. * @Returns:
  91. */
  92. E_JLRetCode_t
  93. joylink_dev_lan_json_ctrl(const char *json_cmd);
  94. /**
  95. * brief:
  96. *
  97. * @Param: src
  98. * @Param: src_len
  99. * @Param: ctr
  100. * @Param: from_server
  101. *
  102. * @Returns:
  103. */
  104. E_JLRetCode_t
  105. joylink_dev_script_ctrl(const char *src, int src_len, JLContrl_t *ctr, int from_server);
  106. /**
  107. * brief:
  108. *
  109. * @Param: otaOrder
  110. *
  111. * @Returns:
  112. */
  113. E_JLRetCode_t
  114. joylink_dev_ota(JLOtaOrder_t *otaOrder);
  115. /**
  116. * brief:
  117. */
  118. void
  119. joylink_dev_ota_status_upload();
  120. /**
  121. * brief:
  122. */
  123. int
  124. joylink_test_ota_crc();
  125. /**
  126. * brief:
  127. *
  128. * @Param: pidt
  129. *
  130. * @Returns:
  131. */
  132. E_JLRetCode_t
  133. joylink_dev_get_idt(jl2_d_idt_t *pidt);
  134. /**
  135. * brief:
  136. *
  137. * @Param:
  138. *
  139. * @Returns:
  140. */
  141. int
  142. joylink_dev_get_random();
  143. /**
  144. * brief:
  145. *
  146. * @Returns:
  147. */
  148. int joylink_dev_https_post( char* host, char* query ,char *revbuf,int buflen);
  149. /**
  150. * brief:
  151. *
  152. * @Returns:
  153. */
  154. int joylink_dev_run_status(JLRunStatus_t status);
  155. #ifdef __cplusplus
  156. }
  157. #endif /* __cplusplus */
  158. #endif