Trivial changes from review of last PR

This commit is contained in:
Gregory Nutt 2016-06-11 07:36:45 -06:00
parent da42efa545
commit 8f0e214772

View File

@ -42,20 +42,21 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/ioctl.h"
#include <sys/socket.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <fcntl.h> #include <fcntl.h>
#include <pthread.h> #include <pthread.h>
#include <poll.h> #include <poll.h>
#include <termios.h>
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <debug.h> #include <debug.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include "sys/ioctl.h"
#include "sys/socket.h"
#include "termios.h"
#include "apps/netutils/esp8266.h" #include "apps/netutils/esp8266.h"
@ -178,24 +179,25 @@ static int lesp_set_baudrate(int baudrate)
{ {
struct termios term; struct termios term;
if ( ioctl(g_lesp_state.fd,TCGETS,(unsigned long)&term) < 0 ) if (ioctl(g_lesp_state.fd,TCGETS,(unsigned long)&term) < 0)
{ {
ndbg("TCGETS failed.\n"); ndbg("TCGETS failed.\n");
return -1; return -1;
} }
if ( ( cfsetispeed( &term, baudrate ) < 0 ) || if ((cfsetispeed(&term, baudrate) < 0) ||
( cfsetospeed( &term, baudrate ) < 0 ) ) (cfsetospeed(&term, baudrate) < 0))
{ {
ndbg("Connot set baudrate %0x08X\n",baudrate); ndbg("Connot set baudrate %0x08X\n",baudrate);
return -1; return -1;
} }
if ( ioctl(g_lesp_state.fd,TCSETS,(unsigned long)&term) < 0 ) if (ioctl(g_lesp_state.fd,TCSETS,(unsigned long)&term) < 0)
{ {
ndbg("TCSETS failed.\n"); ndbg("TCSETS failed.\n");
return -1; return -1;
} }
return 0; return 0;
} }
@ -257,7 +259,7 @@ static int lesp_low_level_read(uint8_t* buf, int size)
struct pollfd fds[1]; struct pollfd fds[1];
memset(fds, 0, sizeof( struct pollfd)); memset(fds, 0, sizeof(struct pollfd));
fds[0].fd = g_lesp_state.fd; fds[0].fd = g_lesp_state.fd;
fds[0].events = POLLIN; fds[0].events = POLLIN;
@ -723,7 +725,7 @@ static int lesp_parse_cwlap_ans_line(char* ptr, lesp_ap_t *ap)
case 2: case 2:
ptr++; /* Remove first '"' */ ptr++; /* Remove first '"' */
*(ptr_next -1 ) = '\0'; *(ptr_next - 1) = '\0';
ap->ssid = ptr; ap->ssid = ptr;
break; break;