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 2018/03/13 12:21:10 UTC

[GitHub] michal-narajowski closed pull request #911: Mesh fixes

michal-narajowski closed pull request #911: Mesh fixes
URL: https://github.com/apache/mynewt-core/pull/911
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/apps/blemesh_shell/syscfg.yml b/apps/blemesh_shell/syscfg.yml
index 4f854d599..07cde3b41 100644
--- a/apps/blemesh_shell/syscfg.yml
+++ b/apps/blemesh_shell/syscfg.yml
@@ -51,15 +51,15 @@ syscfg.vals:
     BLE_MESH_FRIEND: 1
     BLE_MESH_CFG_CLI: 1
 
-    BLE_MESH_DEBUG: 1
-    BLE_MESH_DEBUG_NET: 1
-    BLE_MESH_DEBUG_TRANS: 1
-    BLE_MESH_DEBUG_BEACON: 1
-    BLE_MESH_DEBUG_CRYPTO: 1
-    BLE_MESH_DEBUG_PROV: 1
-    BLE_MESH_DEBUG_ACCESS: 1
-    BLE_MESH_DEBUG_MODEL: 1
-    BLE_MESH_DEBUG_ADV: 1
-    BLE_MESH_DEBUG_LOW_POWER: 1
-    BLE_MESH_DEBUG_FRIEND: 1
-    BLE_MESH_DEBUG_PROXY: 1
+    BLE_MESH_DEBUG: 0
+    BLE_MESH_DEBUG_NET: 0
+    BLE_MESH_DEBUG_TRANS: 0
+    BLE_MESH_DEBUG_BEACON: 0
+    BLE_MESH_DEBUG_CRYPTO: 0
+    BLE_MESH_DEBUG_PROV: 0
+    BLE_MESH_DEBUG_ACCESS: 0
+    BLE_MESH_DEBUG_MODEL: 0
+    BLE_MESH_DEBUG_ADV: 0
+    BLE_MESH_DEBUG_LOW_POWER: 0
+    BLE_MESH_DEBUG_FRIEND: 0
+    BLE_MESH_DEBUG_PROXY: 0
diff --git a/net/nimble/host/mesh/include/mesh/glue.h b/net/nimble/host/mesh/include/mesh/glue.h
index b1050d8c6..26ba98f2b 100644
--- a/net/nimble/host/mesh/include/mesh/glue.h
+++ b/net/nimble/host/mesh/include/mesh/glue.h
@@ -349,7 +349,7 @@ static inline unsigned int find_msb_set(u32_t op)
 /* Above flags are used with IS_ENABLED macro */
 #define IS_ENABLED(config) MYNEWT_VAL(config)
 
-#define CONFIG_BLUETOOTH_MESH_LPN_GROUPS    MYNEWT_VAL(BLE_MESH_LPN_GROUPS)
+#define CONFIG_BT_MESH_LPN_GROUPS           MYNEWT_VAL(BLE_MESH_LPN_GROUPS)
 #define CONFIG_BT_MESH_ADV_BUF_COUNT        MYNEWT_VAL(BLE_MESH_ADV_BUF_COUNT)
 #define CONFIG_BT_MESH_FRIEND_QUEUE_SIZE    MYNEWT_VAL(BLE_MESH_FRIEND_QUEUE_SIZE)
 #define CONFIG_BT_MESH_FRIEND_RECV_WIN      MYNEWT_VAL(BLE_MESH_FRIEND_RECV_WIN)
diff --git a/net/nimble/host/mesh/src/glue.c b/net/nimble/host/mesh/src/glue.c
index b93d9dbb9..15d8d9b2a 100644
--- a/net/nimble/host/mesh/src/glue.c
+++ b/net/nimble/host/mesh/src/glue.c
@@ -491,6 +491,22 @@ bt_le_adv_start(const struct ble_gap_adv_params *param,
         return err;
     }
 
