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.