diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-26 17:52:06 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-26 17:52:06 +0000 |
commit | 87f624cb9d7f647560fa4249a8d22d04846c0748 (patch) | |
tree | c9cbdd3d57c383e3aa2d73af2e8708cba59e0ed9 /apps/examples/wlan/wlan_main.c | |
parent | bb7c3ee83d66d1f9cc5d2dc984b824d4db18e56c (diff) | |
download | px4-nuttx-87f624cb9d7f647560fa4249a8d22d04846c0748.tar.gz px4-nuttx-87f624cb9d7f647560fa4249a8d22d04846c0748.tar.bz2 px4-nuttx-87f624cb9d7f647560fa4249a8d22d04846c0748.zip |
RTL bug fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3421 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/wlan/wlan_main.c')
-rwxr-xr-x | apps/examples/wlan/wlan_main.c | 50 |
1 files changed, 4 insertions, 46 deletions
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; |