ble_mesh: update ble mesh examples sdkconfig.defaults

This commit is contained in:
lly 2019-09-03 19:32:05 +08:00
parent d48c89b56a
commit 1a8f37b383
12 changed files with 62 additions and 44 deletions

View File

@ -1656,21 +1656,23 @@ const u8_t *bt_mesh_pub_key_get(void)
BT_OCTET32 private_key = {0};
Point public_key = {0};
#if 1
if (bt_mesh_atomic_test_bit(bt_mesh_dev.flags, BLE_MESH_DEV_HAS_PUB_KEY)) {
return bt_mesh_public_key;
}
#else
/* BLE Mesh BQB test case MESH/NODE/PROV/UPD/BV-12-C requires
* different public key for each provisioning procedure.
* Note: if enabled, when Provisioner provision multiple devices
* at the same time, this may cause invalid confirmation value.
*
* Use the following code for generating different private key
* for each provisioning procedure.
*
* if (bt_mesh_rand(bt_mesh_private_key, BT_OCTET32_LEN)) {
* BT_ERR("%s, Unable to generate bt_mesh_private_key", __func__);
* return NULL;
* }
*/
if (bt_mesh_rand(bt_mesh_private_key, BT_OCTET32_LEN)) {
BT_ERR("%s, Unable to generate bt_mesh_private_key", __func__);
return NULL;
}
#endif
memcpy(private_key, bt_mesh_private_key, BT_OCTET32_LEN);
ECC_PointMult(&public_key, &(curve_p256.G), (DWORD *)private_key, KEY_LENGTH_DWORDS_P256);

View File

@ -785,11 +785,11 @@ int bt_mesh_net_resend(struct bt_mesh_subnet *sub, struct net_buf *buf,
}
if (IS_ENABLED(CONFIG_BLE_MESH_NODE) && bt_mesh_is_provisioned()) {
if (IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY) &&
bt_mesh_proxy_relay(&buf->b, dst)) {
send_cb_finalize(cb, cb_data);
return 0;
}
if (IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY) &&
bt_mesh_proxy_relay(&buf->b, dst)) {
send_cb_finalize(cb, cb_data);
return 0;
}
}
bt_mesh_adv_send(buf, cb, cb_data);

View File

@ -1527,7 +1527,7 @@ static void gen_prov_start(struct prov_rx *rx, struct net_buf_simple *buf)
if (link.rx.buf->len > link.rx.buf->size) {
BT_ERR("%s, Too large provisioning PDU (%u bytes)",
__func__, link.rx.buf->len);
// prov_send_fail_msg(PROV_ERR_NVAL_FMT);
/* Zephyr uses prov_send_fail_msg() here */
return;
}

View File

