Change TCPIP INPKT API message to take a function pointer. Allows integration of other protocols without extending lwIP core (e.g. 6LoWPAN)

Remove unused sem member of struct tcpip_msg
This commit is contained in:
Dirk Ziegelmeier 2016-02-22 17:39:01 +01:00
parent 17fad79f71
commit 439ae629e0
2 changed files with 8 additions and 1 deletions

View File

@ -132,6 +132,12 @@ extern sys_mutex_t lock_tcpip_core;
#define API_EXPR_DEREF(expr) *(expr)
#endif /* LWIP_MPU_COMPATIBLE */
/** Function prototype for input functions functions.
*
* @param p The received packet, copied into a pbuf
* @param inp The netif which received the packet
*/
typedef err_t (*tcpip_inpkt_fn)(struct pbuf *p, struct netif *inp);
#if LWIP_NETCONN || LWIP_SOCKET
err_t tcpip_apimsg(struct api_msg *apimsg);
@ -180,7 +186,6 @@ enum tcpip_msg_type {
struct tcpip_msg {
enum tcpip_msg_type type;
sys_sem_t *sem;
union {
#if LWIP_NETCONN || LWIP_SOCKET
struct api_msg *apimsg;
@ -194,6 +199,7 @@ struct tcpip_msg {
struct {
struct pbuf *p;
struct netif *netif;
tcpip_inpkt_fn input_fn;
} inp;
struct {
tcpip_callback_fn function;

View File

@ -37,6 +37,7 @@
#if !NO_SYS /* don't build if not configured for use in lwipopts.h */
#include "lwip/err.h"
#include "lwip/timers.h"
#ifdef __cplusplus
extern "C" {