joylink_dev.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. * Check device network is ok.
  22. *
  23. * @Returns:
  24. * 0: network is not connected
  25. * 1: network is connected
  26. */
  27. int
  28. joylink_dev_is_net_ok(void);
  29. /**
  30. * brief:
  31. *
  32. * @Param: st
  33. *
  34. * @Returns:
  35. */
  36. E_JLRetCode_t
  37. joylink_dev_set_connect_st(int st);
  38. /**
  39. * brief:
  40. *
  41. * @Param: jlp
  42. *
  43. * @Returns:
  44. */
  45. E_JLRetCode_t
  46. joylink_dev_set_attr_jlp(JLPInfo_t *jlp);
  47. /**
  48. * brief:
  49. *
  50. * @Param: jlp
  51. *
  52. * @Returns:
  53. */
  54. E_JLRetCode_t
  55. joylink_dev_get_jlp_info(JLPInfo_t *jlp);
  56. /**
  57. * brief:
  58. * Set unactived mode for deivce activated.
  59. *
  60. * @Returns:
  61. * E_RET_OK
  62. */
  63. E_JLRetCode_t
  64. joylink_set_unactived_mode(void);
  65. /**
  66. * brief:
  67. * Set config mode for deivce smarting config.
  68. *
  69. * @Returns:
  70. * E_RET_OK
  71. */
  72. E_JLRetCode_t
  73. joylink_set_config_mode(void);
  74. /**
  75. * brief:
  76. * Exit current config mode or unactived mode.
  77. *
  78. * @Returns:
  79. * E_RET_OK
  80. */
  81. E_JLRetCode_t
  82. joylink_exit_current_mode(void);
  83. /**
  84. * brief:
  85. *
  86. * @Param: out_modelcode
  87. * @Param: out_max
  88. *
  89. * @Returns:
  90. */
  91. int
  92. joylink_dev_get_modelcode(char *out_modelcode, int32_t out_max);
  93. /**
  94. * brief:
  95. *
  96. * @Param: out_snap
  97. * @Param: out_max
  98. *
  99. * @Returns:
  100. */
  101. int
  102. joylink_dev_get_snap_shot(char *out_snap, int32_t out_max);
  103. /**
  104. * brief:
  105. *
  106. * @Param: out_snap
  107. * @Param: out_max
  108. * @Param: code
  109. * @Param: feedid
  110. *
  111. * @Returns:
  112. */
  113. int
  114. joylink_dev_get_json_snap_shot(char *out_snap, int32_t out_max, int code, char *feedid);
  115. /**
  116. * brief:
  117. *
  118. * @Param: json_cmd
  119. *
  120. * @Returns:
  121. */
  122. E_JLRetCode_t
  123. joylink_dev_lan_json_ctrl(const char *json_cmd);
  124. /**
  125. * brief:
  126. *
  127. * @Param: src
  128. * @Param: src_len
  129. * @Param: ctr
  130. * @Param: from_server
  131. *
  132. * @Returns:
  133. */
  134. E_JLRetCode_t
  135. joylink_dev_script_ctrl(const char *src, int src_len, JLContrl_t *ctr, int from_server);
  136. /**
  137. * brief:
  138. *
  139. * @Param: otaOrder
  140. *
  141. * @Returns:
  142. */
  143. E_JLRetCode_t
  144. joylink_dev_ota(JLOtaOrder_t *otaOrder);
  145. /**
  146. * brief:
  147. */
  148. void
  149. joylink_dev_ota_status_upload(void);
  150. /**
  151. * brief:
  152. */
  153. int
  154. joylink_test_ota_crc(void);
  155. /**
  156. * brief:
  157. *
  158. * @Param: pidt
  159. *
  160. * @Returns:
  161. */
  162. E_JLRetCode_t
  163. joylink_dev_get_idt(jl2_d_idt_t *pidt);
  164. /**
  165. * brief:
  166. *
  167. * @Param:
  168. *
  169. * @Returns:
  170. */
  171. int
  172. joylink_dev_get_random(void);
  173. #ifdef __cplusplus
  174. }
  175. #endif /* __cplusplus */
  176. #endif