smartconfig.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * File : smartconfig.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2018-09-13 Bernard the first version
  23. */
  24. #ifndef __SMARTCONFIG_H__
  25. #define __SMARTCONFIG_H__
  26. #define SMARTCONFIG_EVENT_CHANGE_CHANNEL (1 << 0)
  27. #define SMARTCONFIG_EVENT_LOCKED_CHANNEL (1 << 1)
  28. #define SMARTCONFIG_EVENT_COMPLETE (1 << 2)
  29. #define SMARTCONFIG_EVENT_RESTART (1 << 3)
  30. #define SMARTCONFIG_EVENT_STOP (1 << 4)
  31. typedef enum
  32. {
  33. SMARTCONFIG_TYPE_AIRKISS = 0,
  34. SMARTCONFIG_TYPE_JDSMART = 1,
  35. SMARTCONFIG_TYPE_ESPTOUCH,
  36. SMARTCONFIG_TYPE_REALTOUCH,
  37. SMARTCONFIG_TYPE_ALL,
  38. SMARTCONFIG_TYPE_MAX,
  39. } rt_smartconfig_type;
  40. typedef enum
  41. {
  42. SMARTCONFIG_ENCRYPT_NONE,
  43. SMARTCONFIG_ENCRYPT_AES,
  44. } rt_smartconfig_encrypt_type;
  45. typedef int (*rt_smartconfig_result_cb)(rt_smartconfig_type result_type, char *ssid, char *passwd, \
  46. void *userdata, rt_uint8_t userdata_len);
  47. typedef void (*rt_smartconfig_event_handle)(rt_uint32_t event, void *userdata);
  48. int rt_smartconfig_start(rt_smartconfig_type config_type, rt_smartconfig_encrypt_type encrypt_type, char *encrypt, \
  49. rt_smartconfig_result_cb result_cb);
  50. int rt_smartconfig_stop(void);
  51. void rt_smartconfig_set_event_handle(rt_smartconfig_event_handle handle, void *userdata);
  52. char *rt_smartconfig_version(void);
  53. #endif