Documentation

Documentation

Includes

stdint.h

#include <stdint.h>
#include 

stdbool.h

#include <stdbool.h>
#include 

tuya_cloud_types.h

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

Macros

Marco __WIFI_NETCFG_FRAME_SNIFFER_H__

#define __WIFI_NETCFG_FRAME_SNIFFER_H__

      

Functions

Func WifiNetcfgFrameSnifferCallbackSet

int WifiNetcfgFrameSnifferCallbackSet();
/*共存配网启动时,执行sniffer callback设置*/

Func WifiNetcfgFrameSnifferEnable

int WifiNetcfgFrameSnifferEnable();
/*ez only配网时,使能sniffer*/

Func destroyWifiNetcfgFrameSniffer

void destroyWifiNetcfgFrameSniffer();
/*销毁wifi_netcfg_frame_sniffer实例*/

Func WifiNetcfgFrameSnifferSessionInit

int WifiNetcfgFrameSnifferSessionInit();


      

Func WifiNetcfgFrameSnifferSessionUnInit

int WifiNetcfgFrameSnifferSessionUnInit();

      

Vars

Variable ptrWifiNetcfgFrameSniffer_t

ptrWifiNetcfgFrameSniffer_t getWifiNetcfgFrameSniffer();
/*获取wifi_netcfg_frame_sniffer的实例*/

Consts

Types

Typedefs

Typedef fnSnifferUserCallback_t

typedef int (*fnSnifferUserCallback_t)(void *ptrArgs,uint8_t *buf, uint16_t len, const SCHAR_T rssi);
/*
	角色定义:
	Sniffer:是提供嗅探服务的组件
	SnifferUser:使用Sniffer组件的嗅探服务的用户组件

*/

Typedef *ptrSnifferUserParameters_t;

typedef struct SnifferUserParameters_s{
 fnSnifferUserCallback_t cb; 
 void* ptrArgs;
}SnifferUserParameters_t, *ptrSnifferUserParameters_t;


      

Typedef fnSnifferUserRegister

typedef int (*fnSnifferUserRegister)(int netcfg_type, ptrSnifferUserParameters_t pParam);
/*Sniffer组件内部的生命周期:
	全局:				Init->						 stop -> uninit	
	SnifferUser:			register ->	start ->unregister
*/

Typedef fnSnifferUserUnregister

typedef int (*fnSnifferUserUnregister)(int netcfg_type);


      

Typedef fnSnifferUserStart

typedef int (*fnSnifferUserStart)(int netcfg_type);


      

Typedef fnSnifferUserStop

typedef int (*fnSnifferUserStop)(bool isInternalCall);


      

Typedef fnSnifferUserStopAllOtherNetcfg

typedef int (*fnSnifferUserStopAllOtherNetcfg)(int netcfg_type, bool isInternalCall);
/*
    关闭除netcfg_type之外,其他配网的sniffer收包
    在共存配网时,当探测到netcfg_type的配网意图时,关闭其他配网的收包
*/

Typedef fnSnifferUserStartAllOtherNetcfg

typedef int (*fnSnifferUserStartAllOtherNetcfg)(int netcfg_type, bool isInternalCall);
/*
    打开除netcfg_type之外,其他配网的sniffer收包
    在共存配网时,当netcfg_type超时退出时,重新打开其他配网的收包,继续执行共存配网
*/

Typedef *ptrWifiNetcfgFrameSniffer_t;

typedef struct WifiNetcfgFrameSniffer_s{
   bool isSnifferStart;
   fnSnifferUserRegister            registerSnifferUserFn;
   fnSnifferUserStart	            startSnifferUserFn;
   fnSnifferUserStop	            stopSnifferUserFn;
   fnSnifferUserUnregister            unregisterSnifferUserFn;
   fnSnifferUserStartAllOtherNetcfg   startAllOtherUserFn;
   fnSnifferUserStopAllOtherNetcfg    stopAllOtherUserFn;
}WifiNetcfgFrameSniffer_t, *ptrWifiNetcfgFrameSniffer_t;