From 87f624cb9d7f647560fa4249a8d22d04846c0748 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 26 Mar 2011 17:52:06 +0000 Subject: RTL bug fixes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3421 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/wlan/wlan_main.c | 50 ++++-------------------------------------- 1 file changed, 4 insertions(+), 46 deletions(-) (limited to 'apps') diff --git a/apps/examples/wlan/wlan_main.c b/apps/examples/wlan/wlan_main.c index 9bfb78fa7..fd1bd9322 100755 --- a/apps/examples/wlan/wlan_main.c +++ b/apps/examples/wlan/wlan_main.c @@ -81,7 +81,7 @@ #endif #ifndef CONFIG_EXAMPLES_WLAN_DEVNAME -# define CONFIG_EXAMPLES_WLAN_DEVNAME "/dev/wlana" +# define CONFIG_EXAMPLES_WLAN_DEVNAME "wlan0" #endif /**************************************************************************** @@ -155,10 +155,7 @@ void user_initialize(void) int user_start(int argc, char *argv[]) { - char buffer[256]; pid_t pid; - ssize_t nbytes; - int fd; int ret; /* First, register all of the USB host Wireless LAN drivers */ @@ -189,51 +186,12 @@ int user_start(int argc, char *argv[]) (main_t)wlan_waiter, (const char **)NULL); #endif - /* Now just sleep. Eventually logic here will open the WLAN device and - * perform the device test. - */ + /* Now just sleep. Eventually logic here will perform the device test. */ for (;;) { - /* Open the WLAN device. Loop until the device is successfully - * opened. - */ - - do - { - printf("Opening device %s\n", CONFIG_EXAMPLES_WLAN_DEVNAME); - fd = open(CONFIG_EXAMPLES_WLAN_DEVNAME, O_RDONLY); - if (fd < 0) - { - printf("Failed: %d\n", errno); - fflush(stdout); - sleep(3); - } - } - while (fd < 0); - - printf("Device %s opened\n", CONFIG_EXAMPLES_WLAN_DEVNAME); - fflush(stdout); - - /* Loop until there is a read failure */ - - do - { - /* Read a buffer of data */ - - nbytes = read(fd, buffer, 256); - if (nbytes > 0) - { - /* On success, echo the buffer to stdout */ - - (void)write(1, buffer, nbytes); - } - } - while (nbytes >= 0); - - printf("Closing device %s: %d\n", CONFIG_EXAMPLES_WLAN_DEVNAME, (int)nbytes); - fflush(stdout); - close(fd); + sleep(5); + printf("usert_start: Still alive\n"); } } return 0; -- cgit v1.2.3