Documentation

Documentation

Includes

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_hal_network.h

#include "tuya_hal_network.h"
#include "tuya_hal_network.h"

tuya_hal_wifi.h

#include "tuya_hal_wifi.h"
#include "tuya_hal_wifi.h"

Macros

Marco _WIFI_MGNT_H

#define _WIFI_MGNT_H


      

Marco _WIFI_MGNT_EXT

#define _WIFI_MGNT_EXT


      

Marco _WIFI_MGNT_EXT

#define _WIFI_MGNT_EXT extern


      

Marco PROBE_SSID

#define PROBE_SSID "tuya_smart"
/***********************************************************
*************************micro define***********************
***********************************************************/

Functions

Func tuya_wf_recv_mng_frame_reg

OPERATE_RET tuya_wf_recv_mng_frame_reg(WIFI_REV_MGNT_FILTER filter_cb,WIFI_REV_MGNT_CB cb);
/**
 * @brief register wifi recv mng frame cb
 *
 * @param[in] mng_tp mng type
 * @param[in] cb callback
 *
 * @note called to register mng recv.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_wf_recv_mng_frame_unreg

OPERATE_RET tuya_wf_recv_mng_frame_unreg(WIFI_REV_MGNT_CB cb);
/**
 * @brief unregister wifi recv mng frame cb
 *
 * @param[in] cb callback
 *
 * @note called to unregister mng recv.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Vars

Variable _WIFI_MGNT_EXT

_WIFI_MGNT_EXT \
OPERATE_RET ty_wf_send_probe_request_mgnt(IN CONST UCHAR_T *in_buf, IN CONST UINT_T in_len,IN UCHAR_T* ssid,NW_MAC_S *srcmac,NW_MAC_S *dstmac);
/**
 * @brief send wifi management packets probe request.
 *
 * @param[in] in_buf data to be sent in tuya vsie 
 * @param[in] in_len data length to be sent
 * @param[in] ssid the ssid of the probe request
 * @param[in] source mac address of probe request
 * @param[in] destination mac address of probe request
 *
 * @note send probe request packets.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable _WIFI_MGNT_EXT

_WIFI_MGNT_EXT \
OPERATE_RET ty_wf_send_probe_response_mgnt(IN CONST UCHAR_T *in_buf, IN CONST UINT_T in_len,IN UCHAR_T* ssid,NW_MAC_S *srcmac,NW_MAC_S *dstmac);
/**
 * @brief send wifi management packets probe response.
 *
 * @param[in] in_buf data to be sent in tuya vsie 
 * @param[in] in_len data length to be sent
 * @param[in] ssid the ssid of the probe request
 * @param[in] source mac address of probe request
 * @param[in] destination mac address of probe request
 *
 * @note send probe request packets.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable _WIFI_MGNT_EXT

_WIFI_MGNT_EXT \
OPERATE_RET ty_wf_register_recv_mgnt_callback(BOOL_T enbale,WIFI_REV_MGNT_CB recv_cb);
/**
 * @brief enable wifi management packets reception in wifi station mode.
 *
 * @param[in] enbale disable or enable wifi management packets reception 
 * @param[in] recv_cb callback function to receive management packets
 *
 * @note called in wifi station mode, register callback function to process wifi management packets.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable _WIFI_MGNT_EXT

_WIFI_MGNT_EXT \
OPERATE_RET ty_wf_send_beacon(UCHAR_T* ssid, UCHAR_T chan, BYTE_T* src_mac, BYTE_T* vsie_data, UINT_T vsie_data_len);
/**
 * @brief send wifi beacon packets.
 *
 * @param[in] ssid the beacon ssid 
 * @param[in] chan the beacon's wifi channel
 * @param[in] src_mac the beacon's bssid
 * @param[in] vsie_data tuya vsie data to be inserted into beacon
 * @param[in] vsie_data_len length of vsie data
 *
 * @note called to send beacon frame.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Consts

Types

Typedefs

Typedef WIFI_REV_MGNT_FILTER

typedef BOOL_T (*WIFI_REV_MGNT_FILTER)(UCHAR_T *buf, UINT_T len);
/**
 * @brief filter wifi recv mng frame cb
 *
 * @param[in] buf frame buf
 * @param[in] len frame len
 *
 * @note called to filter mng recv.
 *
 * @return TRUE for needed, FLASE for not needed
 */