lwIP Wiki
Advertisement

netconn_new[]

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_callback[]

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 []

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 Do[]

  • explain the use of callback function including parameters.



(last changed: 24.05.2011)

Advertisement