You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/08 08:44:38 UTC

[GitHub] [incubator-nuttx-apps] jerpelea opened a new pull request #1053: apps: update licenses to Apache

jerpelea opened a new pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053


   ## Summary
   Several contributors have submitted licenses and we can migrate the licenses to Apache
   
   ## Impact
   LICENSE
   
   ## Testing
   NONE
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] pkarashchenko commented on pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#issuecomment-1061781185


   Great work!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] pkarashchenko merged pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
pkarashchenko merged pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] jerpelea commented on pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
jerpelea commented on pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#issuecomment-1061601065


   please ignore the remaining errors


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#discussion_r821590403



##########
File path: examples/nxdemo/images.h
##########
@@ -48,10 +33,14 @@
 
 static uint8_t g_battery [] =

Review comment:
       ```suggestion
   static uint8_t g_battery[] =
   ```

##########
File path: examples/relays/relays_main.c
##########
@@ -125,15 +110,15 @@ int main(int argc, FAR char *argv[])
   if (optind == argc - 1)
     {
       stat = argv[optind];
-      set_stat = (!strcmp(stat,"on") || !strcmp(stat,"ON")) ? true : false ;
+      set_stat = (!strcmp(stat, "on") == 0 || !strcmp(stat, "ON")) == 0 ;

Review comment:
       ```suggestion
         set_stat = (strcmp(stat, "on") == 0 || strcmp(stat, "ON") == 0);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] jerpelea commented on a change in pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
jerpelea commented on a change in pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#discussion_r821653829



##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2672,8 +2673,10 @@ int lesp_setsockopt(int sockfd, int level, int option,
           case SO_RCVTIMEO:
               if (value_len == sizeof(struct timeval))
                 {
-                  sock->rcv_timeo.tv_sec = ((struct timeval *)(value))->tv_sec;
-                  sock->rcv_timeo.tv_nsec = ((struct timeval *)(value))->tv_usec;
+                  sock->rcv_timeo.tv_sec = ((struct timeval *)

Review comment:
       this is not a nxstyle change!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] jerpelea commented on a change in pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
jerpelea commented on a change in pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#discussion_r821588757



##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2672,8 +2673,10 @@ int lesp_setsockopt(int sockfd, int level, int option,
           case SO_RCVTIMEO:
               if (value_len == sizeof(struct timeval))
                 {
-                  sock->rcv_timeo.tv_sec = ((struct timeval *)(value))->tv_sec;
-                  sock->rcv_timeo.tv_nsec = ((struct timeval *)(value))->tv_usec;
+                  sock->rcv_timeo.tv_sec = ((struct timeval *)
+                                            (value))->tv_sec;
+                  sock->rcv_timeo.tv_nsec = ((struct timeval *)
+                                             (value))->tv_usec;

Review comment:
       there is no harm to keep the old code. we can refactor in another commit




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#discussion_r821514749



##########
File path: examples/netpkt/netpkt_main.c
##########
@@ -137,8 +122,23 @@ int main(int argc, FAR char *argv[])
   int rxc;
   uint8_t *buf;
   const int buflen = 128;
-  const char da[6] = {0xf0, 0xde, 0xf1, 0x02, 0x43, 0x01};
-  const char sa[6] = {0x00, 0xe0, 0xde, 0xad, 0xbe, 0xef};
+  const char da[6] = {
+                       0xf0,
+                       0xde,
+                       0xf1,
+                       0x02,
+                       0x43,
+                       0x01
+                     };
+
+  const char sa[6] = {
+                       0x00,
+                       0xe0,
+                       0xde,
+                       0xad,
+                       0xbe,
+                       0xef
+                     };

Review comment:
       ```suggestion
     const char da[6] =
       {
         0xf0, 0xde, 0xf1, 0x02, 0x43, 0x01
       };
   
     const char sa[6] =
       {
         0x00, 0xe0, 0xde, 0xad, 0xbe, 0xef
       };
   ```

##########
File path: examples/nxdemo/nxdemo_bkgd.c
##########
@@ -292,7 +278,7 @@ static void nxdemo_demo_1(NXWINDOW hwnd)
   center.x = g_nxdemo.xres >> 1;
   center.y = g_nxdemo.yres >> 1;
 
-  for (i = 0; i<MIN(g_nxdemo.xres, g_nxdemo.yres)>> 1; i++)
+  for (i = 0; i < MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1; i++)

Review comment:
       ```suggestion
     for (i = 0; i < (MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1); i++)
   ```

##########
File path: examples/relays/relays_main.c
##########
@@ -125,15 +110,16 @@ int main(int argc, FAR char *argv[])
   if (optind == argc - 1)
     {
       stat = argv[optind];
-      set_stat = (!strcmp(stat,"on") || !strcmp(stat,"ON")) ? true : false ;
+      set_stat = (!strcmp(stat, "on") ||
+                  !strcmp(stat, "ON")) ? true : false ;

Review comment:
       ```suggestion
         set_stat = (strcmp(stat, "on") == 0 || strcmp(stat, "ON") == 0);
   ```

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -1014,7 +1000,8 @@ static int lesp_parse_cipxxx_ans_line(const char *ptr, in_addr_t *ip)
  *   see in:
  *   https://room-15.github.io/blog/2015/03/26/esp8266-at-command-reference/
  *   or
- *   http://www.espressif.com/sites/default/files/documentation/4a-esp8266_at_instruction_set_en.pdf
+ *   http://www.espressif.com/sites/default/files/documentation/

Review comment:
       IMO we should keep links as a single line

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2284,7 +2281,8 @@ int lesp_bind(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
  *
  ****************************************************************************/
 
-int lesp_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
+int lesp_connect(int sockfd,
+                 FAR const struct sockaddr *addr, socklen_t addrlen)

Review comment:
       Minor
   ```suggestion
   int lesp_connect(int sockfd, FAR const struct sockaddr *addr,
                    socklen_t addrlen)
   ```

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2672,8 +2673,10 @@ int lesp_setsockopt(int sockfd, int level, int option,
           case SO_RCVTIMEO:
               if (value_len == sizeof(struct timeval))
                 {
-                  sock->rcv_timeo.tv_sec = ((struct timeval *)(value))->tv_sec;
-                  sock->rcv_timeo.tv_nsec = ((struct timeval *)(value))->tv_usec;
+                  sock->rcv_timeo.tv_sec = ((struct timeval *)
+                                            (value))->tv_sec;
+                  sock->rcv_timeo.tv_nsec = ((struct timeval *)
+                                             (value))->tv_usec;

Review comment:
       Maybe next will satisfy the style
   ```suggestion
                     sock->rcv_timeo.tv_sec = ((struct timeval *)value)->tv_sec;
                     sock->rcv_timeo.tv_nsec = ((struct timeval *)value)->tv_usec;
   ```

##########
File path: examples/nxdemo/nxdemo_bkgd.c
##########
@@ -350,7 +336,7 @@ static void nxdemo_demo_2(NXWINDOW hwnd)
   center.x = g_nxdemo.xres >> 1;
   center.y = g_nxdemo.yres >> 1;
 
-  for (i = 0; i<MIN(g_nxdemo.xres, g_nxdemo.yres)>> 1; i++)
+  for (i = 0; i < MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1; i++)

Review comment:
       ```suggestion
     for (i = 0; i < (MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1); i++)
   ```

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -1843,17 +1837,19 @@ int lesp_set_net(lesp_mode_t mode, in_addr_t ip, in_addr_t mask, in_addr_t gatew
 
   if (ret >= 0)
     {
-      ret = lesp_ask_ans_ok(lespTIMEOUT_MS, "AT+CIP%s_CUR=\"%d.%d.%d.%d\","
+      ret = lesp_ask_ans_ok(LESP_TIMEOUT_MS, "AT+CIP%s_CUR=\"%d.%d.%d.%d\","
                             "\"%d.%d.%d.%d\",\"%d.%d.%d.%d\"\r\n",
-                            (mode == lesp_eMODE_STATION)?"STA":"AP",
+                            (mode == LESP_MODE_STATION)?"STA":"AP",

Review comment:
       ```suggestion
                               (mode == LESP_MODE_STATION) ? "STA" : "AP",
   ```

##########
File path: examples/lvgldemo/tp_cal.h
##########
@@ -62,7 +47,7 @@ extern "C"
 void tp_cal_create(void);
 
 #ifdef __cplusplus
-} /* extern "C" */
-#endif
+}
+#endif  /* extern "C" */

Review comment:
       ```suggestion
   #endif
   ```
   as there is no such comment in other files

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2339,10 +2337,11 @@ int lesp_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
 
   if (ret >= 0)
     {
-      ret = lesp_ask_ans_ok(lespTIMEOUT_MS, "AT+CIPSTART=%d,\"%s\","
+      ret = lesp_ask_ans_ok(LESP_TIMEOUT_MS, "AT+CIPSTART=%d,\"%s\","
                             "\"%d.%d.%d.%d\",%d\r\n", sockfd, proto_str,
                             *((uint8_t *)&(ip)+0), *((uint8_t *)&(ip)+1),
-                            *((uint8_t *)&(ip)+2), *((uint8_t *)&(ip)+3), port);
+                            *((uint8_t *)&(ip)+2), *((uint8_t *)&(ip)+3),

Review comment:
       ```suggestion
                               *((uint8_t *)&ip + 2), *((uint8_t *)&ip + 3),
   ```

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2339,10 +2337,11 @@ int lesp_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
 
   if (ret >= 0)
     {
-      ret = lesp_ask_ans_ok(lespTIMEOUT_MS, "AT+CIPSTART=%d,\"%s\","
+      ret = lesp_ask_ans_ok(LESP_TIMEOUT_MS, "AT+CIPSTART=%d,\"%s\","
                             "\"%d.%d.%d.%d\",%d\r\n", sockfd, proto_str,
                             *((uint8_t *)&(ip)+0), *((uint8_t *)&(ip)+1),

Review comment:
       ```suggestion
                               *((uint8_t *)&ip + 0), *((uint8_t *)&ip + 1),
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] jerpelea commented on a change in pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
jerpelea commented on a change in pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#discussion_r821583703



