TuyaOS
ethernetif.h
浏览该文件的文档.
1
8#ifndef __ETHERNETIF_H__
9#define __ETHERNETIF_H__
10
11
12#include "lwip/err.h"
13#include "lwip/netif.h"
14#include "tuya_cloud_types.h"
15
16/***********************************************************
17*************************micro define***********************
18***********************************************************/
19/* num of netif: 0 is to STATION wifi interface, 1 is to AP wifi interface */
20
21typedef enum {
22 NETIF_STA_IDX = 0,
23 NETIF_AP_IDX,
24 NETIF_NUM
25} TUYA_NETIF_TYPE;
26
27typedef struct {
28 ip4_addr_t ip;
29 ip4_addr_t netmask;
30 ip4_addr_t gw;
32
33/***********************************************************
34*************************variable define********************
35***********************************************************/
36
37/***********************************************************
38*************************function define********************
39***********************************************************/
40
47struct netif *tuya_ethernetif_get_netif_by_index(const TUYA_NETIF_TYPE net_if_idx);
48
57int tuya_ethernetif_get_ip(const TUYA_NETIF_TYPE net_if_idx, NW_IP_TYPE type, NW_IP_S *ip);
58
66int tuya_ethernetif_mac_set(const TUYA_NETIF_TYPE net_if_idx, NW_MAC_S *mac);
67
75int tuya_ethernetif_mac_get(const TUYA_NETIF_TYPE net_if_idx, NW_MAC_S *mac);
76
83//int tuya_ethernetif_station_state_get(void);
84
92//int tuya_ethernetif_recv(struct netif *netif, struct pbuf *p);
93
101
102
103//unsigned int tuya_ethernetif_ip_chksum(void *buf, unsigned short len);
104
105#if LWIP_EAPOL_SUPPORT
106extern int tuya_hostap_eapol_input(int vif_index, unsigned char *buf, unsigned short len);
107#endif /* LWIP_EAPOL_SUPPORT */
108
109int tuya_ethernetif_get_ifindex_by_mac(NW_MAC_S *mac, TUYA_NETIF_TYPE *net_if_idx);
110
111int tuya_ethernetif_get_dns_srv(NW_IP_TYPE type, NW_IP_S *ip);
112#endif /* __ETHERNETIF_H__ */
struct netif * tuya_ethernetif_get_netif_by_index(const TUYA_NETIF_TYPE net_if_idx)
get netif by index
int tuya_ethernetif_mac_set(const TUYA_NETIF_TYPE net_if_idx, NW_MAC_S *mac)
set netif's mac
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
int tuya_ethernetif_mac_get(const TUYA_NETIF_TYPE net_if_idx, NW_MAC_S *mac)
get netif's mac
err_t tuya_ethernetif_init(struct netif *netif)
netif check(check netif is up/down and ip is valid)
s8_t err_t
Definition: err.h:96
Definition: netif.h:260
Definition: ethernetif.h:27