smartconfig.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-09-13 Bernard the first version
  9. */
  10. #ifndef __SMARTCONFIG_H__
  11. #define __SMARTCONFIG_H__
  12. #define SMARTCONFIG_EVENT_CHANGE_CHANNEL (1 << 0)
  13. #define SMARTCONFIG_EVENT_LOCKED_CHANNEL (1 << 1)
  14. #define SMARTCONFIG_EVENT_COMPLETE (1 << 2)
  15. #define SMARTCONFIG_EVENT_RESTART (1 << 3)
  16. #define SMARTCONFIG_EVENT_STOP (1 << 4)
  17. typedef enum
  18. {
  19. SMARTCONFIG_TYPE_AIRKISS = 0,
  20. SMARTCONFIG_TYPE_JDSMART = 1,
  21. SMARTCONFIG_TYPE_ESPTOUCH,
  22. SMARTCONFIG_TYPE_REALTOUCH,
  23. SMARTCONFIG_TYPE_ALL,
  24. SMARTCONFIG_TYPE_MAX,
  25. } rt_smartconfig_type;
  26. typedef enum
  27. {
  28. SMARTCONFIG_ENCRYPT_NONE,
  29. SMARTCONFIG_ENCRYPT_AES,
  30. } rt_smartconfig_encrypt_type;
  31. typedef int (*rt_smartconfig_result_cb)(rt_smartconfig_type result_type, char *ssid, char *passwd, \
  32. void *userdata, rt_uint8_t userdata_len);
  33. typedef void (*rt_smartconfig_event_handle)(rt_uint32_t event, void *userdata);
  34. int rt_smartconfig_start(rt_smartconfig_type config_type, rt_smartconfig_encrypt_type encrypt_type, char *encrypt, \
  35. rt_smartconfig_result_cb result_cb);
  36. int rt_smartconfig_stop(void);
  37. void rt_smartconfig_set_event_handle(rt_smartconfig_event_handle handle, void *userdata);
  38. char *rt_smartconfig_version(void);
  39. #endif