mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
parent
23febc189b
commit
45feadcb4a
@ -67,8 +67,8 @@ void WiFiServer::begin (uint16_t port, uint8_t backlog)
|
|||||||
{
|
{
|
||||||
if (!backlog)
|
if (!backlog)
|
||||||
return;
|
return;
|
||||||
_port = port;
|
_port = port;
|
||||||
return begin();
|
return begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WiFiServer::begin ()
|
void WiFiServer::begin ()
|
||||||
|
@ -33,4 +33,31 @@ err_t etharp_request(struct netif *netif, const ip4_addr_t *ipaddr)
|
|||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err_t igmp_start(struct netif* netif)
|
||||||
|
{
|
||||||
|
(void)netif;
|
||||||
|
return ERR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
err_t igmp_joingroup_netif(struct netif *netif, const ip4_addr_t *groupaddr)
|
||||||
|
{
|
||||||
|
(void)netif;
|
||||||
|
(void)groupaddr;
|
||||||
|
return ERR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr)
|
||||||
|
{
|
||||||
|
(void)netif;
|
||||||
|
(void)groupaddr;
|
||||||
|
return ERR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct netif* netif_get_by_index(u8_t idx)
|
||||||
|
{
|
||||||
|
(void)idx;
|
||||||
|
return &netif0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
@ -28,6 +28,8 @@ class UdpContext;
|
|||||||
#define GET_IP_HDR(pb) reinterpret_cast<ip_hdr*>(((uint8_t*)((pb)->payload)) - UDP_HLEN - IP_HLEN);
|
#define GET_IP_HDR(pb) reinterpret_cast<ip_hdr*>(((uint8_t*)((pb)->payload)) - UDP_HLEN - IP_HLEN);
|
||||||
#define GET_UDP_HDR(pb) reinterpret_cast<udp_hdr*>(((uint8_t*)((pb)->payload)) - UDP_HLEN);
|
#define GET_UDP_HDR(pb) reinterpret_cast<udp_hdr*>(((uint8_t*)((pb)->payload)) - UDP_HLEN);
|
||||||
|
|
||||||
|
extern netif netif0;
|
||||||
|
|
||||||
class UdpContext
|
class UdpContext
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -86,12 +88,24 @@ public:
|
|||||||
_dst.addr = staticMCastAddr;
|
_dst.addr = staticMCastAddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setMulticastInterface(netif* p_pNetIf)
|
||||||
|
{
|
||||||
|
(void)p_pNetIf;
|
||||||
|
// user multicast, and this is how it works with posix: send to multicast address:
|
||||||
|
_dst.addr = staticMCastAddr;
|
||||||
|
}
|
||||||
|
|
||||||
void setMulticastTTL(int ttl)
|
void setMulticastTTL(int ttl)
|
||||||
{
|
{
|
||||||
(void)ttl;
|
(void)ttl;
|
||||||
//mockverbose("TODO: UdpContext::setMulticastTTL\n");
|
//mockverbose("TODO: UdpContext::setMulticastTTL\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
netif* getInputNetif() const
|
||||||
|
{
|
||||||
|
return &netif0;
|
||||||
|
}
|
||||||
|
|
||||||
// warning: handler is called from tcp stack context
|
// warning: handler is called from tcp stack context
|
||||||
// esp_yield and non-reentrant functions which depend on it will fail
|
// esp_yield and non-reentrant functions which depend on it will fail
|
||||||
void onRx(rxhandler_t handler) {
|
void onRx(rxhandler_t handler) {
|
||||||
@ -246,7 +260,7 @@ private:
|
|||||||
uint8_t addr[16];
|
uint8_t addr[16];
|
||||||
};
|
};
|
||||||
|
|
||||||
inline err_t igmp_joingroup (const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr)
|
extern "C" inline err_t igmp_joingroup (const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr)
|
||||||
{
|
{
|
||||||
(void)ifaddr;
|
(void)ifaddr;
|
||||||
UdpContext::staticMCastAddr = groupaddr->addr;
|
UdpContext::staticMCastAddr = groupaddr->addr;
|
||||||
|
@ -67,5 +67,6 @@ inline int vsnprintf_P(char *str, size_t size, const char *format, va_list ap) {
|
|||||||
#define snprintf_P snprintf
|
#define snprintf_P snprintf
|
||||||
#define sprintf_P sprintf
|
#define sprintf_P sprintf
|
||||||
#define strncmp_P strncmp
|
#define strncmp_P strncmp
|
||||||
|
#define strcat_P strcat
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user