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: address@hidden
Subject: Re: [lwip-users] CVS WINDOWS project could not pass compile
Date: Mon, 07 Dec 2009 14:39:56 +0100
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

Funny thing: I'm currently working on exactly the same code :-) I'll check it in as soon as it's running.

Simon


yueyue papa 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 <mailto:address@hidden> <address@hidden <mailto: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 <mailto:address@hidden>
    http://lists.nongnu.org/mailman/listinfo/lwip-users


------------------------------------------------------------------------

_______________________________________________
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]