You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/04/09 08:46:27 UTC

[GitHub] [mynewt-nimble] Reynevan94 opened a new pull request #796: Apps: central added

Reynevan94 opened a new pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796
 
 
   Added central application which presents how to connect to peripheral.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] Reynevan94 commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
Reynevan94 commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410174035
 
 

 ##########
 File path: apps/central/src/main.c
 ##########
 @@ -0,0 +1,190 @@
+/*
+ * 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
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+    ble_addr_t addr;
+    int rc;
+
+    /* generate new non-resolvable private address */
+    rc = ble_hs_id_gen_rnd(0, &addr);
+    assert(rc == 0);
+
+    /* set generated address */
+    rc = ble_hs_id_set_rnd(addr.val);
+    assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+    int rc;
+    switch (event->type) {
+    case BLE_GAP_EVENT_CONNECT:
+        if (event->connect.status == 0) {
+            MODLOG_DFLT(INFO,"Connection was fully established\n");
+            /* Set PHY for established conection */
+            rc = ble_gap_set_prefered_le_phy(event->connect.conn_handle,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_CODED_ANY);
+            if (rc == 0) {
+                MODLOG_DFLT(INFO, "rx and tx PHYs set to 2M\n");
+            } else {
+                MODLOG_DFLT(INFO, "failed to set rx and tx PHYs\n");
+            }
+            ble_gap_terminate(event->connect.conn_handle, 0x13);
 
 Review comment:
   As far as I understand, this GAP event should be handled by peripheral and on central side we don't have easy way to find out if it completed, but if I'm mistaken, I'm happy to change that.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-611439828
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/central/src/main.c
   <details>
   
   ```diff
   @@ -56,7 +56,7 @@
            } else {
                MODLOG_DFLT(INFO,"Connection failed, error code: %i\n",
                    event->connect.status);
   -        } 
   +        }
            break;
        case BLE_GAP_EVENT_DISCONNECT:
            MODLOG_DFLT(INFO,"Disconnected, reason code: %i\n",
   ```
   
   </details>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410019122
 
 

 ##########
 File path: apps/central/src/main.c
 ##########
 @@ -0,0 +1,190 @@
+/*
+ * 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
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+    ble_addr_t addr;
+    int rc;
+
+    /* generate new non-resolvable private address */
+    rc = ble_hs_id_gen_rnd(0, &addr);
+    assert(rc == 0);
+
+    /* set generated address */
+    rc = ble_hs_id_set_rnd(addr.val);
+    assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+    int rc;
+    switch (event->type) {
+    case BLE_GAP_EVENT_CONNECT:
+        if (event->connect.status == 0) {
+            MODLOG_DFLT(INFO,"Connection was fully established\n");
+            /* Set PHY for established conection */
+            rc = ble_gap_set_prefered_le_phy(event->connect.conn_handle,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_CODED_ANY);
+            if (rc == 0) {
+                MODLOG_DFLT(INFO, "rx and tx PHYs set to 2M\n");
+            } else {
+                MODLOG_DFLT(INFO, "failed to set rx and tx PHYs\n");
+            }
+            ble_gap_terminate(event->connect.conn_handle, 0x13);
+            os_time_ms_to_ticks(delay_ms, &ticks);
+            os_time_delay(ticks);
+            scan();
+        } else {
+            MODLOG_DFLT(INFO,"Connection failed, error code: %i\n",
+                event->connect.status);
+        }
+        break;
+    case BLE_GAP_EVENT_DISCONNECT:
+        MODLOG_DFLT(INFO,"Disconnected, reason code: %i\n",
+        event->disconnect.reason);
+    default:
+        MODLOG_DFLT(INFO,"Connection event type not supported\n");
+        break;
+    }
+    return 0;
+}
+
+static int
+scan_event(struct ble_gap_event *event, void *arg)
+{
+    struct ble_hs_adv_fields parsed_fields;
+    memset(&parsed_fields, 0, sizeof(parsed_fields));
+
+    /*predef_uuid stores information about UUID of device, that we connect to*/
+    const uint8_t predef_uuid[16] = {
+        0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+        0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff
+    };
+
+    switch (event->type) {
+    /* advertising report has been received during discovery procedure */
+    case BLE_GAP_EVENT_DISC:
+        MODLOG_DFLT(INFO, "Advertising report received! Checking UUID...\n");
+        ble_hs_adv_parse_fields(&parsed_fields, event->disc.data,
+                                event->disc.length_data);
+        /* Predefined UUID is compared to recieved one;
+           if doesn't fit - end procedure and go back to scanning,
+           else - connect. */
+        for (int i = 0; i < sizeof(predef_uuid); i++) {
+            if (parsed_fields.uuids128->value[i] != predef_uuid[i]) {
+                MODLOG_DFLT(INFO, "doesn't fit\n");
+                return 0;
+            }
+        }
+
+        MODLOG_DFLT(INFO, "UUID ");
+        for (int i = 0; i < sizeof(predef_uuid); i++) {
+            MODLOG_DFLT(INFO, "%d, ", parsed_fields.uuids128->value[i]);
+        }
+        MODLOG_DFLT(INFO, "fits, connecting... \n");
+        ble_gap_disc_cancel();
+        ble_gap_connect(g_own_addr_type, &(event->disc.addr), 10000,
+            NULL, conn_event, NULL);
+        break;
+    /* discovery procedure has terminated */
+    case BLE_GAP_EVENT_DISC_COMPLETE:
+        MODLOG_DFLT(INFO,"Code of termination reason: %d\n",
+                    event->disc_complete.reason);
+        scan();
+        break;
+    default:
+        MODLOG_DFLT(ERROR, "Discovery event not handled\n");
+        break;
+    }
+    return 0;
+}
+
+static void
+scan(void)
+{
+    int rc;
+
+    /* set scan parameters */
+    const struct ble_gap_disc_params scan_params = {10000, 200, 0, 0, 0, 1};
+
+    /* performs discovery procedure */
+    rc = ble_gap_disc(g_own_addr_type, 1000, &scan_params,scan_event, NULL);
+    assert(rc == 0);
+}
+
+
 
 Review comment:
   not needed empty lines

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410026121
 
 

 ##########
 File path: apps/central/pkg.yml
 ##########
 @@ -0,0 +1,34 @@
+#
+# 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
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+#
+
+pkg.name: "apps/central"
+pkg.type: app
+pkg.description: "Basic central application"
+pkg.author: "Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl?"
 
 Review comment:
   "?" in the end

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-614506014
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/central/src/main.c
   <details>
   
   ```diff
   @@ -112,7 +112,7 @@
                    return 0;
                }
            }
   -        
   +
            MODLOG_DFLT(INFO, "UUID ");
            for (int i = 0; i < sizeof(predef_uuid); i++) {
                MODLOG_DFLT(INFO, "%d, ", parsed_fields.uuids128->value[i]);
   ```
   
   </details>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-615203118
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/central/src/main.c
   <details>
   
   ```diff
   @@ -141,14 +141,14 @@
    {
        int rc;
    
   -    /* set scan parameters: 
   +    /* set scan parameters:
            - scan interval in 0.625ms units
            - scan window in 0.625ms units
            - filter policy - 0 if whitelisting not used
            - limited - should limited discovery be used
            - passive - should passive scan be used
            - filter duplicates - 1 enables filtering duplicated advertisements
   -    */
   +     */
        const struct ble_gap_disc_params scan_params = {10000, 200, 0, 0, 0, 1};
    
        /* performs discovery procedure */
   ```
   
   </details>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410020093
 
 

 ##########
 File path: apps/central/src/main.c
 ##########
 @@ -0,0 +1,190 @@
+/*
+ * 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
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+    ble_addr_t addr;
+    int rc;
+
+    /* generate new non-resolvable private address */
+    rc = ble_hs_id_gen_rnd(0, &addr);
+    assert(rc == 0);
+
+    /* set generated address */
+    rc = ble_hs_id_set_rnd(addr.val);
+    assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+    int rc;
+    switch (event->type) {
+    case BLE_GAP_EVENT_CONNECT:
+        if (event->connect.status == 0) {
+            MODLOG_DFLT(INFO,"Connection was fully established\n");
+            /* Set PHY for established conection */
+            rc = ble_gap_set_prefered_le_phy(event->connect.conn_handle,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_CODED_ANY);
+            if (rc == 0) {
+                MODLOG_DFLT(INFO, "rx and tx PHYs set to 2M\n");
+            } else {
+                MODLOG_DFLT(INFO, "failed to set rx and tx PHYs\n");
+            }
+            ble_gap_terminate(event->connect.conn_handle, 0x13);
+            os_time_ms_to_ticks(delay_ms, &ticks);
+            os_time_delay(ticks);
+            scan();
+        } else {
+            MODLOG_DFLT(INFO,"Connection failed, error code: %i\n",
+                event->connect.status);
+        }
+        break;
+    case BLE_GAP_EVENT_DISCONNECT:
+        MODLOG_DFLT(INFO,"Disconnected, reason code: %i\n",
+        event->disconnect.reason);
+    default:
+        MODLOG_DFLT(INFO,"Connection event type not supported\n");
+        break;
+    }
+    return 0;
+}
+
+static int
+scan_event(struct ble_gap_event *event, void *arg)
+{
+    struct ble_hs_adv_fields parsed_fields;
+    memset(&parsed_fields, 0, sizeof(parsed_fields));
+
+    /*predef_uuid stores information about UUID of device, that we connect to*/
+    const uint8_t predef_uuid[16] = {
 
 Review comment:
   declarations should be on top as per coding style guidelines

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410023999
 
 

 ##########
 File path: apps/central/src/main.c
 ##########
 @@ -0,0 +1,190 @@
+/*
+ * 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
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+    ble_addr_t addr;
+    int rc;
+
+    /* generate new non-resolvable private address */
+    rc = ble_hs_id_gen_rnd(0, &addr);
+    assert(rc == 0);
+
+    /* set generated address */
+    rc = ble_hs_id_set_rnd(addr.val);
+    assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+    int rc;
+    switch (event->type) {
+    case BLE_GAP_EVENT_CONNECT:
+        if (event->connect.status == 0) {
+            MODLOG_DFLT(INFO,"Connection was fully established\n");
+            /* Set PHY for established conection */
+            rc = ble_gap_set_prefered_le_phy(event->connect.conn_handle,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_CODED_ANY);
+            if (rc == 0) {
+                MODLOG_DFLT(INFO, "rx and tx PHYs set to 2M\n");
+            } else {
+                MODLOG_DFLT(INFO, "failed to set rx and tx PHYs\n");
+            }
+            ble_gap_terminate(event->connect.conn_handle, 0x13);
+            os_time_ms_to_ticks(delay_ms, &ticks);
+            os_time_delay(ticks);
+            scan();
+        } else {
+            MODLOG_DFLT(INFO,"Connection failed, error code: %i\n",
+                event->connect.status);
+        }
+        break;
+    case BLE_GAP_EVENT_DISCONNECT:
+        MODLOG_DFLT(INFO,"Disconnected, reason code: %i\n",
+        event->disconnect.reason);
 
 Review comment:
   missing break

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-615203118
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/central/src/main.c
   <details>
   
   ```diff
   @@ -141,14 +141,14 @@
    {
        int rc;
    
   -    /* set scan parameters: 
   +    /* set scan parameters:
            - scan interval in 0.625ms units
            - scan window in 0.625ms units
            - filter policy - 0 if whitelisting not used
            - limited - should limited discovery be used
            - passive - should passive scan be used
            - filter duplicates - 1 enables filtering duplicated advertisements
   -    */
   +     */
        const struct ble_gap_disc_params scan_params = {10000, 200, 0, 0, 0, 1};
    
        /* performs discovery procedure */
   ```
   
   </details>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-611425136
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/central/src/main.c
   <details>
   
   ```diff
   @@ -56,7 +56,7 @@
            } else {
                MODLOG_DFLT(INFO,"Connection failed, error code: %i\n",
                    event->connect.status);
   -        } 
   +        }
            break;
        case BLE_GAP_EVENT_DISCONNECT:
            MODLOG_DFLT(INFO,"Disconnected, reason code: %i\n",
   @@ -222,7 +222,7 @@
        };
    
        switch (event->type) {
   -    /*advertising report has been received during discovery procedure*/   
   +    /*advertising report has been received during discovery procedure*/
        case BLE_GAP_EVENT_DISC:
            MODLOG_DFLT(INFO, "Advertising report received!\n");
            rc = ble_hs_adv_parse_fields(&parsed_fields, event->disc.data,
   @@ -236,7 +236,7 @@
               if doesn't fit - end procedure and go back to scanning,
               else - connect. UUID digits are printed in decimal form until
               they don't match */
   -        for (int i = 0; i < sizeof(predef_uuid); i++) {                
   +        for (int i = 0; i < sizeof(predef_uuid); i++) {
                MODLOG_DFLT(INFO, "%d, ", parsed_fields.uuids128->value[i]);
                if (parsed_fields.uuids128->value[i] != predef_uuid[i]) {
                    MODLOG_DFLT(INFO, "doesn't fit\n");
   @@ -282,7 +282,7 @@
        int rc;
        /* Generate a non-resolvable private address. */
        ble_app_set_addr();
   -    
   +
        /* g_own_addr_type will store type of addres our BSP uses */
    
        rc = ble_hs_util_ensure_addr(0);
   ```
   
   </details>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-614542392
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410023741
 
 

 ##########
 File path: apps/central/src/main.c
 ##########
 @@ -0,0 +1,190 @@
+/*
+ * 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
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+    ble_addr_t addr;
+    int rc;
+
+    /* generate new non-resolvable private address */
+    rc = ble_hs_id_gen_rnd(0, &addr);
+    assert(rc == 0);
+
+    /* set generated address */
+    rc = ble_hs_id_set_rnd(addr.val);
+    assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+    int rc;
+    switch (event->type) {
+    case BLE_GAP_EVENT_CONNECT:
+        if (event->connect.status == 0) {
+            MODLOG_DFLT(INFO,"Connection was fully established\n");
+            /* Set PHY for established conection */
+            rc = ble_gap_set_prefered_le_phy(event->connect.conn_handle,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_CODED_ANY);
+            if (rc == 0) {
+                MODLOG_DFLT(INFO, "rx and tx PHYs set to 2M\n");
+            } else {
+                MODLOG_DFLT(INFO, "failed to set rx and tx PHYs\n");
+            }
+            ble_gap_terminate(event->connect.conn_handle, 0x13);
 
 Review comment:
   not sure what is a purpose of this app, but if we are changing PHY, maybe before disconnecting we could wait until PHY is really changed?
   
   BLE_GAP_EVENT_PHY_UPDATE_COMPLETE

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410024995
 
 

 ##########
 File path: nimble/host/include/host/ble_gap.h
 ##########
 @@ -1984,6 +1984,8 @@ int ble_gap_set_prefered_default_le_phy(uint8_t tx_phys_mask,
  *                          - BLE_GAP_LE_PHY_CODED_S8
  *
  * @return                   0 on success; nonzero on failure.
+ *
+ * When PHY is successfully changed, phy_updated event is occurs.
 
 Review comment:
   This could go up to the function description.
   
   We can even say what even exactly which is  BLE_GAP_EVENT_PHY_UPDATE_COMPLETE. 
   
   Also this should go as separate patch

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410023250
 
 

 ##########
 File path: apps/central/src/main.c
 ##########
 @@ -0,0 +1,190 @@
+/*
+ * 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
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+    ble_addr_t addr;
+    int rc;
+
+    /* generate new non-resolvable private address */
+    rc = ble_hs_id_gen_rnd(0, &addr);
+    assert(rc == 0);
+
+    /* set generated address */
+    rc = ble_hs_id_set_rnd(addr.val);
+    assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+    int rc;
+    switch (event->type) {
+    case BLE_GAP_EVENT_CONNECT:
+        if (event->connect.status == 0) {
+            MODLOG_DFLT(INFO,"Connection was fully established\n");
+            /* Set PHY for established conection */
+            rc = ble_gap_set_prefered_le_phy(event->connect.conn_handle,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_CODED_ANY);
+            if (rc == 0) {
+                MODLOG_DFLT(INFO, "rx and tx PHYs set to 2M\n");
+            } else {
+                MODLOG_DFLT(INFO, "failed to set rx and tx PHYs\n");
+            }
+            ble_gap_terminate(event->connect.conn_handle, 0x13);
 
 Review comment:
   **BLE_ERR_REM_USER_CONN_TERM**

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-615190375
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/central/src/main.c
   <details>
   
   ```diff
   @@ -141,14 +141,14 @@
    {
        int rc;
    
   -    /* set scan parameters: 
   +    /* set scan parameters:
            - scan interval in 0.625ms units
            - scan window in 0.625ms units
            - filter policy - 0 if whitelisting not used
            - limited - should limited discovery be used
            - passive - should passive scan be used
            - filter duplicates - 1 enables filtering duplicated advertisements
   -    */
   +     */
        const struct ble_gap_disc_params scan_params = {10000, 200, 0, 0, 0, 1};
    
        /* performs discovery procedure */
   ```
   
   </details>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410024440
 
 

 ##########
 File path: apps/central/syscfg.yml
 ##########
 @@ -0,0 +1,25 @@
+#
+# 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
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+#
+
+# Settings this app defines.
+syscfg.defs:
+    BLEPRPH_LE_PHY_SUPPORT:
 
 Review comment:
   this seems to be some leftover

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-615212074
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-615190375
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/central/src/main.c
   <details>
   
   ```diff
   @@ -141,14 +141,14 @@
    {
        int rc;
    
   -    /* set scan parameters: 
   +    /* set scan parameters:
            - scan interval in 0.625ms units
            - scan window in 0.625ms units
            - filter policy - 0 if whitelisting not used
            - limited - should limited discovery be used
            - passive - should passive scan be used
            - filter duplicates - 1 enables filtering duplicated advertisements
   -    */
   +     */
        const struct ble_gap_disc_params scan_params = {10000, 200, 0, 0, 0, 1};
    
        /* performs discovery procedure */
   ```
   
   </details>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-611446715
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-611446715
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-615210009
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/central/src/main.c
   <details>
   
   ```diff
   @@ -145,7 +145,7 @@
    {
        int rc;
    
   -    /* set scan parameters: 
   +    /* set scan parameters:
            - scan interval in 0.625ms units
            - scan window in 0.625ms units
            - filter policy - 0 if whitelisting not used
   ```
   
   </details>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-615210009
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/central/src/main.c
   <details>
   
   ```diff
   @@ -145,7 +145,7 @@
    {
        int rc;
    
   -    /* set scan parameters: 
   +    /* set scan parameters:
            - scan interval in 0.625ms units
            - scan window in 0.625ms units
            - filter policy - 0 if whitelisting not used
   ```
   
   </details>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410021105
 
 

 ##########
 File path: apps/central/src/main.c
 ##########
 @@ -0,0 +1,190 @@
+/*
+ * 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
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+    ble_addr_t addr;
+    int rc;
+
+    /* generate new non-resolvable private address */
+    rc = ble_hs_id_gen_rnd(0, &addr);
+    assert(rc == 0);
+
+    /* set generated address */
+    rc = ble_hs_id_set_rnd(addr.val);
+    assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+    int rc;
+    switch (event->type) {
+    case BLE_GAP_EVENT_CONNECT:
+        if (event->connect.status == 0) {
+            MODLOG_DFLT(INFO,"Connection was fully established\n");
+            /* Set PHY for established conection */
+            rc = ble_gap_set_prefered_le_phy(event->connect.conn_handle,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_CODED_ANY);
+            if (rc == 0) {
+                MODLOG_DFLT(INFO, "rx and tx PHYs set to 2M\n");
+            } else {
+                MODLOG_DFLT(INFO, "failed to set rx and tx PHYs\n");
+            }
+            ble_gap_terminate(event->connect.conn_handle, 0x13);
+            os_time_ms_to_ticks(delay_ms, &ticks);
+            os_time_delay(ticks);
+            scan();
+        } else {
+            MODLOG_DFLT(INFO,"Connection failed, error code: %i\n",
+                event->connect.status);
+        }
+        break;
+    case BLE_GAP_EVENT_DISCONNECT:
+        MODLOG_DFLT(INFO,"Disconnected, reason code: %i\n",
+        event->disconnect.reason);
+    default:
+        MODLOG_DFLT(INFO,"Connection event type not supported\n");
+        break;
+    }
+    return 0;
+}
+
+static int
+scan_event(struct ble_gap_event *event, void *arg)
+{
+    struct ble_hs_adv_fields parsed_fields;
+    memset(&parsed_fields, 0, sizeof(parsed_fields));
+
+    /*predef_uuid stores information about UUID of device, that we connect to*/
+    const uint8_t predef_uuid[16] = {
+        0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+        0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff
+    };
+
+    switch (event->type) {
+    /* advertising report has been received during discovery procedure */
+    case BLE_GAP_EVENT_DISC:
+        MODLOG_DFLT(INFO, "Advertising report received! Checking UUID...\n");
+        ble_hs_adv_parse_fields(&parsed_fields, event->disc.data,
+                                event->disc.length_data);
+        /* Predefined UUID is compared to recieved one;
+           if doesn't fit - end procedure and go back to scanning,
+           else - connect. */
+        for (int i = 0; i < sizeof(predef_uuid); i++) {
 
 Review comment:
   https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md
   
   local variable shall be on top

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410022133
 
 

 ##########
 File path: apps/central/src/main.c
 ##########
 @@ -0,0 +1,190 @@
+/*
+ * 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
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+    ble_addr_t addr;
+    int rc;
+
+    /* generate new non-resolvable private address */
+    rc = ble_hs_id_gen_rnd(0, &addr);
+    assert(rc == 0);
+
+    /* set generated address */
+    rc = ble_hs_id_set_rnd(addr.val);
+    assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+    int rc;
+    switch (event->type) {
 
 Review comment:
   nitpick: add empty line after declarations

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] sjanc commented on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
sjanc commented on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-613865725
 
 
   some general comments on how I'd like to see this sample:
   
   - no need to parse full adv data and print those,  just look for specified UUID and print info when it is found
   - then initiate connection
   - when connected (or failed) print proper info about  that
   - update conn params, notify when updated
   - change PHY eg to 2M and notify when done,
   - disconnect
   - wait for few sconds and go back to 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410029832
 
 

 ##########
 File path: apps/central/src/main.c
 ##########
 @@ -0,0 +1,190 @@
+/*
+ * 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
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+    ble_addr_t addr;
+    int rc;
+
+    /* generate new non-resolvable private address */
+    rc = ble_hs_id_gen_rnd(0, &addr);
+    assert(rc == 0);
+
+    /* set generated address */
+    rc = ble_hs_id_set_rnd(addr.val);
+    assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+    int rc;
+    switch (event->type) {
+    case BLE_GAP_EVENT_CONNECT:
+        if (event->connect.status == 0) {
+            MODLOG_DFLT(INFO,"Connection was fully established\n");
+            /* Set PHY for established conection */
+            rc = ble_gap_set_prefered_le_phy(event->connect.conn_handle,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_CODED_ANY);
+            if (rc == 0) {
+                MODLOG_DFLT(INFO, "rx and tx PHYs set to 2M\n");
+            } else {
+                MODLOG_DFLT(INFO, "failed to set rx and tx PHYs\n");
+            }
+            ble_gap_terminate(event->connect.conn_handle, 0x13);
+            os_time_ms_to_ticks(delay_ms, &ticks);
 
 Review comment:
   os_time_delay(os_time_ms_to_ticks32(2000)); ?
   Also please write comment why it is here.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-614542392
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410019532
 
 

 ##########
 File path: apps/central/src/main.c
 ##########
 @@ -0,0 +1,190 @@
+/*
+ * 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
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+    ble_addr_t addr;
+    int rc;
+
+    /* generate new non-resolvable private address */
+    rc = ble_hs_id_gen_rnd(0, &addr);
+    assert(rc == 0);
+
+    /* set generated address */
+    rc = ble_hs_id_set_rnd(addr.val);
+    assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+    int rc;
+    switch (event->type) {
+    case BLE_GAP_EVENT_CONNECT:
+        if (event->connect.status == 0) {
+            MODLOG_DFLT(INFO,"Connection was fully established\n");
+            /* Set PHY for established conection */
+            rc = ble_gap_set_prefered_le_phy(event->connect.conn_handle,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_CODED_ANY);
+            if (rc == 0) {
+                MODLOG_DFLT(INFO, "rx and tx PHYs set to 2M\n");
+            } else {
+                MODLOG_DFLT(INFO, "failed to set rx and tx PHYs\n");
+            }
+            ble_gap_terminate(event->connect.conn_handle, 0x13);
+            os_time_ms_to_ticks(delay_ms, &ticks);
+            os_time_delay(ticks);
+            scan();
+        } else {
+            MODLOG_DFLT(INFO,"Connection failed, error code: %i\n",
+                event->connect.status);
+        }
+        break;
+    case BLE_GAP_EVENT_DISCONNECT:
+        MODLOG_DFLT(INFO,"Disconnected, reason code: %i\n",
+        event->disconnect.reason);
+    default:
+        MODLOG_DFLT(INFO,"Connection event type not supported\n");
+        break;
+    }
+    return 0;
+}
+
+static int
+scan_event(struct ble_gap_event *event, void *arg)
+{
+    struct ble_hs_adv_fields parsed_fields;
+    memset(&parsed_fields, 0, sizeof(parsed_fields));
+
+    /*predef_uuid stores information about UUID of device, that we connect to*/
+    const uint8_t predef_uuid[16] = {
+        0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+        0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff
+    };
+
+    switch (event->type) {
+    /* advertising report has been received during discovery procedure */
+    case BLE_GAP_EVENT_DISC:
+        MODLOG_DFLT(INFO, "Advertising report received! Checking UUID...\n");
+        ble_hs_adv_parse_fields(&parsed_fields, event->disc.data,
+                                event->disc.length_data);
+        /* Predefined UUID is compared to recieved one;
+           if doesn't fit - end procedure and go back to scanning,
+           else - connect. */
+        for (int i = 0; i < sizeof(predef_uuid); i++) {
+            if (parsed_fields.uuids128->value[i] != predef_uuid[i]) {
+                MODLOG_DFLT(INFO, "doesn't fit\n");
+                return 0;
+            }
+        }
+
+        MODLOG_DFLT(INFO, "UUID ");
+        for (int i = 0; i < sizeof(predef_uuid); i++) {
+            MODLOG_DFLT(INFO, "%d, ", parsed_fields.uuids128->value[i]);
+        }
+        MODLOG_DFLT(INFO, "fits, connecting... \n");
+        ble_gap_disc_cancel();
+        ble_gap_connect(g_own_addr_type, &(event->disc.addr), 10000,
+            NULL, conn_event, NULL);
+        break;
+    /* discovery procedure has terminated */
+    case BLE_GAP_EVENT_DISC_COMPLETE:
+        MODLOG_DFLT(INFO,"Code of termination reason: %d\n",
+                    event->disc_complete.reason);
+        scan();
+        break;
+    default:
+        MODLOG_DFLT(ERROR, "Discovery event not handled\n");
+        break;
+    }
+    return 0;
+}
+
+static void
+scan(void)
+{
+    int rc;
+
+    /* set scan parameters */
 
 Review comment:
   Since it is demo app, maybe in the comment we can explain parameters

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-611425136
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/central/src/main.c
   <details>
   
   ```diff
   @@ -56,7 +56,7 @@
            } else {
                MODLOG_DFLT(INFO,"Connection failed, error code: %i\n",
                    event->connect.status);
   -        } 
   +        }
            break;
        case BLE_GAP_EVENT_DISCONNECT:
            MODLOG_DFLT(INFO,"Disconnected, reason code: %i\n",
   @@ -222,7 +222,7 @@
        };
    
        switch (event->type) {
   -    /*advertising report has been received during discovery procedure*/   
   +    /*advertising report has been received during discovery procedure*/
        case BLE_GAP_EVENT_DISC:
            MODLOG_DFLT(INFO, "Advertising report received!\n");
            rc = ble_hs_adv_parse_fields(&parsed_fields, event->disc.data,
   @@ -236,7 +236,7 @@
               if doesn't fit - end procedure and go back to scanning,
               else - connect. UUID digits are printed in decimal form until
               they don't match */
   -        for (int i = 0; i < sizeof(predef_uuid); i++) {                
   +        for (int i = 0; i < sizeof(predef_uuid); i++) {
                MODLOG_DFLT(INFO, "%d, ", parsed_fields.uuids128->value[i]);
                if (parsed_fields.uuids128->value[i] != predef_uuid[i]) {
                    MODLOG_DFLT(INFO, "doesn't fit\n");
   @@ -282,7 +282,7 @@
        int rc;
        /* Generate a non-resolvable private address. */
        ble_app_set_addr();
   -    
   +
        /* g_own_addr_type will store type of addres our BSP uses */
    
        rc = ble_hs_util_ensure_addr(0);
   ```
   
   </details>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410021918
 
 

 ##########
 File path: apps/central/src/main.c
 ##########
 @@ -0,0 +1,190 @@
+/*
+ * 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
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+    ble_addr_t addr;
+    int rc;
+
+    /* generate new non-resolvable private address */
+    rc = ble_hs_id_gen_rnd(0, &addr);
+    assert(rc == 0);
+
+    /* set generated address */
+    rc = ble_hs_id_set_rnd(addr.val);
+    assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+    int rc;
+    switch (event->type) {
+    case BLE_GAP_EVENT_CONNECT:
+        if (event->connect.status == 0) {
+            MODLOG_DFLT(INFO,"Connection was fully established\n");
+            /* Set PHY for established conection */
+            rc = ble_gap_set_prefered_le_phy(event->connect.conn_handle,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_2M_MASK,
+                                             BLE_GAP_LE_PHY_CODED_ANY);
+            if (rc == 0) {
+                MODLOG_DFLT(INFO, "rx and tx PHYs set to 2M\n");
+            } else {
+                MODLOG_DFLT(INFO, "failed to set rx and tx PHYs\n");
+            }
+            ble_gap_terminate(event->connect.conn_handle, 0x13);
+            os_time_ms_to_ticks(delay_ms, &ticks);
+            os_time_delay(ticks);
+            scan();
+        } else {
+            MODLOG_DFLT(INFO,"Connection failed, error code: %i\n",
+                event->connect.status);
+        }
+        break;
+    case BLE_GAP_EVENT_DISCONNECT:
+        MODLOG_DFLT(INFO,"Disconnected, reason code: %i\n",
+        event->disconnect.reason);
+    default:
+        MODLOG_DFLT(INFO,"Connection event type not supported\n");
+        break;
+    }
+    return 0;
+}
+
+static int
+scan_event(struct ble_gap_event *event, void *arg)
+{
+    struct ble_hs_adv_fields parsed_fields;
+    memset(&parsed_fields, 0, sizeof(parsed_fields));
+
+    /*predef_uuid stores information about UUID of device, that we connect to*/
+    const uint8_t predef_uuid[16] = {
+        0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+        0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff
+    };
+
+    switch (event->type) {
+    /* advertising report has been received during discovery procedure */
+    case BLE_GAP_EVENT_DISC:
+        MODLOG_DFLT(INFO, "Advertising report received! Checking UUID...\n");
+        ble_hs_adv_parse_fields(&parsed_fields, event->disc.data,
+                                event->disc.length_data);
+        /* Predefined UUID is compared to recieved one;
+           if doesn't fit - end procedure and go back to scanning,
+           else - connect. */
+        for (int i = 0; i < sizeof(predef_uuid); i++) {
+            if (parsed_fields.uuids128->value[i] != predef_uuid[i]) {
+                MODLOG_DFLT(INFO, "doesn't fit\n");
+                return 0;
+            }
+        }
+
+        MODLOG_DFLT(INFO, "UUID ");
+        for (int i = 0; i < sizeof(predef_uuid); i++) {
+            MODLOG_DFLT(INFO, "%d, ", parsed_fields.uuids128->value[i]);
+        }
+        MODLOG_DFLT(INFO, "fits, connecting... \n");
+        ble_gap_disc_cancel();
+        ble_gap_connect(g_own_addr_type, &(event->disc.addr), 10000,
+            NULL, conn_event, NULL);
+        break;
+    /* discovery procedure has terminated */
+    case BLE_GAP_EVENT_DISC_COMPLETE:
+        MODLOG_DFLT(INFO,"Code of termination reason: %d\n",
 
 Review comment:
   "Discovery completed, reason: "

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r410022355
 
 

 ##########
 File path: apps/central/src/main.c
 ##########
 @@ -0,0 +1,190 @@
+/*
+ * 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
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+    ble_addr_t addr;
+    int rc;
+
+    /* generate new non-resolvable private address */
+    rc = ble_hs_id_gen_rnd(0, &addr);
+    assert(rc == 0);
+
+    /* set generated address */
+    rc = ble_hs_id_set_rnd(addr.val);
+    assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+    int rc;
+    switch (event->type) {
+    case BLE_GAP_EVENT_CONNECT:
+        if (event->connect.status == 0) {
+            MODLOG_DFLT(INFO,"Connection was fully established\n");
 
 Review comment:
   "fully" not needed :)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-611439828
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/central/src/main.c
   <details>
   
   ```diff
   @@ -56,7 +56,7 @@
            } else {
                MODLOG_DFLT(INFO,"Connection failed, error code: %i\n",
                    event->connect.status);
   -        } 
   +        }
            break;
        case BLE_GAP_EVENT_DISCONNECT:
            MODLOG_DFLT(INFO,"Disconnected, reason code: %i\n",
   ```
   
   </details>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #796: Apps: central added

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #796: Apps: central added
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-614506014
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/central/src/main.c
   <details>
   
   ```diff
   @@ -112,7 +112,7 @@
                    return 0;
                }
            }
   -        
   +
            MODLOG_DFLT(INFO, "UUID ");
            for (int i = 0; i < sizeof(predef_uuid); i++) {
                MODLOG_DFLT(INFO, "%d, ", parsed_fields.uuids128->value[i]);
   ```
   
   </details>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services