You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/04/29 16:50:33 UTC

[incubator-nuttx-apps] branch master updated (dcc620e -> fcc688e)

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git.


    from dcc620e  Kconfig: Change !BUILD_PROTECTED && !BUILD_KERNEL to BUILD_FLAT
     new 9e5d57f  wireless/bluetooth/btsak/btsak_security.c:  Fix newline character
     new fcc688e  wireless/bluetooth/btsak/btsak_security.c:  Fix long lines for nxstyle.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 wireless/bluetooth/btsak/btsak_security.c | 83 +++++++++++++++----------------
 1 file changed, 39 insertions(+), 44 deletions(-)


[incubator-nuttx-apps] 02/02: wireless/bluetooth/btsak/btsak_security.c: Fix long lines for nxstyle.

Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit fcc688e77119e0097721fa6c33472190267b0882
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Wed Apr 29 09:50:02 2020 -0600

    wireless/bluetooth/btsak/btsak_security.c:  Fix long lines for nxstyle.
---
 wireless/bluetooth/btsak/btsak_security.c | 75 +++++++++++++++----------------
 1 file changed, 35 insertions(+), 40 deletions(-)

diff --git a/wireless/bluetooth/btsak/btsak_security.c b/wireless/bluetooth/btsak/btsak_security.c
index cf04a99..2345767 100644
--- a/wireless/bluetooth/btsak/btsak_security.c
+++ b/wireless/bluetooth/btsak/btsak_security.c
@@ -2,42 +2,28 @@
  * apps/wireless/bluetooth/btsak/btsak_security.c
  * Bluetooth Swiss Army Knife -- Security command
  *
- *   Copyright (C) 2018 Gregory Nutt. All rights reserved.
- *   Author:  Gregory Nutt <gn...@nuttx.org>
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
  *
- * Based loosely on the i8sak IEEE 802.15.4 program by Anthony Merlino and
- * Sebastien Lorquet.  Commands inspired for btshell example in the
- * Intel/Zephyr Arduino 101 package (BSD license).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- *    used to endorse or promote products derived from this software
- *    without specific prior written permission.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
  *
  ****************************************************************************/
 
+/* Based loosely on the i8sak IEEE 802.15.4 program by Anthony Merlino and
+ * Sebastien Lorquet.  Commands inspired from btshell example in the
+ * Intel/Zephyr Arduino 101 package (BSD license).
+ */
+
 /****************************************************************************
  * Included Files
  ****************************************************************************/
@@ -73,21 +59,27 @@ static void btsak_security_showusage(FAR const char *progname,
   fprintf(stderr, "%s:\tEnable security (encryption) for a connection:\n",
           cmd);
   fprintf(stderr,
-          "\tIf device is paired, key encryption will be enabled. If the link\n");
+          "\tIf device is paired, key encryption will be enabled. If the "
+          "link\n");
   fprintf(stderr,
-          "\tis already encrypted with sufficiently strong key this function\n");
+          "\tis already encrypted with sufficiently strong key this "
+          "function\n");
   fprintf(stderr,
           "\tdoes nothing.\n\n");
   fprintf(stderr,
-          "\tIf the device is not paired pairing will be initiated. If the device\n");
+          "\tIf the device is not paired pairing will be initiated. If the "
+          "device\n");
   fprintf(stderr,
-          "\tis paired and keys are too weak but input output capabilities allow\n");
+          "\tis paired and keys are too weak but input output capabilities "
+          "allow\n");
   fprintf(stderr,
           "\tfor strong enough keys pairing will be initiated.\n\n");
   fprintf(stderr,
-          "\tThis function may return error if required level of security is not\n");
+          "\tThis function may return error if required level of security "
+          "is not\n");
   fprintf(stderr,
-          "\tpossible to achieve due to local or remote device limitation (eg input\n");
+          "\tpossible to achieve due to local or remote device limitation "
+          "(eg input\n");
   fprintf(stderr,
           "\toutput capabilities).\n\n");
   fprintf(stderr, "Usage:\n\n");
