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 13 #define SMARTCONFIG_EVENT_CHANGE_CHANNEL (1 << 0) 14 #define SMARTCONFIG_EVENT_LOCKED_CHANNEL (1 << 1) 15 #define SMARTCONFIG_EVENT_COMPLETE (1 << 2) 16 #define SMARTCONFIG_EVENT_RESTART (1 << 3) 17 #define SMARTCONFIG_EVENT_STOP (1 << 4) 18 19 typedef enum 20 { 21 SMARTCONFIG_TYPE_AIRKISS = 0, 22 SMARTCONFIG_TYPE_JDSMART = 1, 23 SMARTCONFIG_TYPE_ESPTOUCH, 24 SMARTCONFIG_TYPE_REALTOUCH, 25 SMARTCONFIG_TYPE_ALL, 26 SMARTCONFIG_TYPE_MAX, 27 } rt_smartconfig_type; 28 29 typedef enum 30 { 31 SMARTCONFIG_ENCRYPT_NONE, 32 SMARTCONFIG_ENCRYPT_AES, 33 } rt_smartconfig_encrypt_type; 34 35 typedef int (*rt_smartconfig_result_cb)(rt_smartconfig_type result_type, char *ssid, char *passwd, \ 36 void *userdata, rt_uint8_t userdata_len); 37 typedef void (*rt_smartconfig_event_handle)(rt_uint32_t event, void *userdata); 38 39 int rt_smartconfig_start(rt_smartconfig_type config_type, rt_smartconfig_encrypt_type encrypt_type, char *encrypt, \ 40 rt_smartconfig_result_cb result_cb); 41 42 int rt_smartconfig_stop(void); 43 44 void rt_smartconfig_set_event_handle(rt_smartconfig_event_handle handle, void *userdata); 45 46 char *rt_smartconfig_version(void); 47 48 #endif 49