##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2672,8 +2673,10 @@ int lesp_setsockopt(int sockfd, int level, int option,
           case SO_RCVTIMEO:
               if (value_len == sizeof(struct timeval))
                 {
-                  sock->rcv_timeo.tv_sec = ((struct timeval *)(value))->tv_sec;
-                  sock->rcv_timeo.tv_nsec = ((struct timeval *)(value))->tv_usec;
+                  sock->rcv_timeo.tv_sec = ((struct timeval *)
+                                            (value))->tv_sec;
+                  sock->rcv_timeo.tv_nsec = ((struct timeval *)
+                                             (value))->tv_usec;

Review comment:
       the remaining errors are "mixed case"




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#discussion_r821662718



##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2672,8 +2673,10 @@ int lesp_setsockopt(int sockfd, int level, int option,
           case SO_RCVTIMEO:
               if (value_len == sizeof(struct timeval))
                 {
-                  sock->rcv_timeo.tv_sec = ((struct timeval *)(value))->tv_sec;
-                  sock->rcv_timeo.tv_nsec = ((struct timeval *)(value))->tv_usec;
+                  sock->rcv_timeo.tv_sec = ((struct timeval *)

Review comment:
       Ok. Let's keep it as is. Np.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#discussion_r821514749



##########
File path: examples/netpkt/netpkt_main.c
##########
@@ -137,8 +122,23 @@ int main(int argc, FAR char *argv[])
   int rxc;
   uint8_t *buf;
   const int buflen = 128;
-  const char da[6] = {0xf0, 0xde, 0xf1, 0x02, 0x43, 0x01};
-  const char sa[6] = {0x00, 0xe0, 0xde, 0xad, 0xbe, 0xef};
+  const char da[6] = {
+                       0xf0,
+                       0xde,
+                       0xf1,
+                       0x02,
+                       0x43,
+                       0x01
+                     };
+
+  const char sa[6] = {
+                       0x00,
+                       0xe0,
+                       0xde,
+                       0xad,
+                       0xbe,
+                       0xef
+                     };

Review comment:
       ```suggestion
     const char da[6] =
     {
       0xf0, 0xde, 0xf1, 0x02, 0x43, 0x01
     };
   
     const char sa[6] =
     {
       0x00, 0xe0, 0xde, 0xad, 0xbe, 0xef
     };
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] jerpelea commented on a change in pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
jerpelea commented on a change in pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#discussion_r821588757



##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2672,8 +2673,10 @@ int lesp_setsockopt(int sockfd, int level, int option,
           case SO_RCVTIMEO:
               if (value_len == sizeof(struct timeval))
                 {
-                  sock->rcv_timeo.tv_sec = ((struct timeval *)(value))->tv_sec;
-                  sock->rcv_timeo.tv_nsec = ((struct timeval *)(value))->tv_usec;
+                  sock->rcv_timeo.tv_sec = ((struct timeval *)
+                                            (value))->tv_sec;
+                  sock->rcv_timeo.tv_nsec = ((struct timeval *)
+                                             (value))->tv_usec;

Review comment:
       There is no harm to keep the old code. We can refactor in another commit




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#discussion_r821621983



##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2672,8 +2673,10 @@ int lesp_setsockopt(int sockfd, int level, int option,
           case SO_RCVTIMEO:
               if (value_len == sizeof(struct timeval))
                 {
-                  sock->rcv_timeo.tv_sec = ((struct timeval *)(value))->tv_sec;
-                  sock->rcv_timeo.tv_nsec = ((struct timeval *)(value))->tv_usec;
+                  sock->rcv_timeo.tv_sec = ((struct timeval *)

Review comment:
       maybe adding a temp variable can be an option here instead.
   ```
   struct timeval *tv = (struct timeval *)value;
   sock->rcv_timeo.tv_sec = tv->tv_sec;
   sock->rcv_timeo.tv_nsec = tv->tv_usec;
   ```

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2478,7 +2478,8 @@ ssize_t lesp_send(int sockfd, FAR const uint8_t *buf, size_t len, int flags)
 
   if (ret >= 0)
     {
-      ret = lesp_ask_ans_ok(lespTIMEOUT_MS, "AT+CIPSEND=%d,%d\r\n", sockfd, len);
+      ret = lesp_ask_ans_ok(LESP_TIMEOUT_MS,
+                            "AT+CIPSEND=%d,%d\r\n", sockfd, len);

Review comment:
       Is this an option here?
   ```suggestion
         ret = lesp_ask_ans_ok(LESP_TIMEOUT_MS, "AT+CIPSEND=%d,%d\r\n",
                               sockfd, len);
   ```

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -756,13 +737,14 @@ int lesp_read_ans_ok(int timeout_ms)
   int ret = 0;
   time_t end;
 
-  end = time(NULL) + (timeout_ms/1000) + lespTIMEOUT_FLOODING_OFFSET_S;
+  end = time(NULL) + (timeout_ms / 1000) +
+        LESP_TIMEOUT_FLOODING_OFFSET_S;
 
-  while (g_lesp_state.and != lesp_eOK)
+  while (g_lesp_state.and != LESP_OK)
     {
       ret = lesp_read(timeout_ms);
 
-      if ((ret < 0) || (g_lesp_state.and == lesp_eERR) || \
+      if ((ret < 0) || (g_lesp_state.and == LESP_ERR) || \

Review comment:
       ```suggestion
         if ((ret < 0) || (g_lesp_state.and == LESP_ERR) ||
   ```

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -1295,16 +1282,16 @@ static void *lesp_worker(void *args)
                 {
                   if (strcmp(worker->rxbuf, "OK") == 0)
                     {
-                      worker->and = lesp_eOK;
+                      worker->and = LESP_OK;
                     }
                   else if ((strcmp(worker->rxbuf, "FAIL") == 0) ||
                            (strcmp(worker->rxbuf, "ERROR") == 0)
                           )

Review comment:
       ```suggestion
                     else if ((strcmp(worker->rxbuf, "FAIL") == 0) ||
                              (strcmp(worker->rxbuf, "ERROR") == 0))
   ```

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -756,13 +737,14 @@ int lesp_read_ans_ok(int timeout_ms)
   int ret = 0;
   time_t end;
 
-  end = time(NULL) + (timeout_ms/1000) + lespTIMEOUT_FLOODING_OFFSET_S;
+  end = time(NULL) + (timeout_ms / 1000) +
+        LESP_TIMEOUT_FLOODING_OFFSET_S;
 
-  while (g_lesp_state.and != lesp_eOK)
+  while (g_lesp_state.and != LESP_OK)
     {
       ret = lesp_read(timeout_ms);
 
-      if ((ret < 0) || (g_lesp_state.and == lesp_eERR) || \
+      if ((ret < 0) || (g_lesp_state.and == LESP_ERR) || \
            (time(NULL) > end))

Review comment:
       ```suggestion
             (time(NULL) > end))
   ```

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -1891,7 +1887,7 @@ int lesp_set_dhcp(lesp_mode_t mode, bool enable)
 
   if (ret >= 0)
     {
-      ret = lesp_ask_ans_ok(lespTIMEOUT_MS, "AT+CWDHCP_CUR=%d,%c\r\n",
+      ret = lesp_ask_ans_ok(LESP_TIMEOUT_MS, "AT+CWDHCP_CUR=%d,%c\r\n",
                             mode, (enable)?'1':'0');

Review comment:
       ```suggestion
                               mode, enable ? '1' : '0');
   ```

##########
File path: examples/nxdemo/nxdemo_main.c
##########
@@ -140,52 +126,53 @@ static inline int nxdemo_initialize(void)
   g_nxdemo.hnx = nx_connect();
   if (g_nxdemo.hnx)
     {
-       pthread_attr_t attr;
+      pthread_attr_t attr;
 
 #ifdef CONFIG_VNCSERVER
       /* Setup the VNC server to support keyboard/mouse inputs */
 
-       struct boardioc_vncstart_s vnc =
-       {
-         0,  g_nxdemo.hnx
-       };
-
-       ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
-       if (ret < 0)
-         {
-           printf("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
-           nx_disconnect(g_nxdemo.hnx);
-           return ERROR;
-         }
+      struct boardioc_vncstart_s vnc =
+        {
+           0,  g_nxdemo.hnx
+        };
+
+      ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
+      if (ret < 0)
+        {
+          printf("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
+          nx_disconnect(g_nxdemo.hnx);
+          return ERROR;
+        }
 #endif
 
-       /* Start a separate thread to listen for server events.  This is probably
-        * the least efficient way to do this, but it makes this example flow more
-        * smoothly.
-        */
-
-       pthread_attr_init(&attr);
-       param.sched_priority = CONFIG_EXAMPLES_NXDEMO_LISTENERPRIO;
-       pthread_attr_setschedparam(&attr, &param);
-       pthread_attr_setstacksize(&attr, CONFIG_EXAMPLES_NXDEMO_LISTENER_STACKSIZE);
-
-       ret = pthread_create(&thread, &attr, nxdemo_listener, NULL);
-       if (ret != 0)
-         {
-            printf("nxdemo_initialize: pthread_create failed: %d\n", ret);
-            return ERROR;
-         }
-
-       /* Don't return until we are connected to the server */
-
-       while (!g_nxdemo.connected)
-         {
-           /* Wait for the listener thread to wake us up when we really
-            * are connected.
-            */
-
-           sem_wait(&g_nxdemo.eventsem);
-         }
+      /* Start a separate thread to listen for server events.
+       * This is probably the least efficient way to do this,
+       * but it makes this example flow more smoothly.
+       */
+
+      pthread_attr_init(&attr);
+      param.sched_priority = CONFIG_EXAMPLES_NXDEMO_LISTENERPRIO;
+      pthread_attr_setschedparam(&attr, &param);
+      pthread_attr_setstacksize(&attr,
+                                 CONFIG_EXAMPLES_NXDEMO_LISTENER_STACKSIZE);

Review comment:
       ```suggestion
                                   CONFIG_EXAMPLES_NXDEMO_LISTENER_STACKSIZE);
   ```

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -1749,13 +1741,14 @@ int lesp_get_net(lesp_mode_t mode, in_addr_t *ip, in_addr_t *mask, in_addr_t *gw
   if (ret >= 0)
     {
       ret = lesp_send_cmd("AT+CIP%s_CUR?\r\n",
-                          (mode == lesp_eMODE_STATION)?"STA":"AP");
+                          (mode == LESP_MODE_STATION)?"STA":"AP");

Review comment:
       ```suggestion
                             (mode == LESP_MODE_STATION) ? "STA" : "AP");
   ```

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -86,22 +68,21 @@
 #define BUF_ANS_LEN     CONFIG_NETUTILS_ESP8266_MAXRXLEN
 #define BUF_WORKER_LEN  CONFIG_NETUTILS_ESP8266_WORKER_BUF_LEN
 
-
 #define CON_NBR 4
 
 #define ESP8266_ACCESS_POINT_NBR_MAX 32
 
-#define lespWAITING_OK_POLLING_MS   250
-#define lespTIMEOUT_FLUSH_MS        100
-#define lespTIMEOUT_MS              1000
-#define lespTIMEOUT_MS_SEND         1000
-#define lespTIMEOUT_MS_CONNECTION   30000
-#define lespTIMEOUT_MS_LISP_AP      5000
-#define lespTIMEOUT_FLOODING_OFFSET_S 3
-#define lespTIMEOUT_MS_RECV_S       60
+#define LESP_WAITING_OK_POLLING_MS   250
+#define LESP_TIMEOUT_FLUSH_MS        100
+#define LESP_TIMEOUT_MS              1000
+#define LESP_TIMEOUT_MS_SEND         1000
+#define LESP_TIMEOUT_MS_CONNECTION   30000
+#define LESP_TIMEOUT_MS_LISP_AP      5000
+#define LESP_TIMEOUT_FLOODING_OFFSET_S 3
+#define LESP_TIMEOUT_MS_RECV_S       60
 
-#define lespCON_USED_MASK(idx)      (1<<(idx))
-#define lespPOLLING_TIME_MS         1000
+#define LESP_CON_USED_MASK(idx)      (1<<(idx))
+#define LESP_POLLING_TIME_MS         1000

Review comment:
       can we add 2 spaces here to align with `LESP_TIMEOUT_FLOODING_OFFSET_S`?

##########
File path: examples/relays/relays_main.c
##########
@@ -125,15 +110,15 @@ int main(int argc, FAR char *argv[])
   if (optind == argc - 1)
     {
       stat = argv[optind];
-      set_stat = (!strcmp(stat,"on") || !strcmp(stat,"ON")) ? true : false ;
+      set_stat = (strcmp(stat, "on") == 0 || strcmp(stat, "ON") == 0) ;

Review comment:
       ```suggestion
         set_stat = (strcmp(stat, "on") == 0 || strcmp(stat, "ON") == 0);
   ```

##########
File path: netutils/esp8266/esp8266.c
##########
@@ -1323,13 +1310,14 @@ static void *lesp_worker(void *args)
 
                       /* ninfo("Worker Read data:%s\n", worker->rxbuf); */
 
-                      if (rxlen+1 <= BUF_ANS_LEN)
+                      if (rxlen + 1 <= BUF_ANS_LEN)
                         {
-                          memcpy(worker->buf, worker->rxbuf, rxlen+1);
+                          memcpy(worker->buf, worker->rxbuf, rxlen + 1);
                         }
                       else
                         {
-                          nerr("Worker and line is too long:%s\n", worker->rxbuf);
+                          nerr("Worker and line is too long:%s\n",
+                                worker->rxbuf);

Review comment:
       ```suggestion
                                  worker->rxbuf);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1053: apps: update licenses to Apache

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#discussion_r821515648



##########
File path: examples/nxdemo/nxdemo_bkgd.c
##########
@@ -350,7 +336,7 @@ static void nxdemo_demo_2(NXWINDOW hwnd)
   center.x = g_nxdemo.xres >> 1;
   center.y = g_nxdemo.yres >> 1;
 
-  for (i = 0; i<MIN(g_nxdemo.xres, g_nxdemo.yres)>> 1; i++)
+  for (i = 0; i < MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1; i++)

Review comment:
       Minor
   ```suggestion
     for (i = 0; i < (MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1); i++)
   ```

##########
File path: examples/nxdemo/nxdemo_bkgd.c
##########
@@ -292,7 +278,7 @@ static void nxdemo_demo_1(NXWINDOW hwnd)
   center.x = g_nxdemo.xres >> 1;
   center.y = g_nxdemo.yres >> 1;
 
-  for (i = 0; i<MIN(g_nxdemo.xres, g_nxdemo.yres)>> 1; i++)
+  for (i = 0; i < MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1; i++)

Review comment:
       Minor
   ```suggestion
     for (i = 0; i < (MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1); i++)
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org