joylink_softap.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*************************************
  2. Copyright (c) 2015-2050, JD Smart All rights reserved.
  3. *************************************/
  4. #ifndef _JOYLINK_H_
  5. #define _JOYLINK_H_
  6. #include "joylink_softap_util.h"
  7. #define SOFTAP_UUID "UJKK5C" //puid
  8. #define SOFTAP_BRAND "38C4" //brand
  9. #define SOFTAP_CID "09A5" //cid
  10. #define DEV_SOFTAP_SSID "JDSaoDiJiQiRen3109"
  11. /*
  12. Description:
  13. The ssid.
  14. Note:
  15. In softap mode,system is expected to use this as the ssid.And the password is default "12345678"
  16. */
  17. extern uint8 softap_ssid[MAX_LEN_OF_SSID+1];
  18. /*
  19. Routine Description:
  20. init function
  21. Arguments:
  22. none
  23. Return Value:
  24. dont take too much care
  25. Note:
  26. System is expected to call this function when system init.
  27. */
  28. int joylink_softap_init(void);
  29. /*
  30. Routine Description:
  31. TCP message handle function.
  32. Arguments:
  33. msg message address
  34. count message length
  35. Return Value:
  36. dont take too much care
  37. Note:
  38. Use this function to handle the TCP message.
  39. */
  40. int joylink_softap_data_packet_handle(int socket_fd, uint8 *msg, int16 count);
  41. /*
  42. Routine Description:
  43. UDP public key broad function
  44. Arguments:
  45. none
  46. Return Value:
  47. dont take too much care
  48. Note:
  49. Broadcast local public key using UDP.
  50. */
  51. int joylink_softap_udpbroad(int socket_fd);
  52. /*
  53. Routine Description:
  54. return the current softap handle result.If the device have received the ssid and password,
  55. It will return TRUE and return the result(ssid and password)
  56. In:
  57. none
  58. Return Value:
  59. TRUE ---the result got
  60. FALSE ---no result got
  61. Note:
  62. System is expected to call this function in inquiry method.
  63. If the function return the right result,System shoud enter to STA mode and try to connet to the ssid
  64. */
  65. int joylink_softap_result(joylinkSoftAP_Result_t* pRet);
  66. #ifdef _IS_DEV_REQUEST_ACTIVE_SUPPORTED_
  67. /**
  68. * @name:joylink_softap_is_need_active
  69. *
  70. * @returns:
  71. */
  72. int joylink_softap_is_need_active(void);
  73. /**
  74. * @name:joylink_softap_active_clear
  75. *
  76. * @returns:
  77. */
  78. int joylink_softap_active_clear(void);
  79. #endif
  80. #endif