Debug output
This commit is contained in:
parent
576cb01fb4
commit
2f079ca8e2
7 changed files with 84 additions and 28 deletions
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* \addtogroup rime-ibc
|
||||
* \addtogroup rimeibc
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: ibc.c,v 1.8 2007/03/25 12:05:51 adamdunkels Exp $
|
||||
* $Id: ibc.c,v 1.9 2007/03/29 23:18:22 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -51,6 +51,14 @@ struct ibc_hdr {
|
|||
rimeaddr_t sender;
|
||||
};
|
||||
|
||||
#define DEBUG 0
|
||||
#if DEBUG
|
||||
#include <stdio.h>
|
||||
#define PRINTF(...) printf(__VA_ARGS__)
|
||||
#else
|
||||
#define PRINTF(...)
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
recv_from_abc(struct abc_conn *bc)
|
||||
|
@ -62,7 +70,7 @@ recv_from_abc(struct abc_conn *bc)
|
|||
rimeaddr_copy(&sender, &hdr->sender);
|
||||
|
||||
rimebuf_hdrreduce(sizeof(struct ibc_hdr));
|
||||
DEBUGF(1, "%d: ibc: recv_from_bc\n", rimeaddr_node_addr.u16);
|
||||
PRINTF("%d: ibc: recv_from_bc\n", rimeaddr_node_addr.u16);
|
||||
c->u->recv(c, &sender);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -85,7 +93,7 @@ ibc_close(struct ibc_conn *c)
|
|||
int
|
||||
ibc_send(struct ibc_conn *c)
|
||||
{
|
||||
DEBUGF(1, "%d: ibc_send\n", rimeaddr_node_addr.u16);
|
||||
PRINTF("%d: ibc_send\n", rimeaddr_node_addr.u16);
|
||||
if(rimebuf_hdralloc(sizeof(struct ibc_hdr))) {
|
||||
struct ibc_hdr *hdr = rimebuf_hdrptr();
|
||||
rimeaddr_copy(&hdr->sender, &rimeaddr_node_addr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue