Commit graph

133 commits

Author SHA1 Message Date
lly 3e61d519c1 ble_mesh: stack: Fix rpl not check by proxy cfg [Zephyr] 2020-10-13 14:32:36 +08:00
lly 542b6bdbc1 ble_mesh: stack: Persistent storage misc fixes
* Fix the issue that deinit node with "erase_flash"
  set to true, but info is not erased from nvs
* Reuse bt_mesh_cfg_reset() when deinit node
* Optimize Provisioner related erase operations
* No store pending timeout will be used when Node
  is not provisioned OR Provisioner is disabled
  and erase operation is performed
* Change the default timeout for settings operation
  to 0, and rpl store rate to 0
2020-10-13 10:55:58 +08:00
lly b4c3c87c75 ble_mesh: stack: Use settings_core_erase when deinit 2020-10-12 10:02:05 +08:00
lly 3940ab80a3 ble_mesh: stack: Fix storing next net_idx and app_idx 2020-10-12 10:02:05 +08:00
lly d7c2d66d55 ble_mesh: stack: Continue restore even if failure happens
Previously we have used this solution for node info
restore. Here use the same solution for other mesh
information restore.
2020-10-12 10:02:05 +08:00
lly 4fc62b7983 ble_mesh: stack: Split model settings store and clear 2020-10-12 10:02:05 +08:00
lly de15e502a7 ble_mesh: stack: Erase netkey and appkey with key index 2020-10-12 10:02:05 +08:00
lly d51431fff5 ble_mesh: stack: Add clear hb_pub in settings 2020-10-12 10:02:05 +08:00
lly d4651bbb30 ble_mesh: stack: Transport rx reset settings update
When reset the rx info of transport layer, the
rpl list will always cleared, and rpl stored
in the nvs will only be erased when erase flag
is true and BLE_MESH_SETTINGS is enabled.
Compared with the previous solution, it should
be more clear.
2020-10-12 10:02:05 +08:00
lly e202225bd1 ble_mesh: stack: Use erase settings functions 2020-10-12 10:02:05 +08:00
lly 1a3515ab76 ble_mesh: stack: Use mutex for settings operation
Also expose the settings functions with the parameter
bt_mesh_nvs_handle_t, which will be used for further
updates.
2020-10-12 10:02:05 +08:00
lly a662d14a4e ble_mesh: stack: Add role check before enabling device 2020-10-12 10:02:05 +08:00
lly 4dcbe2bd7a ble_mesh: stack: Define a type for mesh nvs handle 2020-10-12 10:01:47 +08:00
lly 81354cf24f ble_mesh: stack: Optimize Provisioner delete device function
Since we have provided separate functions for deleting node
information with node's unicast address, device uuid, etc.
So we update the behavior of this function, which will only
be used to delete device information which is not provisioned
or just under provisioning.
2020-09-25 14:04:58 +08:00
lly 1f32a8d95e ble_mesh: stack: Check if mesh stack initialized before init vendor client 2020-09-17 11:28:02 +08:00
lly 34f30a878e ble_mesh: stack: Using the latest iv_index for provisioning
Provisioner should always uses the latest IV Index for provisioning.
For example, if the current IV Index is 0x00000001, but prov->iv_index
is still initialized with 0x00000000, and if Provisioner uses prov->
iv_index for provisioning, this will cause the Provisioner failing to
control the node.
So here bt_mesh.iv_index is used instead of prov->iv_index.
2020-09-11 07:58:20 +00:00
Island 6c5fc42114 Merge branch 'feat/ble_mesh_use_model_c_v3.3' into 'release/v3.3'
ble_mesh: stack: Use model callback for operations [Zephyr] (v3.3)

See merge request espressif/esp-idf!10365
2020-09-10 10:40:19 +08:00
Island 7514850962 Merge branch 'bugfix/ble_mesh_remove_assert_v3.3' into 'release/v3.3'
ble_mesh: stack: Avoid using assert in mesh stack (v3.3)

See merge request espressif/esp-idf!10361
2020-09-10 10:39:21 +08:00
lly 9b70ddbb77 ble_mesh: stack: Use model callback for operations [Zephyr]
- Previously when a model is initialized or deinitialized, in the
  access layer, we need to check the model id with the ids in the
  table in order to find the proper model operation function.
- Currently all the operation functions of each model will be set
  during the mesh initialization. When the model is found, we can
  directly use the corresponding callback for different operations.
- Currently only init/deinit operations are registered, later we
  will add more operations.
