Hi, thank you for tip. I have to define my own error with positive value. Currently, I am using a macro netconn_err that sets error to ERR_OK before every transmitt, netconn_err(conn) = ERR_OK. I do not think, that a) and b) is a good solution, but it works.
Martin 2009/10/6 Kieran Mansley <kie...@recoil.org>: > On Tue, 2009-10-06 at 14:17 +0200, Martin Velek wrote: >> Hello, >> >> my EMAC driver is capable to detect link down(unplugging eth. cable). >> This situation is returned in low_level_output by ERR_IF and >> netif->flags &= ~NETIF_FLAG_LINK_UP. This is a normal behavior, >> netconn_sendto returns ERR_IF. >> >> However after plugging cable and sending next packet, this operation >> fails also with ERR_IF. I have tried to trace programm and this is a >> sequence of called functions: >> >> netconn_sendto >> netconn_send >> do_send - return. >> >> The first line of do_send function contains "if >> (!ERR_IS_FATAL(msg->conn->err)) " that causes return without checking >> the line status. >> >> Does it mean, that before any netconn_sendto I should set conn->err to >> ERR_OK? > > ERR_IF is deemed to be a fatal error: one from which the connection > cannot recover. Clearly in your case this is wrong: unplugging and > replugging the cable is not a permanent state so not a fatal error. > What we probably need to do is split ERR_IF into two: one to describe > fatal errors such as not being able to add the netif, and another > describing transient errors such as the link going down. Your > low_level_output could then return whichever of these is appropriate. > > On a related note, does anyone know why ERR_INPROGRESS is fatal? I > don't think it should be. > > Kieran > > > > _______________________________________________ > lwip-users mailing list > lwip-users@nongnu.org > http://lists.nongnu.org/mailman/listinfo/lwip-users > _______________________________________________ lwip-users mailing list lwip-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/lwip-users