Added the MAC layer callback functionality so that the Rime network layer gets information from the MAC about the status of sent packets: were they successfully transmitted, or was there a collisions? How many retries were there?

This commit is contained in:
adamdunkels 2010-02-23 18:38:05 +00:00
parent f10eedab3e
commit ca0417a923
11 changed files with 126 additions and 44 deletions

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: ipolite.c,v 1.16 2010/01/25 13:54:06 adamdunkels Exp $
* $Id: ipolite.c,v 1.17 2010/02/23 18:38:05 adamdunkels Exp $
*/
/**
@ -90,6 +90,12 @@ recv(struct broadcast_conn *broadcast, const rimeaddr_t *from)
if(c->cb->recv) {
c->cb->recv(c, from);
}
}
/*---------------------------------------------------------------------------*/
static void
sent(struct broadcast_conn *bc, int status, int num_tx)
{
}
/*---------------------------------------------------------------------------*/
static void
@ -112,7 +118,7 @@ send(void *ptr)
}
}
/*---------------------------------------------------------------------------*/
static const struct broadcast_callbacks broadcast = { recv };
static const struct broadcast_callbacks broadcast = { recv, sent };
/*---------------------------------------------------------------------------*/
void
ipolite_open(struct ipolite_conn *c, uint16_t channel, uint8_t dups,