lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] CVS WINDOWS project could not pass compile


From: yueyue papa
Subject: Re: [lwip-users] CVS WINDOWS project could not pass compile
Date: Mon, 7 Dec 2009 21:01:21 +0800

I also remember there is a
 
send_and_wait
 
function before, but I could not find the API now.
 
I adjusted send_and_wait, but find the API is not exits in current project.  May be I am wrong.

On Mon, Dec 7, 2009 at 8:48 PM, yueyue papa <address@hidden> wrote:
thanks.
 
I think sio.c for windows version needs to be adjusted.
 
PPP pull sio_read, and sio_write, the sio_read could not be blocked if there is no data. If blocked, the PPP could not work.
 
if  SIO_USE_COMPORT  is enabled,  the timeout needs to set, so do not let ReadFile block .
 
Followinng is my code.
##################
sio_fd_t sio_open(u8_t devnum)
{
  HANDLE hPipe = INVALID_HANDLE_VALUE;
  CHAR   szPipeName[256];
  LWIP_DEBUGF(SIO_DEBUG, ("sio_open(%lu)\n", (DWORD)devnum));
  sprintf(szPipeName, SIO_DEVICENAME"%lu", (DWORD)(devnum));
  hPipe = CreateFile(szPipeName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
  if (hPipe != INVALID_HANDLE_VALUE) {
    HANDLE hCom = (HANDLE)hPipe;
    DCB dcb;
 int n, rc;
 char cmpBuf[128];
 COMMTIMEOUTS CommTimeOuts;
 GetCommTimeouts( hCom, &CommTimeOuts );
 CommTimeOuts.ReadIntervalTimeout = 1;
 CommTimeOuts.ReadTotalTimeoutMultiplier = 0;
 CommTimeOuts.ReadTotalTimeoutConstant = 100;
 CommTimeOuts.WriteTotalTimeoutMultiplier = 0;
 CommTimeOuts.WriteTotalTimeoutConstant = 0;
 SetCommTimeouts( hCom, &CommTimeOuts );
 if (!GetCommState(hCom, &dcb)) {
  return NULL;
 }
   
 dcb.BaudRate = 57600;
 dcb.ByteSize = 8;
 dcb.StopBits = 0;
 //dcb.Parity = EVENPARITY;  ODDPARITY
 if (!SetCommState(hCom, &dcb)) {
  return NULL;
...
 }
##################
With this adjusted, the PPP SIO could pull data from windows COM port, and different devices could be tesed with lwIP+ PPP.
 
 
Lee
On Mon, Dec 7, 2009 at 3:36 PM, address@hidden <address@hidden> wrote:
yueyue papa wrote:
thanks, the previous problem is solved.

Another trivial problem is

PPP is configered as mutual exclude as LAN feature.  In fact, this requirement is not correct. LwIP could support both.
I know that both PPP *and* ethernet may be used at the same time. However, modifying the port to do that is a simple thing for anyone who wants to.
[..]

       ethernetif_poll(&netif);    <<==== still use LAN feature.
[..]
compile error happened.
Fixed, thanks.

Simon



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]