mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-10-20 13:45:08 +08:00
feat: add coap server
This commit is contained in:
6
third_party/coap/library/debug.c
vendored
6
third_party/coap/library/debug.c
vendored
@@ -154,6 +154,10 @@ print_readable( const unsigned char *data, unsigned int len,
|
||||
#define min(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef inet_ntop
|
||||
#define inet_ntop(af,src,dst,size) (((af) == AF_INET) ? ipaddr_ntoa_r((const ip_addr_t *)(src),(dst),(size)) : NULL)
|
||||
#endif
|
||||
|
||||
size_t
|
||||
coap_print_addr(const struct coap_address_t *addr, unsigned char *buf, size_t len) {
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
@@ -163,7 +167,7 @@ coap_print_addr(const struct coap_address_t *addr, unsigned char *buf, size_t le
|
||||
|
||||
switch (addr->addr.sa.sa_family) {
|
||||
case AF_INET:
|
||||
addrptr = &addr->addr.sin.sin_addr;
|
||||
addrptr = &addr->addr.sin.sin_addr.s_addr;
|
||||
port = ntohs(addr->addr.sin.sin_port);
|
||||
break;
|
||||
case AF_INET6:
|
||||
|
Reference in New Issue
Block a user