+    if (sd) {
+        buf_len = 0;
+
+        err = set_ad(sd, sd_len, buf, &buf_len);
+        if (err) {
+            BT_ERR("Advertising failed: err %d", err);
+            return err;
+        }
+
+        err = ble_gap_adv_rsp_set_data(buf, buf_len);
+        if (err != 0) {
+            BT_ERR("Advertising failed: err %d", err);
+            return err;
+        }
+    }
+
     err = ble_gap_adv_start(g_mesh_addr_type, NULL, BLE_HS_FOREVER, param,
                             NULL, NULL);
     if (err) {
diff --git a/net/nimble/host/mesh/src/lpn.c b/net/nimble/host/mesh/src/lpn.c
index 165bc23b9..0cc462298 100644
--- a/net/nimble/host/mesh/src/lpn.c
+++ b/net/nimble/host/mesh/src/lpn.c
@@ -613,7 +613,7 @@ static void lpn_group_del(u16_t group)
 
 static inline int group_popcount(atomic_t *target)
 {
-#if CONFIG_BLUETOOTH_MESH_LPN_GROUPS > 32
+#if CONFIG_BT_MESH_LPN_GROUPS > 32
 	int i, count = 0;
 
 	for (i = 0; i < ARRAY_SIZE(bt_mesh.lpn.added); i++) {
diff --git a/net/nimble/host/mesh/src/net.h b/net/nimble/host/mesh/src/net.h
index 24940a648..5e11aa27b 100644
--- a/net/nimble/host/mesh/src/net.h
+++ b/net/nimble/host/mesh/src/net.h
@@ -121,7 +121,7 @@ struct bt_mesh_friend {
 };
 
 #if (MYNEWT_VAL(BLE_MESH_LOW_POWER))
-#define LPN_GROUPS MYNEWT_VAL(BLE_MESH_LOW_POWER)
+#define LPN_GROUPS CONFIG_BT_MESH_LPN_GROUPS
 #else
 #define LPN_GROUPS 0
 #endif
diff --git a/net/nimble/host/mesh/src/proxy.c b/net/nimble/host/mesh/src/proxy.c
index 1fe531752..4ec2cbe35 100644
--- a/net/nimble/host/mesh/src/proxy.c
+++ b/net/nimble/host/mesh/src/proxy.c
@@ -81,13 +81,15 @@ ble_uuid16_t BT_UUID_MESH_PROXY_DATA_OUT       = BLE_UUID16_INIT(0x2ade);
 #define CLIENT_BUF_SIZE 68
 
 static const struct ble_gap_adv_params slow_adv_param = {
-	.conn_mode = (BLE_GAP_CONN_MODE_UND ),
+	.conn_mode = (BLE_GAP_CONN_MODE_UND),
+	.disc_mode = (BLE_GAP_DISC_MODE_GEN),
 	.itvl_min = BT_GAP_ADV_SLOW_INT_MIN,
 	.itvl_max = BT_GAP_ADV_SLOW_INT_MAX,
 };
 
 static const struct ble_gap_adv_params fast_adv_param = {
 	.conn_mode = (BLE_GAP_CONN_MODE_UND),
+	.disc_mode = (BLE_GAP_DISC_MODE_GEN),
 	.itvl_min = BT_GAP_ADV_FAST_INT_MIN_2,
 	.itvl_max = BT_GAP_ADV_FAST_INT_MAX_2,
 };
diff --git a/net/nimble/host/mesh/src/shell.c b/net/nimble/host/mesh/src/shell.c
index 8a5cb38b6..03ea6dd70 100644
--- a/net/nimble/host/mesh/src/shell.c
+++ b/net/nimble/host/mesh/src/shell.c
@@ -65,7 +65,7 @@ static struct {
 
 static struct bt_mesh_cfg_srv cfg_srv = {
 	.relay = BT_MESH_RELAY_DISABLED,
-	.beacon = BT_MESH_BEACON_DISABLED,
+	.beacon = BT_MESH_BEACON_ENABLED,
 #if MYNEWT_VAL(BLE_MESH_FRIEND)
 	.frnd = BT_MESH_FRIEND_DISABLED,
 #else
@@ -413,11 +413,11 @@ static struct bt_mesh_prov prov = {
 	.reset = prov_reset,
 	.static_val = NULL,
 	.static_val_len = 0,
-	.output_size = 6,
-	.output_actions = (BT_MESH_DISPLAY_NUMBER | BT_MESH_DISPLAY_STRING),
+	.output_size = 4,
+	.output_actions = (BT_MESH_BLINK | BT_MESH_BEEP | BT_MESH_DISPLAY_NUMBER | BT_MESH_DISPLAY_STRING),
 	.output_number = output_number,
 	.output_string = output_string,
-	.input_size = 6,
+	.input_size = 4,
 	.input_actions = (BT_MESH_ENTER_NUMBER | BT_MESH_ENTER_STRING),
 	.input = input,
 };


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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