@ -418,28 +418,28 @@ static int send_seg(struct bt_mesh_net_tx *net_tx, struct net_buf_simple *sdu,
net_buf_simple_pull(sdu, len);
if (IS_ENABLED(CONFIG_BLE_MESH_NODE) && bt_mesh_is_provisioned()) {
if (IS_ENABLED(CONFIG_BLE_MESH_FRIEND)) {
enum bt_mesh_friend_pdu_type type;
if (IS_ENABLED(CONFIG_BLE_MESH_FRIEND)) {
enum bt_mesh_friend_pdu_type type;
if (seg_o == tx->seg_n) {
type = BLE_MESH_FRIEND_PDU_COMPLETE;
} else {
type = BLE_MESH_FRIEND_PDU_PARTIAL;
}
if (seg_o == tx->seg_n) {
type = BLE_MESH_FRIEND_PDU_COMPLETE;
} else {
type = BLE_MESH_FRIEND_PDU_PARTIAL;
}
if (bt_mesh_friend_enqueue_tx(net_tx, type,
&tx->seq_auth,
tx->seg_n + 1,
&seg->b) &&
BLE_MESH_ADDR_IS_UNICAST(net_tx->ctx->addr)) {
/* PDUs for a specific Friend should only go
* out through the Friend Queue.
*/
net_buf_unref(seg);
continue;
if (bt_mesh_friend_enqueue_tx(net_tx, type,
&tx->seq_auth,
tx->seg_n + 1,
&seg->b) &&
BLE_MESH_ADDR_IS_UNICAST(net_tx->ctx->addr)) {
/* PDUs for a specific Friend should only go
* out through the Friend Queue.
*/
net_buf_unref(seg);
continue;
}
}
}
}
tx->seg[seg_o] = net_buf_ref(seg);
@ -1543,26 +1543,26 @@ int bt_mesh_trans_recv(struct net_buf_simple *buf, struct bt_mesh_net_rx *rx)
*
*/
if (IS_ENABLED(CONFIG_BLE_MESH_NODE) && bt_mesh_is_provisioned()) {
if (IS_ENABLED(CONFIG_BLE_MESH_LOW_POWER) &&
(bt_mesh_lpn_timer() ||
(bt_mesh_lpn_established() && bt_mesh_lpn_waiting_update()))) {
bt_mesh_lpn_msg_received(rx);
}
if (IS_ENABLED(CONFIG_BLE_MESH_LOW_POWER) &&
(bt_mesh_lpn_timer() ||
(bt_mesh_lpn_established() && bt_mesh_lpn_waiting_update()))) {
bt_mesh_lpn_msg_received(rx);
}
}
net_buf_simple_restore(buf, &state);
if (IS_ENABLED(CONFIG_BLE_MESH_NODE) && bt_mesh_is_provisioned()) {
if (IS_ENABLED(CONFIG_BLE_MESH_FRIEND) && rx->friend_match && !err) {
if (seq_auth == TRANS_SEQ_AUTH_NVAL) {
bt_mesh_friend_enqueue_rx(rx, pdu_type, NULL,
seg_count, buf);
} else {
bt_mesh_friend_enqueue_rx(rx, pdu_type, &seq_auth,
seg_count, buf);
if (IS_ENABLED(CONFIG_BLE_MESH_FRIEND) && rx->friend_match && !err) {
if (seq_auth == TRANS_SEQ_AUTH_NVAL) {
bt_mesh_friend_enqueue_rx(rx, pdu_type, NULL,
seg_count, buf);
} else {
bt_mesh_friend_enqueue_rx(rx, pdu_type, &seq_auth,
seg_count, buf);
}
}
}
}
return err;
}

View File

@ -7,10 +7,12 @@ CONFIG_BTDM_CONTROLLER_MODE_BTDM=
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n
CONFIG_BLE_SCAN_DUPLICATE=y
CONFIG_SCAN_DUPLICATE_TYPE=2
CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR=y
CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y
CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=y
CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=n
CONFIG_GATTS_ENABLE=y
CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL=y
CONFIG_BLE_MESH=y

View File

@ -10,10 +10,12 @@ CONFIG_BTDM_CONTROLLER_MODE_BTDM=
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n
CONFIG_BLE_SCAN_DUPLICATE=y
CONFIG_SCAN_DUPLICATE_TYPE=2
CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR=y
CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y
CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=y
CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=n
CONFIG_GATTS_ENABLE=y
CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL=y
CONFIG_BLE_MESH=y

View File

@ -7,10 +7,12 @@ CONFIG_BTDM_CONTROLLER_MODE_BTDM=
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n
CONFIG_BLE_SCAN_DUPLICATE=y
CONFIG_SCAN_DUPLICATE_TYPE=2
CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR=y
CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y
CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=y
CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=n
CONFIG_BLE_MESH=y
CONFIG_BLE_MESH_HCI_5_0=y
CONFIG_BLE_MESH_USE_DUPLICATE_SCAN=y

View File

@ -7,10 +7,12 @@ CONFIG_BTDM_CONTROLLER_MODE_BTDM=
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n
CONFIG_BLE_SCAN_DUPLICATE=y
CONFIG_SCAN_DUPLICATE_TYPE=2
CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR=y
CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y
CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=y
CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=n
CONFIG_BLE_MESH=y
CONFIG_BLE_MESH_HCI_5_0=y
CONFIG_BLE_MESH_USE_DUPLICATE_SCAN=y

View File

@ -7,10 +7,12 @@ CONFIG_BTDM_CONTROLLER_MODE_BTDM=
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n
CONFIG_BLE_SCAN_DUPLICATE=y
CONFIG_SCAN_DUPLICATE_TYPE=2
CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR=y
CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y
CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=y
CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=n
CONFIG_GATTS_ENABLE=y
CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL=y
CONFIG_BLE_MESH=y

View File

@ -7,10 +7,12 @@ CONFIG_BTDM_CONTROLLER_MODE_BTDM=
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n
CONFIG_BLE_SCAN_DUPLICATE=y
CONFIG_SCAN_DUPLICATE_TYPE=2
CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR=y
CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y
CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=y
CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=n
CONFIG_GATTS_ENABLE=y
CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL=y
CONFIG_BLE_MESH=y

View File

@ -7,10 +7,12 @@ CONFIG_BTDM_CONTROLLER_MODE_BTDM=
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n
CONFIG_BLE_SCAN_DUPLICATE=y
CONFIG_SCAN_DUPLICATE_TYPE=2
CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR=y
CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y
CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=y
CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=n
CONFIG_BLE_MESH=y
CONFIG_BLE_MESH_HCI_5_0=y
CONFIG_BLE_MESH_USE_DUPLICATE_SCAN=y

View File

@ -11,10 +11,12 @@ CONFIG_BTDM_CONTROLLER_MODE_BTDM=
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n
CONFIG_BLE_SCAN_DUPLICATE=y
CONFIG_SCAN_DUPLICATE_TYPE=2
CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR=y
CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=y
CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE=200
CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=y
CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=n
CONFIG_GATTS_ENABLE=y
CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL=y
CONFIG_BLE_MESH=y