mbeduino + Weatherduino Weather Stations post test

Dependencies:   mbed

Committer:
okini3939
Date:
Tue Oct 26 17:19:28 2010 +0000
Revision:
0:10bcaa7c2253

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
okini3939 0:10bcaa7c2253 1 /*
okini3939 0:10bcaa7c2253 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
okini3939 0:10bcaa7c2253 3 * All rights reserved.
okini3939 0:10bcaa7c2253 4 *
okini3939 0:10bcaa7c2253 5 * Redistribution and use in source and binary forms, with or without modification,
okini3939 0:10bcaa7c2253 6 * are permitted provided that the following conditions are met:
okini3939 0:10bcaa7c2253 7 *
okini3939 0:10bcaa7c2253 8 * 1. Redistributions of source code must retain the above copyright notice,
okini3939 0:10bcaa7c2253 9 * this list of conditions and the following disclaimer.
okini3939 0:10bcaa7c2253 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
okini3939 0:10bcaa7c2253 11 * this list of conditions and the following disclaimer in the documentation
okini3939 0:10bcaa7c2253 12 * and/or other materials provided with the distribution.
okini3939 0:10bcaa7c2253 13 * 3. The name of the author may not be used to endorse or promote products
okini3939 0:10bcaa7c2253 14 * derived from this software without specific prior written permission.
okini3939 0:10bcaa7c2253 15 *
okini3939 0:10bcaa7c2253 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
okini3939 0:10bcaa7c2253 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
okini3939 0:10bcaa7c2253 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
okini3939 0:10bcaa7c2253 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
okini3939 0:10bcaa7c2253 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
okini3939 0:10bcaa7c2253 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
okini3939 0:10bcaa7c2253 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
okini3939 0:10bcaa7c2253 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
okini3939 0:10bcaa7c2253 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
okini3939 0:10bcaa7c2253 25 * OF SUCH DAMAGE.
okini3939 0:10bcaa7c2253 26 *
okini3939 0:10bcaa7c2253 27 * This file is part of the lwIP TCP/IP stack.
okini3939 0:10bcaa7c2253 28 *
okini3939 0:10bcaa7c2253 29 * Author: Adam Dunkels <adam@sics.se>
okini3939 0:10bcaa7c2253 30 *
okini3939 0:10bcaa7c2253 31 */
okini3939 0:10bcaa7c2253 32 #ifndef __LWIP_API_H__
okini3939 0:10bcaa7c2253 33 #define __LWIP_API_H__
okini3939 0:10bcaa7c2253 34
okini3939 0:10bcaa7c2253 35 #include "lwip/opt.h"
okini3939 0:10bcaa7c2253 36
okini3939 0:10bcaa7c2253 37 #if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
okini3939 0:10bcaa7c2253 38
okini3939 0:10bcaa7c2253 39 #include <stddef.h> /* for size_t */
okini3939 0:10bcaa7c2253 40
okini3939 0:10bcaa7c2253 41 #include "lwip/netbuf.h"
okini3939 0:10bcaa7c2253 42 #include "lwip/sys.h"
okini3939 0:10bcaa7c2253 43 #include "lwip/ip_addr.h"
okini3939 0:10bcaa7c2253 44 #include "lwip/err.h"
okini3939 0:10bcaa7c2253 45
okini3939 0:10bcaa7c2253 46 #ifdef __cplusplus
okini3939 0:10bcaa7c2253 47 extern "C" {
okini3939 0:10bcaa7c2253 48 #endif
okini3939 0:10bcaa7c2253 49
okini3939 0:10bcaa7c2253 50 /* Throughout this file, IP addresses and port numbers are expected to be in
okini3939 0:10bcaa7c2253 51 * the same byte order as in the corresponding pcb.
okini3939 0:10bcaa7c2253 52 */
okini3939 0:10bcaa7c2253 53
okini3939 0:10bcaa7c2253 54 /* Flags for netconn_write (u8_t) */
okini3939 0:10bcaa7c2253 55 #define NETCONN_NOFLAG 0x00
okini3939 0:10bcaa7c2253 56 #define NETCONN_NOCOPY 0x00 /* Only for source code compatibility */
okini3939 0:10bcaa7c2253 57 #define NETCONN_COPY 0x01
okini3939 0:10bcaa7c2253 58 #define NETCONN_MORE 0x02
okini3939 0:10bcaa7c2253 59 #define NETCONN_DONTBLOCK 0x04
okini3939 0:10bcaa7c2253 60
okini3939 0:10bcaa7c2253 61 /* Flags for struct netconn.flags (u8_t) */
okini3939 0:10bcaa7c2253 62 /** TCP: when data passed to netconn_write doesn't fit into the send buffer,
okini3939 0:10bcaa7c2253 63 this temporarily stores whether to wake up the original application task
okini3939 0:10bcaa7c2253 64 if data couldn't be sent in the first try. */
okini3939 0:10bcaa7c2253 65 #define NETCONN_FLAG_WRITE_DELAYED 0x01
okini3939 0:10bcaa7c2253 66 /** Should this netconn avoid blocking? */
okini3939 0:10bcaa7c2253 67 #define NETCONN_FLAG_NON_BLOCKING 0x02
okini3939 0:10bcaa7c2253 68 /** Was the last connect action a non-blocking one? */
okini3939 0:10bcaa7c2253 69 #define NETCONN_FLAG_IN_NONBLOCKING_CONNECT 0x04
okini3939 0:10bcaa7c2253 70 /** If this is set, a TCP netconn must call netconn_recved() to update
okini3939 0:10bcaa7c2253 71 the TCP receive window (done automatically if not set). */
okini3939 0:10bcaa7c2253 72 #define NETCONN_FLAG_NO_AUTO_RECVED 0x08
okini3939 0:10bcaa7c2253 73 /** If a nonblocking write has been rejected before, poll_tcp needs to
okini3939 0:10bcaa7c2253 74 check if the netconn is writable again */
okini3939 0:10bcaa7c2253 75 #define NETCONN_FLAG_CHECK_WRITESPACE 0x10
okini3939 0:10bcaa7c2253 76
okini3939 0:10bcaa7c2253 77
okini3939 0:10bcaa7c2253 78 /* Helpers to process several netconn_types by the same code */
okini3939 0:10bcaa7c2253 79 #define NETCONNTYPE_GROUP(t) (t&0xF0)
okini3939 0:10bcaa7c2253 80 #define NETCONNTYPE_DATAGRAM(t) (t&0xE0)
okini3939 0:10bcaa7c2253 81
okini3939 0:10bcaa7c2253 82 /** Protocol family and type of the netconn */
okini3939 0:10bcaa7c2253 83 enum netconn_type {
okini3939 0:10bcaa7c2253 84 NETCONN_INVALID = 0,
okini3939 0:10bcaa7c2253 85 /* NETCONN_TCP Group */
okini3939 0:10bcaa7c2253 86 NETCONN_TCP = 0x10,
okini3939 0:10bcaa7c2253 87 /* NETCONN_UDP Group */
okini3939 0:10bcaa7c2253 88 NETCONN_UDP = 0x20,
okini3939 0:10bcaa7c2253 89 NETCONN_UDPLITE = 0x21,
okini3939 0:10bcaa7c2253 90 NETCONN_UDPNOCHKSUM= 0x22,
okini3939 0:10bcaa7c2253 91 /* NETCONN_RAW Group */
okini3939 0:10bcaa7c2253 92 NETCONN_RAW = 0x40
okini3939 0:10bcaa7c2253 93 };
okini3939 0:10bcaa7c2253 94
okini3939 0:10bcaa7c2253 95 /** Current state of the netconn. Non-TCP netconns are always
okini3939 0:10bcaa7c2253 96 * in state NETCONN_NONE! */
okini3939 0:10bcaa7c2253 97 enum netconn_state {
okini3939 0:10bcaa7c2253 98 NETCONN_NONE,
okini3939 0:10bcaa7c2253 99 NETCONN_WRITE,
okini3939 0:10bcaa7c2253 100 NETCONN_LISTEN,
okini3939 0:10bcaa7c2253 101 NETCONN_CONNECT,
okini3939 0:10bcaa7c2253 102 NETCONN_CLOSE
okini3939 0:10bcaa7c2253 103 };
okini3939 0:10bcaa7c2253 104
okini3939 0:10bcaa7c2253 105 /** Use to inform the callback function about changes */
okini3939 0:10bcaa7c2253 106 enum netconn_evt {
okini3939 0:10bcaa7c2253 107 NETCONN_EVT_RCVPLUS,
okini3939 0:10bcaa7c2253 108 NETCONN_EVT_RCVMINUS,
okini3939 0:10bcaa7c2253 109 NETCONN_EVT_SENDPLUS,
okini3939 0:10bcaa7c2253 110 NETCONN_EVT_SENDMINUS,
okini3939 0:10bcaa7c2253 111 NETCONN_EVT_ERROR
okini3939 0:10bcaa7c2253 112 };
okini3939 0:10bcaa7c2253 113
okini3939 0:10bcaa7c2253 114 #if LWIP_IGMP
okini3939 0:10bcaa7c2253 115 /** Used for netconn_join_leave_group() */
okini3939 0:10bcaa7c2253 116 enum netconn_igmp {
okini3939 0:10bcaa7c2253 117 NETCONN_JOIN,
okini3939 0:10bcaa7c2253 118 NETCONN_LEAVE
okini3939 0:10bcaa7c2253 119 };
okini3939 0:10bcaa7c2253 120 #endif /* LWIP_IGMP */
okini3939 0:10bcaa7c2253 121
okini3939 0:10bcaa7c2253 122 /* forward-declare some structs to avoid to include their headers */
okini3939 0:10bcaa7c2253 123 struct ip_pcb;
okini3939 0:10bcaa7c2253 124 struct tcp_pcb;
okini3939 0:10bcaa7c2253 125 struct udp_pcb;
okini3939 0:10bcaa7c2253 126 struct raw_pcb;
okini3939 0:10bcaa7c2253 127 struct netconn;
okini3939 0:10bcaa7c2253 128 struct api_msg_msg;
okini3939 0:10bcaa7c2253 129
okini3939 0:10bcaa7c2253 130 /** A callback prototype to inform about events for a netconn */
okini3939 0:10bcaa7c2253 131 typedef void (* netconn_callback)(struct netconn *, enum netconn_evt, u16_t len);
okini3939 0:10bcaa7c2253 132
okini3939 0:10bcaa7c2253 133 /** A netconn descriptor */
okini3939 0:10bcaa7c2253 134 struct netconn {
okini3939 0:10bcaa7c2253 135 /** type of the netconn (TCP, UDP or RAW) */
okini3939 0:10bcaa7c2253 136 enum netconn_type type;
okini3939 0:10bcaa7c2253 137 /** current state of the netconn */
okini3939 0:10bcaa7c2253 138 enum netconn_state state;
okini3939 0:10bcaa7c2253 139 /** the lwIP internal protocol control block */
okini3939 0:10bcaa7c2253 140 union {
okini3939 0:10bcaa7c2253 141 struct ip_pcb *ip;
okini3939 0:10bcaa7c2253 142 struct tcp_pcb *tcp;
okini3939 0:10bcaa7c2253 143 struct udp_pcb *udp;
okini3939 0:10bcaa7c2253 144 struct raw_pcb *raw;
okini3939 0:10bcaa7c2253 145 } pcb;
okini3939 0:10bcaa7c2253 146 /** the last error this netconn had */
okini3939 0:10bcaa7c2253 147 err_t last_err;
okini3939 0:10bcaa7c2253 148 /** sem that is used to synchroneously execute functions in the core context */
okini3939 0:10bcaa7c2253 149 sys_sem_t op_completed;
okini3939 0:10bcaa7c2253 150 /** mbox where received packets are stored until they are fetched
okini3939 0:10bcaa7c2253 151 by the netconn application thread (can grow quite big) */
okini3939 0:10bcaa7c2253 152 sys_mbox_t recvmbox;
okini3939 0:10bcaa7c2253 153 #if LWIP_TCP
okini3939 0:10bcaa7c2253 154 /** mbox where new connections are stored until processed
okini3939 0:10bcaa7c2253 155 by the application thread */
okini3939 0:10bcaa7c2253 156 sys_mbox_t acceptmbox;
okini3939 0:10bcaa7c2253 157 #endif /* LWIP_TCP */
okini3939 0:10bcaa7c2253 158 /** only used for socket layer */
okini3939 0:10bcaa7c2253 159 #if LWIP_SOCKET
okini3939 0:10bcaa7c2253 160 int socket;
okini3939 0:10bcaa7c2253 161 #endif /* LWIP_SOCKET */
okini3939 0:10bcaa7c2253 162 #if LWIP_SO_RCVTIMEO
okini3939 0:10bcaa7c2253 163 /** timeout to wait for new data to be received
okini3939 0:10bcaa7c2253 164 (or connections to arrive for listening netconns) */
okini3939 0:10bcaa7c2253 165 int recv_timeout;
okini3939 0:10bcaa7c2253 166 #endif /* LWIP_SO_RCVTIMEO */
okini3939 0:10bcaa7c2253 167 #if LWIP_SO_RCVBUF
okini3939 0:10bcaa7c2253 168 /** maximum amount of bytes queued in recvmbox
okini3939 0:10bcaa7c2253 169 not used for TCP: adjust TCP_WND instead! */
okini3939 0:10bcaa7c2253 170 int recv_bufsize;
okini3939 0:10bcaa7c2253 171 #endif /* LWIP_SO_RCVBUF */
okini3939 0:10bcaa7c2253 172 /** number of bytes currently in recvmbox to be received,
okini3939 0:10bcaa7c2253 173 tested against recv_bufsize to limit bytes on recvmbox
okini3939 0:10bcaa7c2253 174 for UDP and RAW
okini3939 0:10bcaa7c2253 175 @todo: should only be necessary with LWIP_SO_RCVBUF==1 */
okini3939 0:10bcaa7c2253 176 s16_t recv_avail;
okini3939 0:10bcaa7c2253 177 /** flags holding more netconn-internal state, see NETCONN_FLAG_* defines */
okini3939 0:10bcaa7c2253 178 u8_t flags;
okini3939 0:10bcaa7c2253 179 #if LWIP_TCP
okini3939 0:10bcaa7c2253 180 /** TCP: when data passed to netconn_write doesn't fit into the send buffer,
okini3939 0:10bcaa7c2253 181 this temporarily stores how much is already sent. */
okini3939 0:10bcaa7c2253 182 size_t write_offset;
okini3939 0:10bcaa7c2253 183 /** TCP: when data passed to netconn_write doesn't fit into the send buffer,
okini3939 0:10bcaa7c2253 184 this temporarily stores the message.
okini3939 0:10bcaa7c2253 185 Also used during connect and close. */
okini3939 0:10bcaa7c2253 186 struct api_msg_msg *current_msg;
okini3939 0:10bcaa7c2253 187 #endif /* LWIP_TCP */
okini3939 0:10bcaa7c2253 188 /** A callback function that is informed about events for this netconn */
okini3939 0:10bcaa7c2253 189 netconn_callback callback;
okini3939 0:10bcaa7c2253 190 };
okini3939 0:10bcaa7c2253 191
okini3939 0:10bcaa7c2253 192 /** Register an Network connection event */
okini3939 0:10bcaa7c2253 193 #define API_EVENT(c,e,l) if (c->callback) { \
okini3939 0:10bcaa7c2253 194 (*c->callback)(c, e, l); \
okini3939 0:10bcaa7c2253 195 }
okini3939 0:10bcaa7c2253 196
okini3939 0:10bcaa7c2253 197 /** Set conn->last_err to err but don't overwrite fatal errors */
okini3939 0:10bcaa7c2253 198 #define NETCONN_SET_SAFE_ERR(conn, err) do { \
okini3939 0:10bcaa7c2253 199 SYS_ARCH_DECL_PROTECT(lev); \
okini3939 0:10bcaa7c2253 200 SYS_ARCH_PROTECT(lev); \
okini3939 0:10bcaa7c2253 201 if (!ERR_IS_FATAL((conn)->last_err)) { \
okini3939 0:10bcaa7c2253 202 (conn)->last_err = err; \
okini3939 0:10bcaa7c2253 203 } \
okini3939 0:10bcaa7c2253 204 SYS_ARCH_UNPROTECT(lev); \
okini3939 0:10bcaa7c2253 205 } while(0);
okini3939 0:10bcaa7c2253 206
okini3939 0:10bcaa7c2253 207 /* Network connection functions: */
okini3939 0:10bcaa7c2253 208 #define netconn_new(t) netconn_new_with_proto_and_callback(t, 0, NULL)
okini3939 0:10bcaa7c2253 209 #define netconn_new_with_callback(t, c) netconn_new_with_proto_and_callback(t, 0, c)
okini3939 0:10bcaa7c2253 210 struct
okini3939 0:10bcaa7c2253 211 netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto,
okini3939 0:10bcaa7c2253 212 netconn_callback callback);
okini3939 0:10bcaa7c2253 213 err_t netconn_delete(struct netconn *conn);
okini3939 0:10bcaa7c2253 214 /** Get the type of a netconn (as enum netconn_type). */
okini3939 0:10bcaa7c2253 215 #define netconn_type(conn) (conn->type)
okini3939 0:10bcaa7c2253 216
okini3939 0:10bcaa7c2253 217 err_t netconn_getaddr(struct netconn *conn, ip_addr_t *addr,
okini3939 0:10bcaa7c2253 218 u16_t *port, u8_t local);
okini3939 0:10bcaa7c2253 219 #define netconn_peer(c,i,p) netconn_getaddr(c,i,p,0)
okini3939 0:10bcaa7c2253 220 #define netconn_addr(c,i,p) netconn_getaddr(c,i,p,1)
okini3939 0:10bcaa7c2253 221
okini3939 0:10bcaa7c2253 222 err_t netconn_bind(struct netconn *conn, ip_addr_t *addr, u16_t port);
okini3939 0:10bcaa7c2253 223 err_t netconn_connect(struct netconn *conn, ip_addr_t *addr, u16_t port);
okini3939 0:10bcaa7c2253 224 err_t netconn_disconnect (struct netconn *conn);
okini3939 0:10bcaa7c2253 225 err_t netconn_listen_with_backlog(struct netconn *conn, u8_t backlog);
okini3939 0:10bcaa7c2253 226 #define netconn_listen(conn) netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG)
okini3939 0:10bcaa7c2253 227 err_t netconn_accept(struct netconn *conn, struct netconn **new_conn);
okini3939 0:10bcaa7c2253 228 err_t netconn_recv(struct netconn *conn, struct netbuf **new_buf);
okini3939 0:10bcaa7c2253 229 err_t netconn_recv_tcp_pbuf(struct netconn *conn, struct pbuf **new_buf);
okini3939 0:10bcaa7c2253 230 void netconn_recved(struct netconn *conn, u32_t length);
okini3939 0:10bcaa7c2253 231 err_t netconn_sendto(struct netconn *conn, struct netbuf *buf,
okini3939 0:10bcaa7c2253 232 ip_addr_t *addr, u16_t port);
okini3939 0:10bcaa7c2253 233 err_t netconn_send(struct netconn *conn, struct netbuf *buf);
okini3939 0:10bcaa7c2253 234 err_t netconn_write(struct netconn *conn, const void *dataptr, size_t size,
okini3939 0:10bcaa7c2253 235 u8_t apiflags);
okini3939 0:10bcaa7c2253 236 err_t netconn_close(struct netconn *conn);
okini3939 0:10bcaa7c2253 237 err_t netconn_shutdown(struct netconn *conn, u8_t shut_rx, u8_t shut_tx);
okini3939 0:10bcaa7c2253 238
okini3939 0:10bcaa7c2253 239 #if LWIP_IGMP
okini3939 0:10bcaa7c2253 240 err_t netconn_join_leave_group(struct netconn *conn, ip_addr_t *multiaddr,
okini3939 0:10bcaa7c2253 241 ip_addr_t *netif_addr, enum netconn_igmp join_or_leave);
okini3939 0:10bcaa7c2253 242 #endif /* LWIP_IGMP */
okini3939 0:10bcaa7c2253 243 #if LWIP_DNS
okini3939 0:10bcaa7c2253 244 err_t netconn_gethostbyname(const char *name, ip_addr_t *addr);
okini3939 0:10bcaa7c2253 245 #endif /* LWIP_DNS */
okini3939 0:10bcaa7c2253 246
okini3939 0:10bcaa7c2253 247 #define netconn_err(conn) ((conn)->last_err)
okini3939 0:10bcaa7c2253 248 #define netconn_recv_bufsize(conn) ((conn)->recv_bufsize)
okini3939 0:10bcaa7c2253 249
okini3939 0:10bcaa7c2253 250 /** Set the blocking status of netconn calls (@todo: write/send is missing) */
okini3939 0:10bcaa7c2253 251 #define netconn_set_nonblocking(conn, val) do { if(val) { \
okini3939 0:10bcaa7c2253 252 (conn)->flags |= NETCONN_FLAG_NON_BLOCKING; \
okini3939 0:10bcaa7c2253 253 } else { \
okini3939 0:10bcaa7c2253 254 (conn)->flags &= ~ NETCONN_FLAG_NON_BLOCKING; }} while(0)
okini3939 0:10bcaa7c2253 255 /** Get the blocking status of netconn calls (@todo: write/send is missing) */
okini3939 0:10bcaa7c2253 256 #define netconn_is_nonblocking(conn) (((conn)->flags & NETCONN_FLAG_NON_BLOCKING) != 0)
okini3939 0:10bcaa7c2253 257
okini3939 0:10bcaa7c2253 258 /** TCP: Set the no-auto-recved status of netconn calls (see NETCONN_FLAG_NO_AUTO_RECVED) */
okini3939 0:10bcaa7c2253 259 #define netconn_set_noautorecved(conn, val) do { if(val) { \
okini3939 0:10bcaa7c2253 260 (conn)->flags |= NETCONN_FLAG_NO_AUTO_RECVED; \
okini3939 0:10bcaa7c2253 261 } else { \
okini3939 0:10bcaa7c2253 262 (conn)->flags &= ~ NETCONN_FLAG_NO_AUTO_RECVED; }} while(0)
okini3939 0:10bcaa7c2253 263 /** TCP: Get the no-auto-recved status of netconn calls (see NETCONN_FLAG_NO_AUTO_RECVED) */
okini3939 0:10bcaa7c2253 264 #define netconn_get_noautorecved(conn) (((conn)->flags & NETCONN_FLAG_NO_AUTO_RECVED) != 0)
okini3939 0:10bcaa7c2253 265
okini3939 0:10bcaa7c2253 266 #if LWIP_SO_RCVTIMEO
okini3939 0:10bcaa7c2253 267 /** Set the receive timeout in milliseconds */
okini3939 0:10bcaa7c2253 268 #define netconn_set_recvtimeout(conn, timeout) ((conn)->recv_timeout = (timeout))
okini3939 0:10bcaa7c2253 269 /** Get the receive timeout in milliseconds */
okini3939 0:10bcaa7c2253 270 #define netconn_get_recvtimeout(conn) ((conn)->recv_timeout)
okini3939 0:10bcaa7c2253 271 #endif /* LWIP_SO_RCVTIMEO */
okini3939 0:10bcaa7c2253 272 #if LWIP_SO_RCVBUF
okini3939 0:10bcaa7c2253 273 /** Set the receive buffer in bytes */
okini3939 0:10bcaa7c2253 274 #define netconn_set_recvbufsize(conn, recvbufsize) ((conn)->recv_bufsize = (recvbufsize))
okini3939 0:10bcaa7c2253 275 /** Get the receive buffer in bytes */
okini3939 0:10bcaa7c2253 276 #define netconn_get_recvbufsize(conn) ((conn)->recv_bufsize)
okini3939 0:10bcaa7c2253 277 #endif /* LWIP_SO_RCVBUF*/
okini3939 0:10bcaa7c2253 278
okini3939 0:10bcaa7c2253 279 #ifdef __cplusplus
okini3939 0:10bcaa7c2253 280 }
okini3939 0:10bcaa7c2253 281 #endif
okini3939 0:10bcaa7c2253 282
okini3939 0:10bcaa7c2253 283 #endif /* LWIP_NETCONN */
okini3939 0:10bcaa7c2253 284
okini3939 0:10bcaa7c2253 285 #endif /* __LWIP_API_H__ */