Hi. This is the feed program for Cosm. (The previous name of the services is Pachube.)

Dependencies:   mbed ThermistorPack Pachube ConfigFile EthernetNetIf TextLCD HTTPClient_ToBeRemoved FatFileSystem SDFileSystem

Committer:
shintamainjp
Date:
Mon Aug 06 12:37:59 2012 +0000
Revision:
0:521ba375aa0f
Pachube renamed to Cosm.

Who changed what in which revision?

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