@@ -106,7 +98,8 @@ static void btsak_security_showusage(FAR const char *progname,
   fprintf(stderr,
           "\t\thigh\t- Encryption and authentication (MITM)\n");
   fprintf(stderr,
-          "\t\tfips\t- Authenticated LE secure connections and encryption\n");
+          "\t\tfips\t- Authenticated LE secure connections and "
+          "encryption\n");
   exit(exitcode);
 }
 
@@ -122,7 +115,8 @@ static void btsak_security_showusage(FAR const char *progname,
  *
  ****************************************************************************/
 
-void btsak_cmd_security(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
+void btsak_cmd_security(FAR struct btsak_s *btsak, int argc,
+                        FAR char *argv[])
 {
   struct btreq_s btreq;
   int sockfd;
@@ -179,7 +173,8 @@ void btsak_cmd_security(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
   sockfd = btsak_socket(btsak);
   if (sockfd >= 0)
     {
-      ret = ioctl(sockfd, SIOCBTSECURITY, (unsigned long)((uintptr_t)&btreq));
+      ret = ioctl(sockfd, SIOCBTSECURITY,
+                  (unsigned long)((uintptr_t)&btreq));
       if (ret < 0)
         {
           fprintf(stderr, "ERROR:  ioctl(SIOCBTSECURITY) failed: %d\n",


[incubator-nuttx-apps] 01/02: wireless/bluetooth/btsak/btsak_security.c: Fix newline character

Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 9e5d57f492d67d411c97fb17c6c5664b2ef9720f
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Wed Apr 29 09:38:05 2020 -0600

    wireless/bluetooth/btsak/btsak_security.c:  Fix newline character
    
    Inspired by Abdelatif's find, here are other cases where /n was used when \n ws intended
---
 wireless/bluetooth/btsak/btsak_security.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/wireless/bluetooth/btsak/btsak_security.c b/wireless/bluetooth/btsak/btsak_security.c
index d88b082..cf04a99 100644
--- a/wireless/bluetooth/btsak/btsak_security.c
+++ b/wireless/bluetooth/btsak/btsak_security.c
@@ -132,7 +132,7 @@ void btsak_cmd_security(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
 
   if (argc < 2)
     {
-      fprintf(stderr, "ERROR: Missing required arguments/n");
+      fprintf(stderr, "ERROR: Missing required arguments\n");
       btsak_security_showusage(btsak->progname, argv[0], EXIT_FAILURE);
     }
 
@@ -145,7 +145,7 @@ void btsak_cmd_security(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
 
   if (argc < 4)
     {
-      fprintf(stderr, "ERROR:  Missing required arguments/n");
+      fprintf(stderr, "ERROR:  Missing required arguments\n");
       btsak_security_showusage(btsak->progname, argv[0], EXIT_FAILURE);
     }
 
@@ -157,7 +157,7 @@ void btsak_cmd_security(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
   ret = btsak_str2addr(argv[1], btreq.btr_secaddr.val);
   if (ret < 0)
     {
-      fprintf(stderr, "ERROR:  Invalid address string: %s/n", argv[1]);
+      fprintf(stderr, "ERROR:  Invalid address string: %s\n", argv[1]);
       btsak_security_showusage(btsak->progname, argv[0], EXIT_FAILURE);
     }
 
@@ -166,7 +166,7 @@ void btsak_cmd_security(FAR struct btsak_s *btsak, int argc, FAR char *argv[])
   ret = btsak_str2addrtype(argv[2], &btreq.btr_secaddr.type);
   if (ret < 0)
     {
-      fprintf(stderr, "ERROR:  Invalid address type: %s/n", argv[2]);
+      fprintf(stderr, "ERROR:  Invalid address type: %s\n", argv[2]);
       btsak_security_showusage(btsak->progname, argv[0], EXIT_FAILURE);
     }