|
From: | yueyue papa |
Subject: | Re: [lwip-users] Auto PPP soltuion |
Date: | Tue, 2 Dec 2008 09:12:10 +0800 |
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;
}
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
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users
[Prev in Thread] | Current Thread | [Next in Thread] |