Documentation
Includes
tuya_hal_wifi.h
#include "tuya_hal_wifi.h"
uni_pointer.h
#include "uni_pointer.h"
Macros
Marco __NETCFG_MODULE__
#define __NETCFG_MODULE__
Marco VENDOR_TUYA
#define VENDOR_TUYA (1 << 0)
Marco VENDOR_JD
#define VENDOR_JD (1 << 1)
Marco VENDOR_WEIXIN
#define VENDOR_WEIXIN (1 << 2)
Marco VENDOR_AMAZON
#define VENDOR_AMAZON (1 << 3)
Marco WIFI_SMARTCFG
#define WIFI_SMARTCFG (1 << 0)
Marco WIFI_AP
#define WIFI_AP (1 << 1)
Marco BLE
#define BLE (1 << 2)
Marco CAMERA_QR
#define CAMERA_QR (1 << 3)
Marco WIFI_SMARTCFG_COEXIST
#define WIFI_SMARTCFG_COEXIST (1 << 4)
Marco WIFI_AP_COEXIST
#define WIFI_AP_COEXIST (1 << 5)
Marco WIFI_FFS
#define WIFI_FFS (1 << 6)
Marco WIFI_PEGASUS
#define WIFI_PEGASUS (1 << 7)//无感配网
Marco API_USER
#define API_USER (1 << 8)//用户通过api配网
Marco NETCFG_TY_WIFI_SMARTCFG
#define NETCFG_TY_WIFI_SMARTCFG ((VENDOR_TUYA << 16) | WIFI_SMARTCFG)
Marco NETCFG_TY_WIFI_SMARTCFG_COEXIST
#define NETCFG_TY_WIFI_SMARTCFG_COEXIST ((VENDOR_TUYA << 16) | WIFI_SMARTCFG_COEXIST)
Marco NETCFG_TY_WIFI_AP
#define NETCFG_TY_WIFI_AP ((VENDOR_TUYA << 16) | WIFI_AP)
Marco NETCFG_TY_WIFI_AP_COEXIST
#define NETCFG_TY_WIFI_AP_COEXIST ((VENDOR_TUYA << 16) | WIFI_AP_COEXIST)
Marco NETCFG_TY_BLE
#define NETCFG_TY_BLE ((VENDOR_TUYA << 16) | BLE)
Marco NETCFG_TY_CAMERA_QR
#define NETCFG_TY_CAMERA_QR ((VENDOR_TUYA << 16) | CAMERA_QR)
Marco NETCFG_TY_API_USER
#define NETCFG_TY_API_USER ((VENDOR_TUYA << 16) | API_USER)
Marco NETCFG_JD_WIFI_SMART
#define NETCFG_JD_WIFI_SMART ((VENDOR_JD << 16) | WIFI_SMARTCFG)
Marco NETCFG_WX_WIFI_AIRKISS
#define NETCFG_WX_WIFI_AIRKISS ((VENDOR_WEIXIN << 16) | WIFI_SMARTCFG)
Marco NETCFG_AMAZON_WIFI_FFS
#define NETCFG_AMAZON_WIFI_FFS ((VENDOR_AMAZON << 16) | (WIFI_FFS))
Marco NETCFG_TY_WIFI_PEGASUS
#define NETCFG_TY_WIFI_PEGASUS ((VENDOR_TUYA << 16) | WIFI_PEGASUS)
Marco NETCFG_STOP_ALL_CFG_MODULE
#define NETCFG_STOP_ALL_CFG_MODULE (0)
Marco DEF_AP_SSID_PF
#define DEF_AP_SSID_PF "SmartLife"
Marco WL_TOKEN_LEN
#define WL_TOKEN_LEN (16)
Functions
Func netcfg_module_init
int netcfg_module_init(int netcfg_policy, ApSsidPasswd_t pApInfo, bool isApCfg);
Func netcfg_module_uninit
int netcfg_module_uninit();
Func netcfg_module_register
int netcfg_module_register(int type, FN_NETCFG_START start, FN_NETCFG_STOP stop);
Func netcfg_module_unregister
int netcfg_module_unregister(int type);
Func netcfg_start
int netcfg_start(int type, FN_NETCFG_CB netcfg_finish_cb, void *args);
Func netcfg_stop
int netcfg_stop(int type);
Func netcfg_stop_other_all
int netcfg_stop_other_all(int type);
Func netcfg_start_other_all
int netcfg_start_other_all(int type);
Func netcfg_set_transporter_switch_interval
int netcfg_set_transporter_switch_interval(int ms_interval);
Vars
Consts
Types
Typedefs
Typedef *P_AP_NETCFG_ARGS;
typedef struct{
int enable_station_ap;
WF_AP_CFG_IF_S *pDevApCfg;
}AP_NETCFG_ARGS, *P_AP_NETCFG_ARGS;
Typedef *PTR_SSID_PASSWORD_TOKEN;
typedef struct{
/** ssid array */
uint8_t ssid[WIFI_SSID_LEN+1];
/** length of ssid array */
uint8_t s_len;
/** password array */
uint8_t passwd[WIFI_PASSWD_LEN+1];
/** length of password array */
uint8_t p_len;
/** token array */
uint8_t token[WL_TOKEN_LEN+1];
/** length of token array */
uint8_t t_len;
}SSID_PASSWORD_TOKEN, *PTR_SSID_PASSWORD_TOKEN;
Typedef *ptrApSsidPasswd;
typedef struct apSsidPasswd_s{
/** ssid */
uint8_t* pSsid;
/** password */
uint8_t* pPasswd;
}ApSsidPasswd_t, *ptrApSsidPasswd;
Typedef FN_NETCFG_CB
typedef int (* FN_NETCFG_CB)( PTR_SSID_PASSWORD_TOKEN info, int type);
Typedef FN_NETCFG_START
typedef int (* FN_NETCFG_START)(FN_NETCFG_CB cb, void * args, int type);
Typedef FN_NETCFG_STOP
typedef int (* FN_NETCFG_STOP)(int type);
Typedef *PTR_NETCFG_HANDLER;
typedef struct{
/** node for list */
LIST_HEAD node;
/** netcfg type */
int type;
/** netcfg start function */
FN_NETCFG_START start;
/** netcfg stop function */
FN_NETCFG_STOP stop;
/** netcfg finished function */
FN_NETCFG_CB netcfg_finish_cb;
/** args for netcfg_finish_cb */
void * args;
/** netcfg is started or not */
bool isStarted;
}NETCFG_HANDLER, *PTR_NETCFG_HANDLER;