diff --git a/ports/unix/include/netif/sio.h b/ports/unix/include/netif/sio.h index bbe6f3e..c1e8408 100644 --- a/ports/unix/include/netif/sio.h +++ b/ports/unix/include/netif/sio.h @@ -78,5 +78,29 @@ sio_status_t * sio_open( int devnum ); */ void sio_change_baud( sioBaudrates baud, sio_status_t * siostat ); +#if PPP_SUPPORT +/** +* Write buffer to serial port +* @param siostat siostatus struct, contains sio instance data, given by sio_open +* @param buf output buffer +* @param size output buffer size +*/ +u32_t sio_write(sio_status_t * siostat, u8_t *buf, u32_t size); + +/** +* Read buffer from serial port +* @param siostat siostatus struct, contains sio instance data, given by sio_open +* @param buf input buffer +* @param size input buffer size +*/ +u32_t sio_read(sio_status_t * siostat, u8_t *buf, u32_t size); + +/** +* Flush serial port input buffer +* @param siostat siostatus struct, contains sio instance data, given by sio_open +*/ +void sio_read_abort(sio_status_t * siostat); +#endif /* PPP_SUPPORT */ + #endif diff --git a/ports/unix/netif/sio.c b/ports/unix/netif/sio.c index fbc80a2..31476ea 100644 --- a/ports/unix/netif/sio.c +++ b/ports/unix/netif/sio.c @@ -99,6 +99,7 @@ static int sio_init( char * device, int devnum, sio_status_t * siostat ) #endif int fd; LWIP_UNUSED_ARG(siostat); + LWIP_UNUSED_ARG(devnum); /* open the device to be non-blocking (read will return immediately) */ fd = open( device, O_RDWR | O_NOCTTY | O_NONBLOCK ); @@ -278,6 +279,7 @@ u32_t sio_read(sio_status_t * siostat, u8_t *buf, u32_t size) void sio_read_abort(sio_status_t * siostat) { + LWIP_UNUSED_ARG(siostat); printf("sio_read_abort: not yet implemented for unix\n"); } #endif /* PPP_SUPPORT */ diff --git a/ports/unix/sys_arch.c b/ports/unix/sys_arch.c index 9bb1f59..3ccc4ad 100644 --- a/ports/unix/sys_arch.c +++ b/ports/unix/sys_arch.c @@ -580,18 +580,3 @@ sys_jiffies(void) usec /= 1000000L / HZ; return HZ * sec + usec; } - -#if PPP_DEBUG - -#include - -void ppp_trace(int level, const char *format, ...) -{ - va_list args; - - (void)level; - va_start(args, format); - vprintf(format, args); - va_end(args); -} -#endif