mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-28 19:57:23 +00:00
Merge pull request #911 from michal-narajowski/mesh-fixes
Mesh fixes X-Original-Commit: 00eb38b4c4d14b88da05ff0e82b2f8ebf728942c
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user