UPdated to latest hc.c API

This commit is contained in:
adamdunkels 2006-10-09 11:56:49 +00:00
parent 5e98ede3a3
commit 5a5b964b2e
2 changed files with 14 additions and 7 deletions

View file

@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: ethernode-drv.c,v 1.2 2006/10/06 08:25:31 adamdunkels Exp $
* $Id: ethernode-drv.c,v 1.3 2006/10/09 11:56:49 adamdunkels Exp $
*/
#include "contiki.h"
@ -50,7 +50,7 @@ enum { NULLEVENT };
u8_t
ethernode_drv_send(void)
{
uip_len = hc_compress();
uip_len = hc_compress(&uip_buf[UIP_LLH_LEN], uip_len);
return ethernode_send();
}
@ -73,9 +73,16 @@ PROCESS_THREAD(ethernode_drv_process, ev, data)
/* if((random_rand() % drop) <= drop / 2) {
printf("Bropp\n");
} else*/ {
uip_len = hc_inflate();
uip_len = hc_inflate(&uip_buf[UIP_LLH_LEN], uip_len);
{
char buf[40];
tcpdump_format(&uip_buf[UIP_LLH_LEN], uip_len, buf, sizeof(buf));
printf("radio_sniffer: packet length %d, %s\n", uip_len, buf);
}
tapdev_send_raw();
/* if(uip_fw_forward() == UIP_FW_LOCAL)*/ {
/* A frame was avaliable (and is now read into the uip_buf), so