joylink_extern.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #ifndef _JOYLINK_EXTERN_H_
  2. #define _JOYLINK_EXTERN_H_
  3. #ifdef __cplusplus
  4. extern "C"{
  5. #endif /* __cplusplus */
  6. #ifdef __RT_THREAD__
  7. #include <rtthread.h>
  8. #endif
  9. #include "joylink.h"
  10. #define JOYLINK_CLOUD_AUTH
  11. #define JOYLINK_DEVICE_AUTH
  12. #ifdef JOYLINK_USING_THUNDER_SLAVE
  13. #define JOYLINK_THUNDER_SLAVE
  14. #endif
  15. #ifdef JOYLINK_USING_SMARTCONFIG
  16. #define JOYLINK_SMART_CONFIG
  17. #endif
  18. #define JLP_VERSION 1
  19. // server configution
  20. #define JLP_SERVER "sbdevicegw.jd.com"
  21. #define JLP_PORT 2002
  22. #define JLP_ENV_FEEDID "jlp_feedid"
  23. #define JLP_ENV_ACCESSKEY "jlp_accesskey"
  24. #define JLP_ENV_LOCALKEY "jlp_localkey"
  25. #define JLP_ENV_ACTIVATE "jlp_activate"
  26. // Create dev and get the index from developer center
  27. #define JLP_DEV_TYPE E_JLDEV_TYPE_NORMAL
  28. #define JLP_LAN_CTRL E_LAN_CTRL_ENABLE
  29. #define JLP_CMD_TYPE E_CMD_TYPE_LUA_SCRIPT
  30. #define JLP_SNAPSHOT E_SNAPSHOT_NO
  31. // bzero/sleep function support
  32. #define bzero(buff, bufsz) rt_memset(buff, 0, bufsz)
  33. #define sleep(time) rt_thread_mdelay(time * 1000)
  34. // for rt-thread cJSON package
  35. #define cJSON_Print cJSON_PrintUnformatted
  36. /**
  37. * brief:
  38. * Get device UUID .
  39. *
  40. * @Param: out device UUID
  41. *
  42. * @Returns:
  43. * <0: get failed
  44. * 0: get successfully
  45. */
  46. int
  47. joylink_dev_get_uuid(char *out);
  48. /**
  49. * brief:
  50. * Get device public key .
  51. *
  52. * @Param: out device public key
  53. *
  54. * @Returns:
  55. * <0: get failed
  56. * 0: get successfully
  57. */
  58. int
  59. joylink_dev_get_public_key(char *out);
  60. /**
  61. * brief:
  62. * Get device MAC address.
  63. *
  64. * @Param: out MAC address buffer
  65. *
  66. * @Returns:
  67. * <0: get failed
  68. * 0: get successfully
  69. */
  70. int
  71. joylink_dev_get_user_mac(char *out);
  72. /**
  73. * brief:
  74. * Get device pricate key.
  75. *
  76. * @Param: out private key buffer
  77. *
  78. * @Returns:
  79. * <0: get failed
  80. * 0: get successfully
  81. */
  82. int
  83. joylink_dev_get_private_key(char *out);
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87. #endif