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 mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to