Fandom

lwIP Wiki

Netconn new

91pages on
this wiki
Add New Page
Talk0 Share

netconn_newEdit

struct netconn * netconn_new ( enum netconn_type t ) ;

This is just a macro expanding to "netconn_new_with_proto_and_callback ( t, 0, NULL )" (See below)


netconn_new_with_callbackEdit

struct netconn * netconn_new_with_callback ( enum netconn_type t, 
                                             netconn_callback callback );


This is just a macro expanding to netconn_new_with_proto_and_callback ( t, 0, callback ). (See below)

netconn_new_with_proto_and_callback Edit

struct netconn * netconn_new_with_proto_and_callback (
                                                  enum netconn_type t, 
                                                  u8_t proto,              
                                                  netconn_callback callback );

Allocate a new netconn structure and initialize it to default values.

Parameter t is one of

  • NETCONN_TCP
  • NETCONN_UDP
  • NETCONN_UDPLITE
  • NETCONN_UDPNOCHKSUM
  • NETCONN_RAW

where NETCONN_TCP and NETCONN_UDP are the most common.

Parameter proto specifies the protocol number of IPs payload (e.g. IP_PROTO_ICMP) when creating NETCONN_RAW connections.

Parameter callback defines a callback routine of the form

typedef void (*netconn_callback)(struct netconn *,enum netconn_evt,u16_t len);

where netconn_evt is either of

  • NETCONN_EVT_RCVPLUS
  • NETCONN_EVT_RCVMINUS
  • NETCONN_EVT_SENDPLUS
  • NETCONN_EVT_SENDMINUS
  • NETCONN_EVT_ERROR

To DoEdit

  • explain the use of callback function including parameters



(last changed: 24.05.2011)

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.