diff --git a/core/net/sicslowpan.c b/core/net/sicslowpan.c index 608113c0e..4da7885e7 100644 --- a/core/net/sicslowpan.c +++ b/core/net/sicslowpan.c @@ -32,7 +32,7 @@ * * This file is part of the Contiki operating system. * - * $Id: sicslowpan.c,v 1.24 2010/03/09 20:40:50 adamdunkels Exp $ + * $Id: sicslowpan.c,v 1.25 2010/03/12 13:20:13 nvt-se Exp $ */ /** * \file @@ -288,6 +288,17 @@ addr_context_lookup_by_number(u8_t number) { } return NULL; } +/*--------------------------------------------------------------------*/ + /** ++ * Callback function for the MAC packet sent callback ++ */ +static void +packet_sent(void *ptr, int status, int transmissions) +{ +#if SICSLOWPAN_CONF_NEIGHBOR_INFO + neighbor_info_packet_sent(status, transmissions); +#endif /* SICSLOWPAN_CONF_NEIGHBOR_INFO */ +} /*--------------------------------------------------------------------*/ /** * \brief Compress IP/UDP header @@ -1268,9 +1279,9 @@ send_packet(rimeaddr_t *dest) */ packetbuf_set_addr(PACKETBUF_ADDR_RECEIVER, dest); - /* XXX we should provide a callback function that is called when the - packet is sent. For now, we just supply a NULL pointer. */ - NETSTACK_MAC.send(NULL, NULL); + /* Provide a callback function to receive the result of + a packet transmission. */ + NETSTACK_MAC.send(&packet_sent, NULL); /* If we are sending multiple packets in a row, we need to let the watchdog know that we are still alive. */ @@ -1637,6 +1648,10 @@ input(void) } #endif +#if SICSLOWPAN_CONF_NEIGHBOR_INFO + neighbor_info_packet_received(); +#endif /* SICSLOWPAN_CONF_NEIGHBOR_INFO */ + tcpip_input(); #if SICSLOWPAN_CONF_FRAG }