diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-03-11 18:47:04 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-03-11 18:47:04 -0600 |
commit | 4b160ee945b9dd9fed9d68950be36637b99c8769 (patch) | |
tree | 55322e2f0818bbdc82954164e33c263a9f046c4d /apps/netutils/pppd/chat.c | |
parent | 5e174d14c12a6b1a40248de055b6ff1e66e755b1 (diff) | |
download | px4-nuttx-4b160ee945b9dd9fed9d68950be36637b99c8769.tar.gz px4-nuttx-4b160ee945b9dd9fed9d68950be36637b99c8769.tar.bz2 px4-nuttx-4b160ee945b9dd9fed9d68950be36637b99c8769.zip |
Bringing PPPD yet closer to the NuttX coding style
Diffstat (limited to 'apps/netutils/pppd/chat.c')
-rw-r--r-- | apps/netutils/pppd/chat.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/netutils/pppd/chat.c b/apps/netutils/pppd/chat.c index ce900f478..e3120f647 100644 --- a/apps/netutils/pppd/chat.c +++ b/apps/netutils/pppd/chat.c @@ -54,6 +54,10 @@ * Private Functions ****************************************************************************/ +/**************************************************************************** + * Name: chat_read_byte + ****************************************************************************/ + static int chat_read_byte(int fd, char* c, int timeout) { int ret; @@ -80,12 +84,20 @@ static int chat_read_byte(int fd, char* c, int timeout) return 0; } +/**************************************************************************** + * Name: chat_flush + ****************************************************************************/ + static void chat_flush(int fd) { char tmp; while (chat_read_byte(fd, &tmp, 0) == 0); } +/**************************************************************************** + * Name: chat_check_response + ****************************************************************************/ + static int chat_check_response(int fd, const char* response, int timeout) { char c; @@ -119,6 +131,14 @@ static int chat_check_response(int fd, const char* response, int timeout) return 0; } +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: ppp_chat + ****************************************************************************/ + int ppp_chat(int fd, struct chat_script_s *script, int echo) { int ret; |