Thanks very very much for the advice. So I will first try to make it run
in my PC... I am starting a new thread for that
Alain
yueyue papa escreveu:
Default windows platform is a PPP sample. Only sio_xxx needs to be
provided.
5 sio_xxxx need to provided.
sio_fd_t sio_open(u8_t num)
{
int id = num;
printf("sio open for %d,%d,%x\r\n",id,num,(unsigned
int)ppp_sio_opt_table[gModuleType].open);
//ppp_sio_opt_table[gModuleType].handle =
ppp_sio_opt_table[gModuleType].open(id);
ppp_sio_opt_table[gModuleType].handle = lwip_modem_open(id);
return ppp_sio_opt_table[gModuleType].handle;
}
u32_t sio_read(sio_fd_t fd, u8_t * ucData, u32_t len)
{
s32_t readLen=0;
int timeout=1000;
readLen = ppp_sio_opt_table[gModuleType].read(fd, ucData, len,timeout);
return readLen;
}
u32_t sio_write(sio_fd_t fd, u8_t * ucData, u32_t len)
{
u32_t i;
i = ppp_sio_opt_table[gModuleType].write(fd,ucData,len,100);
return i;
}
void sio_read_abort(sio_fd_t fd)
{
ppp_sio_opt_table[gModuleType].readCancel(fd);
}
void sio_close(sio_fd_t fd)
{
ppp_sio_opt_table[gModuleType].close(fd);
}
These two are only used for slip.
/**
* Write a char to output data stream
* @param num char to write to output stream
* @param psio struct, contains sio instance data, given by sio_open
*/
void sio_send(u8_t num, sio_fd_t psio)
{
return;
}
/**
* Read a char from incoming data stream, this call blocks until data
has arrived
* @param psio siostatus struct, contains sio instance data, given by
sio_open
* @return char read from input stream
*/
u8_t sio_recv(sio_fd_t psio)
{
return 0;
}
My windows PPP working envrionement is create on the our embedded OS
windows simulator. So my sample is no useful for normal user.
Write the 5 sio_xxx is not difficult. Based on windows sample test
code, the PPP could running in windows if you atteched a modem in
windows com port.
On 12/2/08, *Alain M.* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
wrote:
Hi,
Do you (or anyone) have some example for PPP ???
AAMOF I couldn't find examples for lwip at all, where am I suposed
to look for it?
I intend to make PPP work first on a normal modem as a first test,
then use it fot GPRS too...
Thanks for any help,
Alain
yueyue papa escreveu:
Hi All,
I am using the lwIP + PPP on GPRS module.
I tried to following feature. The PPP will begins to open
only if there is valid socket requirement.
eg: There is socket connect, or socket listen.
Is there any suggestion for how to make a elegant implement?
I tried to add the code in api_msg.c.
Lee
_______________________________________________
lwip-users mailing list
[email protected] <mailto:[email protected]>
http://lists.nongnu.org/mailman/listinfo/lwip-users
------------------------------------------------------------------------
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users