2020-09-09 14:01:17 +08:00
lly 1090c12acd ble_mesh: stack: Avoid using assert in mesh stack 2020-09-09 10:58:18 +08:00
lly d79e95e6e0 ble_mesh: nimble: Fix updating ccc handle with wrong value 2020-09-09 10:50:40 +08:00
lly 31060cf42b ble_mesh: stack: Client model related code clean 2020-08-31 13:18:53 +08:00
lly 8a19d03a1c ble_mesh: stack: Rename cfg & health client status recv func 2020-08-31 13:18:48 +08:00
lly d5e9fc092c ble_mesh: stack: Check client msg result in common func 2020-08-31 13:18:42 +08:00
lly 7cb6b85ec9 ble_mesh: stack: Remove some not used variables & functions 2020-08-31 13:18:18 +08:00
lly f11e347e2e ble_mesh: stack: Update client model msg send 2020-08-31 13:18:11 +08:00
lly 726c74ff39 ble_mesh: stack: Fix recv health current status incorrectly 2020-08-28 17:40:59 +08:00
lly ff1132d2e4 ble_mesh: stack: Only keep func pointer for very common log
Currently only keep func pointer for the followings:
- Invalid parameter (mesh btc & mesh stack)
- Out of memory (mesh btc & mesh stack)
- Unknown act (mesh btc)
- Invalid model user data (mesh stack)
- BT_DBG("%s", __func__) (mesh btc & mesh stack)
- A few other specific situations (buf ref debug, send status check)
2020-08-28 10:51:17 +08:00
lly 6ea6de8d42 ble_mesh: stack: Make proxy server & client functions clear 2020-08-28 10:51:02 +08:00
lly f6cc9afaa9 ble_mesh: stack: Add proxy cfg pdu length check 2020-08-27 11:20:50 +00:00
lly 55489bb41a ble_mesh: stack: Rework using dev flag to check scan status
Different bluetooth host has different behaviors, so it's better
to maintain a scan check mechanism of BLE Mesh itself.
Fixes an issue when only PB-GATT is enabled for node, which will
output a scan error log when the device is provisioned.
2020-08-27 11:20:50 +00:00
lly c1c4990f75 ble_mesh: stack: Add more checks about input prov bearers 2020-08-27 11:20:50 +00:00
lly 2a6b0d68ce ble_mesh: stack: Rename mesh adv queue and relay queue 2020-08-26 08:24:55 +00:00
lly da068a639f ble_mesh: stack: Use macros for adv task name & prio 2020-08-26 08:24:55 +00:00
lly df8b2c5f3a ble_mesh: stack: Make freertos static allocation visible 2020-08-26 08:24:55 +00:00
lly 8753fb359a ble_mesh: stack: Update some fast prov functions 2020-07-03 08:54:59 +08:00
lly bbf4ce8d18 ble_mesh: stack: Move fast prov functions to a single file 2020-07-03 08:54:51 +08:00
lly 9060de827f ble_mesh: Remove the previously added redundant aes files 2020-07-02 03:38:18 +00:00
lly f835011e2f ble_mesh: stack: Fix compile error when only proxy enabled
Also remove some redundant CONFIG_BLE_MESH_PROXY checks, because
when the following options are satisfied, the CONFIG_BLE_MESH_PROXY
option will be selected mandatorily.
2020-07-01 12:32:04 +08:00
lly 9f6375db50 ble_mesh: Check if subnet exists before updating beacon_sent
- Before updating the "beacon_sent" of a subnet, we need to check
  if the subnet still exists, especially for a Provisioner.
- Fix a bug which will cause Provisioner failed to send Secure
  Network Beacon if no device is provisioned
2020-06-30 09:23:28 +08:00
lly ad970addf0 ble_mesh: Get node info with pre-configured node name
Also add a function to get the entry of the nodes table.

Closes https://github.com/espressif/esp-idf/issues/5397
2020-06-24 11:53:59 +00:00
Island ad2447a6ea Merge branch 'bugfix/ble_mesh_remove_relay_dependency_v3.3' into 'release/v3.3'
ble_mesh: Remove relay option dependency (v3.3)

See merge request espressif/esp-idf!9028
2020-06-03 15:20:56 +08:00
Island 686530d373 Merge branch 'bugfix/ble_mesh_example_nvs_store_v3.3' into 'release/v3.3'
Bugfix/ble mesh example nvs store (v3.3)

See merge request espressif/esp-idf!9018
2020-06-03 15:12:28 +08:00
Island c3902be87f Merge branch 'bugfix/ble_mesh_model_recv_fix_v3.3' into 'release/v3.3'
Bugfix/ble mesh model recv fix (v3.3)

See merge request espressif/esp-idf!9009
2020-06-03 15:11:38 +08:00
Island 88937185ac Merge branch 'bugfix/ble_mesh_rework_prov_pdu_len_check_v3.3' into 'release/v3.3'
ble_mesh: Rework prov pdu length check (v3.3)

See merge request espressif/esp-idf!9005
2020-06-03 15:11:11 +08:00
lly 7937a51779 ble_mesh: Remove relay option dependency
When the relay functionality of a node is not enabled, this
issue will cause the node failing to send messages to fixed
group.
2020-06-02 19:19:18 +08:00
lly 36c476833f ble_mesh: Optimize some send & recv logs 2020-06-02 14:05:12 +08:00
lly ac565c97a3 ble_mesh: correct the return type [Zephyr] 2020-06-02 10:33:12 +08:00
lly ac76870ad7 ble_mesh: Optimize model recv operations [Zephyr]
Previously the model recv operation is a littl fuzzy.
With the changes, the model recv operation is splitted into:
- find op
- check app_idx
- check dst
- check length
- update info & handle message
2020-06-02 10:32:57 +08:00
lly a96e1b80ac ble_mesh: Rework prov pdu length check 2020-06-02 10:17:20 +08:00