TuyaOS
结构体 | 宏定义 | 类型定义 | 枚举 | 函数
tal_wifi.h 文件参考

Common process 更多...

#include "tuya_cloud_types.h"
#include "tkl_wifi.h"
#include "stdint.h"
#include "tal_wifi_mgnt.h"
tal_wifi.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

结构体

struct  PROBE_REQUEST_FIX_S
 

宏定义

#define BC_CHAN_NUM   2
 
#define BC_FROM_AP   1
 
#define BC_TO_AP   0
 
#define BROADCAST_MAC_ADDR   0xFFFFFFFF
 
#define PROBE_REQSPONSE_TYPE_SUBTYPE   0x0050
 
#define PROBE_REQUEST_DURATION_ID   0x0
 
#define PROBE_REQUEST_PAYLOAD_LEN_MAX   255
 
#define PROBE_REQUEST_TYPE_SUBTYPE   0x0040
 
#define PROBE_RESPONSET_DURATION_ID   0x0
 
#define TAG_PAYLOAD_NUMBER   221
 
#define TAG_SSID_NUMBER   0
 
#define TFD_FROM_AP   0x02
 ds+bssid+sa
 
#define TFD_IBSS   0x00
 da+sa+bssid
 
#define TFD_TO_AP   0x01
 bssid+sa+da
 
#define TFD_WDS   0x03
 ra+ta+da
 
#define TO_FROM_DS_MASK   0x03
 

类型定义

typedef unsigned char BC_DA_CHAN_T
 
typedef struct WLAN_FRAME_SP_WLAN_FRAME_S
 

枚举

enum  MIMO_TYPE_E {
  MIMO_TYPE_NORMAL = 0 , MIMO_TYPE_HT40 , MIMO_TYPE_2X2 , MIMO_TYPE_LDPC ,
  MIMO_TYPE_NUM
}
 
enum  WLAN_FRM_TP_E {
  WFT_PROBE_REQ = 0x40 , WFT_PROBE_RSP = 0x50 , WFT_AUTH = 0xB0 , WFT_BEACON = 0x80 ,
  WFT_DATA = 0x08 , WFT_QOS_DATA = 0x88 , WFT_MIMO_DATA = 0xff
}
 

函数

OPERATE_RET tal_fast_station_connect (FAST_CONNECTED_INFO_T *fast_ap_info)
 : fast connect 更多...
 
OPERATE_RET tal_wifi_all_ap_scan (AP_IF_S **ap_ary, UINT_T *num)
 scan current environment and obtain all the ap infos in current environment 更多...
 
OPERATE_RET tal_wifi_ap_start (WF_AP_CFG_IF_S *cfg)
 start a soft ap 更多...
 
OPERATE_RET tal_wifi_ap_stop (VOID_T)
 stop a soft ap 更多...
 
OPERATE_RET tal_wifi_assign_ap_scan (SCHAR_T *ssid, AP_IF_S **ap)
 scan current environment and obtain the specific ap info. 更多...
 
OPERATE_RET tal_wifi_get_bssid (UCHAR_T *mac)
 get wifi bssid 更多...
 
OPERATE_RET tal_wifi_get_connected_ap_info (FAST_CONNECTED_INFO_T **fast_ap_info)
 : get ap info for fast connect 更多...
 
OPERATE_RET tal_wifi_get_cur_channel (UCHAR_T *chan)
 get wifi interface work channel 更多...
 
OPERATE_RET tal_wifi_get_ip (WF_IF_E wf, NW_IP_S *ip)
 get wifi ip info.when wifi works in ap+station mode, wifi has two ips. 更多...
 
OPERATE_RET tal_wifi_get_ipv6 (WF_IF_E wf, NW_IP_TYPE type, NW_IP_S *ip)
 
OPERATE_RET tal_wifi_get_last_disconnect_reason (WF_IF_E wf, WF_DISCONN_REASON_E *reason)
 wifi get last disconnect reason 更多...
 
OPERATE_RET tal_wifi_get_mac (WF_IF_E wf, NW_MAC_S *mac)
 get wifi mac info.when wifi works in ap+station mode, wifi has two macs. 更多...
 
OPERATE_RET tal_wifi_get_work_mode (WF_WK_MD_E *mode)
 get wifi work mode 更多...
 
OPERATE_RET tal_wifi_init (WIFI_EVENT_CB cb)
 set wifi station event changed callback 更多...
 
OPERATE_RET tal_wifi_ioctl (WF_IOCTL_CMD_E cmd, VOID *args)
 wifi ioctl 更多...
 
OPERATE_RET tal_wifi_lp_disable (VOID_T)
 disable wifi lowpower 更多...
 
OPERATE_RET tal_wifi_lp_enable (VOID_T)
 enable wifi lowpower 更多...
 
OPERATE_RET tal_wifi_register_recv_mgnt_callback (BOOL_T enable, WIFI_REV_MGNT_CB recv_cb)
 register receive wifi management callback 更多...
 
