TuyaOS
结构体 | 枚举 | 函数
ethernetif.h 文件参考

LWIP网口相关封装 更多...

#include "lwip/err.h"
#include "lwip/netif.h"
#include "tuya_cloud_types.h"
ethernetif.h 的引用(Include)关系图:

浏览源代码.

结构体

struct  ty_netif_ip_info_s
 

枚举

enum  TUYA_NETIF_TYPE { NETIF_STA_IDX = 0 , NETIF_AP_IDX , NETIF_NUM }
 

函数

int tuya_ethernetif_get_dns_srv (NW_IP_TYPE type, NW_IP_S *ip)
 
int tuya_ethernetif_get_ifindex_by_mac (NW_MAC_S *mac, TUYA_NETIF_TYPE *net_if_idx)
 
int tuya_ethernetif_get_ip (const TUYA_NETIF_TYPE net_if_idx, NW_IP_TYPE type, NW_IP_S *ip)
 get netif ipaddr from lwip 更多...
 
struct netiftuya_ethernetif_get_netif_by_index (const TUYA_NETIF_TYPE net_if_idx)
 get netif by index 更多...
 
err_t tuya_ethernetif_init (struct netif *netif)
 netif check(check netif is up/down and ip is valid) 更多...
 
int tuya_ethernetif_mac_get (const TUYA_NETIF_TYPE net_if_idx, NW_MAC_S *mac)
 get netif's mac 更多...
 
int tuya_ethernetif_mac_set (const TUYA_NETIF_TYPE net_if_idx, NW_MAC_S *mac)
 set netif's mac 更多...
 

详细描述

LWIP网口相关封装

函数说明

◆ tuya_ethernetif_get_ip()

int tuya_ethernetif_get_ip ( const TUYA_NETIF_TYPE  net_if_idx,
NW_IP_TYPE  type,
NW_IP_S *  ip 
)

get netif ipaddr from lwip

参数
[in]net_if_idxindex of netif
[in]typeip type
[out]ipip of netif(ip gateway mask)
返回
0 on success

◆ tuya_ethernetif_get_netif_by_index()

struct netif * tuya_ethernetif_get_netif_by_index ( const TUYA_NETIF_TYPE  net_if_idx)

get netif by index

参数
[in]net_if_idxthe num of netif index
返回
NULL: get netif fail other: the point of netif

◆ tuya_ethernetif_init()

err_t tuya_ethernetif_init ( struct netif netif)

netif check(check netif is up/down and ip is valid)

参数
void
返回
int OPRT_OS_ADAPTER_OK:netif is up and ip is valid

ethernet interface recv the packet

参数
[in]netifthe netif to which to recieve the packet
[in]total_lenthe length of the packet recieved from the netif
返回
void

ethernet interface sendout the pbuf packet

参数
[in]netifthe netif to which to be inited
返回
err_t SEE "err_enum_t" in "lwip/err.h" to see the lwip err(ERR_OK: SUCCESS other:fail)

◆ tuya_ethernetif_mac_get()

int tuya_ethernetif_mac_get ( const TUYA_NETIF_TYPE  net_if_idx,
NW_MAC_S *  mac 
)

get netif's mac

参数
[in]net_if_idxindex of netif
[out]macmac to set
返回
int OPRT_OS_ADAPTER_OK:success other:fail

◆ tuya_ethernetif_mac_set()

int tuya_ethernetif_mac_set ( const TUYA_NETIF_TYPE  net_if_idx,
NW_MAC_S *  mac 
)

set netif's mac

参数
[in]net_if_idxindex of netif
[in]macmac to set
返回
int OPRT_OS_ADAPTER_OK:success other:fail