[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] LWIP_DEBUGF
From: |
Bernhard 'Gustl' Bauer |
Subject: |
[lwip-users] LWIP_DEBUGF |
Date: |
Tue, 21 Jul 2009 09:17:50 +0200 |
User-agent: |
Thunderbird 2.0.0.22 (Windows/20090605) |
Hi,
I cannot use a printf for the output. The only possibility for me is to
use sprintf and write it to a part in the memory.
LWIP_DEBUGF is often used to get some variables along. So there a
brackets () around the printf part:
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
("dhcp_start(netif=%p) %c%c%"U16_F"\n", (void*)netif,
netif->name[0], netif->name[1], (u16_t)netif->num));
To use this with sprintf I have to get a string pointer inside the
brackets. I added a '#define LWIP_DEBUG_F str_ptr,' and changed all
LWIP_DEBUGF similar to this:
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, (LWIP_DEBUG_F
"dhcp_start(netif=%p) %c%c%"U16_F"\n", (void*)netif,
netif->name[0], netif->name[1], (u16_t)netif->num));
Is there any better way to do this? I like to avoid all the changes I
have to do every time I change LWIP version.
TIA
Gustl
- [lwip-users] LWIP_DEBUGF,
Bernhard 'Gustl' Bauer <=