Created define instead of extra-function for netconn_new, netconn_new_with_callback and netconn_err, added netconn_type NETCONN_INVALID

This commit is contained in:
goldsimon 2007-06-16 13:58:32 +00:00
parent 775deefeaa
commit 08ab2d89f4

View File

@ -60,6 +60,7 @@ extern "C" {
#define NETCONNTYPE_DATAGRAM(t) (t&0xE0)
enum netconn_type {
NETCONN_INVALID = 0,
/* NETCONN_TCP Group */
NETCONN_TCP = 0x10,
/* NETCONN_UDP Group */
@ -145,10 +146,8 @@ void netbuf_copy_partial(struct netbuf *buf, void *dataptr,
#define netbuf_fromport(buf) ((buf)->port)
/* Network connection functions: */
struct netconn * netconn_new (enum netconn_type type);
struct
netconn *netconn_new_with_callback(enum netconn_type t,
void (*callback)(struct netconn *, enum netconn_evt, u16_t len));
#define netconn_new(t) netconn_new_with_proto_and_callback(t, 0, NULL)
#define netconn_new_with_callback(t, c) netconn_new_with_proto_and_callback(t, 0, c)
struct
netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto,
void (*callback)(struct netconn *, enum netconn_evt, u16_t len));
@ -186,7 +185,7 @@ err_t netconn_join_leave_group (struct netconn *conn,
enum netconn_igmp join_or_leave);
#endif /* LWIP_IGMP */
err_t netconn_err (struct netconn *conn);
#define netconn_err(conn) ((conn)->err)
#ifdef __cplusplus
}