OPERATE_RET tal_wifi_release_ap (AP_IF_S *ap)
 release the memory malloced in <tuya_hal_wifi_all_ap_scan> and <tuya_hal_wifi_assign_ap_scan> if needed. tuya-sdk will call this function when the ap info is no use. 更多...
 
BOOL_T tal_wifi_rf_calibrated (VOID_T)
 do wifi calibration 更多...
 
OPERATE_RET tal_wifi_send_mgnt (UCHAR_T *buf, UINT_T len)
 send wifi management 更多...
 
OPERATE_RET tal_wifi_set_country_code (CHAR_T *country_code)
 set wifi country code 更多...
 
OPERATE_RET tal_wifi_set_cur_channel (UCHAR_T chan)
 set wifi interface work channel 更多...
 
VOID_T tal_wifi_set_lps_dtim (UINT_T dtim)
 set the wifi low power dtim. 更多...
 
OPERATE_RET tal_wifi_set_mac (WF_IF_E wf, NW_MAC_S *mac)
 set wifi mac info.when wifi works in ap+station mode, wifi has two macs. 更多...
 
OPERATE_RET tal_wifi_set_work_mode (WF_WK_MD_E mode)
 set wifi work mode 更多...
 
OPERATE_RET tal_wifi_sniffer_set (BOOL_T en, SNIFFER_CALLBACK cb)
 enable / disable wifi sniffer mode. if wifi sniffer mode is enabled, wifi recv from packages from the air, and user shoud send these packages to tuya-sdk with callback <cb>. 更多...
 
OPERATE_RET tal_wifi_station_connect (SCHAR_T *ssid, SCHAR_T *passwd)
 connect wifi with ssid and passwd 更多...
 
OPERATE_RET tal_wifi_station_connect_with_channel (SCHAR_T *ssid, SCHAR_T *passwd, UINT8_T channel)
 connect wifi with ssid,passwd,channel 更多...
 
OPERATE_RET tal_wifi_station_disconnect (VOID_T)
 disconnect wifi from connect ap 更多...
 
OPERATE_RET tal_wifi_station_get_conn_ap_rssi (SCHAR_T *rssi)
 get wifi connect rssi 更多...
 
OPERATE_RET tal_wifi_station_get_err_stat (WF_STATION_STAT_E *stat)
 get wifi error station work status 更多...
 
OPERATE_RET tal_wifi_station_get_status (WF_STATION_STAT_E *stat)
 get wifi station work status 更多...
 

详细描述

Common process

版本
0.1
日期
2020-11-09

枚举类型说明

◆ WLAN_FRM_TP_E

枚举值
WFT_PROBE_REQ 

Probe request

WFT_PROBE_RSP 

Probe response

WFT_AUTH 

auth

WFT_BEACON 

Beacon

WFT_DATA 

Data

WFT_QOS_DATA 

QOS Data

WFT_MIMO_DATA 

MIMO Data

函数说明

◆ tal_fast_station_connect()

OPERATE_RET tal_fast_station_connect ( FAST_CONNECTED_INFO_T *  fast_ap_info)

: fast connect

参数
[in]fast_ap_info
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_all_ap_scan()

OPERATE_RET tal_wifi_all_ap_scan ( AP_IF_S **  ap_ary,
UINT_T *  num 
)

scan current environment and obtain all the ap infos in current environment

参数
[out]ap_arycurrent ap info array
[out]numthe num of ar_ary
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_ap_start()

OPERATE_RET tal_wifi_ap_start ( WF_AP_CFG_IF_S *  cfg)

start a soft ap

参数
[in]cfgthe soft ap config
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_ap_stop()

OPERATE_RET tal_wifi_ap_stop ( VOID_T  )

stop a soft ap

返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_assign_ap_scan()

OPERATE_RET tal_wifi_assign_ap_scan ( SCHAR_T *  ssid,
AP_IF_S **  ap 
)

scan current environment and obtain the specific ap info.

参数
[in]ssidthe specific ssid
[out]apthe ap info
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_get_bssid()

OPERATE_RET tal_wifi_get_bssid ( UCHAR_T *  mac)

get wifi bssid

参数
[out]macuplink mac
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_get_connected_ap_info()

OPERATE_RET tal_wifi_get_connected_ap_info ( FAST_CONNECTED_INFO_T **  fast_ap_info)

: get ap info for fast connect

参数
[out]fast_ap_info
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_get_cur_channel()

OPERATE_RET tal_wifi_get_cur_channel ( UCHAR_T *  chan)

get wifi interface work channel

参数
[out]chanthe channel wifi works
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_get_ip()

OPERATE_RET tal_wifi_get_ip ( WF_IF_E  wf,
NW_IP_S *  ip 
)

get wifi ip info.when wifi works in ap+station mode, wifi has two ips.

参数
[in]wfwifi function type
[out]ipthe ip addr info
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_get_last_disconnect_reason()

OPERATE_RET tal_wifi_get_last_disconnect_reason ( WF_IF_E  wf,
WF_DISCONN_REASON_E *  reason 
)

wifi get last disconnect reason

参数
[in]wfwifi function type
[out]reasonreason code of wifi last disconnect
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_get_mac()

OPERATE_RET tal_wifi_get_mac ( WF_IF_E  wf,
NW_MAC_S *  mac 
)

get wifi mac info.when wifi works in ap+station mode, wifi has two macs.

参数
[in]wfwifi function type
[out]macthe mac info
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_get_work_mode()

OPERATE_RET tal_wifi_get_work_mode ( WF_WK_MD_E *  mode)

get wifi work mode

参数
[out]modewifi work mode
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_init()

OPERATE_RET tal_wifi_init ( WIFI_EVENT_CB  cb)

set wifi station event changed callback

参数
[in]cbthe wifi station event changed callback
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_ioctl()

OPERATE_RET tal_wifi_ioctl ( WF_IOCTL_CMD_E  cmd,
VOID *  args 
)

wifi ioctl

参数
[in]cmdrefer to WF_IOCTL_CMD_E
[in]argsargs associated with the command
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_lp_disable()

OPERATE_RET tal_wifi_lp_disable ( VOID_T  )

disable wifi lowpower

参数
[in]none
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_lp_enable()

OPERATE_RET tal_wifi_lp_enable ( VOID_T  )

enable wifi lowpower

参数
[in]none
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_register_recv_mgnt_callback()

OPERATE_RET tal_wifi_register_recv_mgnt_callback ( BOOL_T  enable,
WIFI_REV_MGNT_CB  recv_cb 
)

register receive wifi management callback

参数
[in]enable
[in]recv_cbreceive callback
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_release_ap()

OPERATE_RET tal_wifi_release_ap ( AP_IF_S *  ap)

release the memory malloced in <tuya_hal_wifi_all_ap_scan> and <tuya_hal_wifi_assign_ap_scan> if needed. tuya-sdk will call this function when the ap info is no use.

参数
[in]apthe ap info
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_rf_calibrated()

BOOL_T tal_wifi_rf_calibrated ( VOID_T  )

do wifi calibration

注解
called when test wifi
返回
true on success. faile on failure

◆ tal_wifi_send_mgnt()

OPERATE_RET tal_wifi_send_mgnt ( UCHAR_T *  buf,
UINT_T  len 
)

send wifi management

参数
[in]bufpointer to buffer
[in]lenlength of buffer
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_set_country_code()

OPERATE_RET tal_wifi_set_country_code ( CHAR_T *  country_code)

set wifi country code

参数
[in]ccodecountry code
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_set_cur_channel()

OPERATE_RET tal_wifi_set_cur_channel ( UCHAR_T  chan)

set wifi interface work channel

参数
[in]chanthe channel to set
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_set_lps_dtim()

VOID_T tal_wifi_set_lps_dtim ( UINT_T  dtim)

set the wifi low power dtim.

注解
called before enter wifi low power mode
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_set_mac()

OPERATE_RET tal_wifi_set_mac ( WF_IF_E  wf,
NW_MAC_S *  mac 
)

set wifi mac info.when wifi works in ap+station mode, wifi has two macs.

参数
[in]wfwifi function type
[in]macthe mac info
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_set_work_mode()

OPERATE_RET tal_wifi_set_work_mode ( WF_WK_MD_E  mode)

set wifi work mode

参数
[in]modewifi work mode
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_sniffer_set()

OPERATE_RET tal_wifi_sniffer_set ( BOOL_T  en,
SNIFFER_CALLBACK  cb 
)

enable / disable wifi sniffer mode. if wifi sniffer mode is enabled, wifi recv from packages from the air, and user shoud send these packages to tuya-sdk with callback <cb>.

参数
[in]enenable or disable
[in]cbnotify callback
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_station_connect()

OPERATE_RET tal_wifi_station_connect ( SCHAR_T *  ssid,
SCHAR_T *  passwd 
)

connect wifi with ssid and passwd

参数
[in]ssid
[in]passwd
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_station_connect_with_channel()

OPERATE_RET tal_wifi_station_connect_with_channel ( SCHAR_T *  ssid,
SCHAR_T *  passwd,
UINT8_T  channel 
)

connect wifi with ssid,passwd,channel

参数
[in]ssid
[in]passwd
[in]channel
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_station_disconnect()

OPERATE_RET tal_wifi_station_disconnect ( VOID_T  )

disconnect wifi from connect ap

返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_station_get_conn_ap_rssi()

OPERATE_RET tal_wifi_station_get_conn_ap_rssi ( SCHAR_T *  rssi)

get wifi connect rssi

参数
[out]rssithe return rssi
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_station_get_err_stat()

OPERATE_RET tal_wifi_station_get_err_stat ( WF_STATION_STAT_E *  stat)

get wifi error station work status

参数
[out]statthe wifi station work status
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_wifi_station_get_status()

OPERATE_RET tal_wifi_station_get_status ( WF_STATION_STAT_E *  stat)

get wifi station work status

参数
[out]statthe wifi station work status
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h