Commit graph

159 commits

Author SHA1 Message Date
lly
bf4b513e83 ble_mesh: Group resends in proxy nodes [Zephyr]
Resend transport segments for groups on the advertiser interface, even
if a connected proxy node holds the group.
2020-05-11 15:42:45 +08:00
lly
91fff8c897 ble_mesh: Typo in condition in comp_add_elem of cfg_srv [Zephyr]
Vendor model IDs take up four (not two) bytes in the composition
2020-05-11 15:42:45 +08:00
lly
7ea60199a6 ble_mesh: GATT Proxy Spec 1.0.1 changes [Zephyr]
Backport of https://github.com/apache/mynewt-nimble/pull/724

Mesh spec 1.0.1 changes proxy disabling behavior to only affect the
relaying from proxy nodes. Previously, disabling proxy would shut down
all proxy and node activity.

Tweaks from the original commit:
- Removed redundant call to bt_mesh_adv_update() in gatt_proxy_set()
- Removed invalid ref to 4.2.11.1 in node_identity_set()

---

According to Mesh Profile Spec 1.0.1, Section 4.2.11:
"If the Proxy feature is disabled, a GATT client device can connect
over GATT to that node for configuration and control. Messages from
the GATT bearer are not relayed to the advertising bearer."

Moreover some notes have been removed from the spec compared to
version 1.0:

Mesh Profile Spec 1.0, Section 4.2.11:

"Upon transition from GATT Proxy state 0x01 to GATT Proxy state 0x00
the GATT Bearer Server shall disconnect all GATT Bearer Clients."

"The Configuration Client should turn off the Proxy state as the last
step in the configuration process."

Mesh Profile Spec 1.0, Section 4.2.11.1:

"When the GATT Proxy state is set to 0x00, the Node Identity state
for all subnets shall be set to 0x00 and shall not be changed."
2020-05-11 15:42:44 +08:00
lly
2b84b673bf ble_mesh: Support reliable sending when publishing [Zephyr]
Until now the choice of reliable sending (segmented messages with
acks) was implicitly dependent on the size of the payload. Add a new
member to the bt_mesh_model_pub to force using segment acks even when
the payload would fit a single unsegmented message.
2020-05-11 15:42:44 +08:00
lly
c2e24e306f ble_mesh: Check device uuid when init provisioning 2020-05-11 15:42:43 +08:00
lly
a85459e245 ble_mesh: Fix provisioning buffer initialization [Zephyr]
When PB-GATT support has been enabled the provisioning code "borrows"
the buffer from the proxy code. However, the way that initialization
was happening the proxy buffers were initialized only after
provisioning initialization, resulting in a corrupted buffer with
buf->data pointing to NULL. Reorder the initialization calls so that
proxy is done first and provisioning only after it.
2020-05-11 15:42:43 +08:00
lly
a0434371b0 ble_mesh: Skip publish if update fails [Zephyr]
Allow models to skip a periodic publish interval by returning an error
from the publish update callback.

Previously, an error return from publish update would cancel periodic
publishing. This can't be recovered from, and as such, no valid model
implementation could return an error from this callback, and there was
no way to skip a periodic publish.
2020-05-11 15:42:42 +08:00
lly
1717c2face ble_mesh: Enable Segmented Control Messages [Zephyr]
The function bt_mesh_ctl_send() used to support maximum length of
11 bytes. The segmentation complies with the BLE Mesh Standard.
The ack is disabled in case of non unicast address.
2020-05-11 15:42:42 +08:00
Island
27ae9d3e2c Merge branch 'bugfix/ble_mesh_provisioner_check_key_v4.1' into 'release/v4.1'
ble_mesh: Check if appkey exist before deleting it (v4.1)

See merge request espressif/esp-idf!8621
2020-05-06 18:17:02 +08:00
Island
7db21de3b3 Merge branch 'bugfix/ble_mesh_compile_error_o2_v4.1' into 'release/v4.1'
ble_mesh: Fix compile error when -O2 (performance) is chosen (v4.1)

See merge request espressif/esp-idf!8616
2020-05-06 18:15:53 +08:00
lly
78b13034ef ble_mesh: Fix node not erase info completely
Previously only mesh node info is supported to be stored
in flash. So when trying to reset the node, we only need
to judge if the BLE_MESH_VALID flag is set.
Currently we support storing both node & Provisioner info
in flash, when trying to erase the node info from flash,
the BLE_MESH_NODE flag will be checked. So we need to set
bt_mesh.flags to 0 when all the erase operations are done.
2020-05-06 11:43:43 +08:00
lly
099bf88b2e ble_mesh: Check if appkey exist before deleting it 2020-05-06 11:40:20 +08:00
lly
466d450b4b ble_mesh: Add length check for some mesh operations 2020-05-06 11:26:33 +08:00
lly
a742255f8e ble_mesh: Fix compile error when -O2 (performance) is chosen 2020-05-06 11:26:25 +08:00
Island
dd89b2dc0d Merge branch 'bugfix/ble_mesh_rpl_list_size_v4.1' into 'release/v4.1'
ble_mesh: Associate replay protection list size with nodes count (v4.1)

See merge request espressif/esp-idf!8493
2020-05-06 11:15:21 +08:00
Island
fefa9b7fe9 Merge branch 'doc/ble_mesh_fixes_v4.1' into 'release/v4.1'
doc: Fix some ble mesh description (v4.1)

See merge request espressif/esp-idf!8502
2020-05-06 11:13:16 +08:00
Island
547fd926a9 Merge branch 'bugfix/ble_mesh_add_missing_cpp_v4.1' into 'release/v4.1'
ble_mesh: Add missing #ifdef __cplusplus (v4.1)

See merge request espressif/esp-idf!8505
2020-05-06 11:12:13 +08:00
Island
d6cbfc7f19 Merge branch 'feat/ble_mesh_sensor_model_example_v4.1' into 'release/v4.1'
ble_mesh: Add ble mesh sensor model examples (v4.1)

See merge request espressif/esp-idf!8507
2020-05-06 11:11:59 +08:00
lly
4b1cbe87b3 ble_mesh: Fix client local parameters not initialized 2020-04-30 11:50:15 +00:00
lly
8b2291a718 ble_mesh: Continue node info restore even if failure happens
During BLE Mesh Provisioner initialization, the stack will restore
the nodes information if settings storage is enabled.
Previously when a failure happens (e.g. found the same uuid) during
the restore procedure, the information of the following nodes will
not be restored and error will be directly returned.
But this will introduce some problem with user experience, because
some newly provisioned nodes information will not be restored and
Provisioner will not be able to control those nodes.
So we change the operation here, when a failure happens during the
restore procedure, Provisioner will only ignore the information of
the current node and continue restoring other nodes information.
2020-04-30 11:50:15 +00:00
lly
fca4124f70 ble_mesh: Remove some redundant functions 2020-04-30 11:50:15 +00:00
lly
d35d765395 ble_mesh: Notify unprovisioned device beacon to application layer
With this change, if a Provisioner has provisioned the maximum
number of nodes, it can still report the unprovisioned device
beacon from other nodes to the application layer. And this will
be more reasonable compared with the previous implementation.
Previously when the node array of Provisioner is full, no beacon
from unprovisioned devices will be reported, only some warning
logs will be given.
2020-04-30 11:50:15 +00:00
lly
94092a148c ble_mesh: Check if assigned node address is duplicated
Previously only check the node address when it is assigned by the
application layer. Here we also check the address when the address
is allocated internally. And this will be useful when some mesh
internal tests are performed.
2020-04-30 11:50:15 +00:00
lly
68e8a7e0ba ble_mesh: Update next alloc address when node info is added 2020-04-30 11:50:15 +00:00
lly
62ac50f9d7 ble_mesh: Fix Provisioner provisioning deadlock 2020-04-30 11:50:15 +00:00
lly
fefd52f093 ble_mesh: Remove BLE_MESH_MAX_STORED_NODES option
Previously the BLE_MESH_MAX_STORED_NODES option is added for
internal mesh test, which will be a little confusing for the
users to understand.
Here we remove this option, instead the BLE_MESH_MAX_PROV_NODES
will be used for all the cases. For mesh internal test, when
the test function is called to add some nodes info, the info
will be stored in the array of provisioned nodes directly.
2020-04-30 11:50:15 +00:00
lly
7c379f8a65 ble_mesh: Associate replay protection list size with nodes count
The replay protection list of Provisioner should be at least equal
to the number of nodes with the precondition that each node contains
only one element.
The help information of replay protection list is updated, and the
maximum number of nodes for Provisioner is adjusted based on the
replay protection list size.
2020-04-30 11:50:15 +00:00
lly
c28828d255 doc: Fix some ble mesh description 2020-04-30 11:43:26 +00:00
lly
67eef52822 ble_mesh: Add some common macros for sensor model 2020-04-30 11:35:11 +00:00
lly
6f7acf6a21 ble_mesh: Allow empty sensor series column value 2020-04-30 11:35:11 +00:00
lly
df96c73471 ble_mesh: Check if same sensor (settings) property id exists 2020-04-30 11:35:11 +00:00
lly
3ceb5b3718 ble_mesh: Allow empty sensor settings exist 2020-04-30 11:35:11 +00:00
lly
d51bd36142 ble_mesh: Add missing #ifdef __cplusplus 2020-04-30 08:45:55 +00:00
lly
e6fc2a7bc8 ble_mesh: Fix time scene wrong macro name 2020-04-27 16:24:13 +08:00
lly
1ac44aa202 ble_mesh: Support BLE advertising simultaneously 2020-04-10 17:34:06 +08:00
lly
89f7e62011 ble_mesh: Add ble mesh white list test function
Using the ble mesh white list test functions, a node can choose to
only receive mesh messages from a specific node and relay the
messages for it. Messages from other nodes will be ignored.
2020-04-09 06:03:59 +00:00
lly
7815cd9ff4 ble_mesh: Fix ble mesh nimble host deinit 2020-03-17 16:18:50 +08:00
lly
6431a5e185 ble_mesh: Move dev_role to the end of model_pub 2020-03-13 19:24:49 +08:00
lly
27b28c0249 ble_mesh: Use the right netkey during iv update 2020-03-13 19:24:45 +08:00
lly
b29bc240a7 ble_mesh: Use the right net_idx & app_idx for publish 2020-03-13 19:24:37 +08:00
lly
940e87c0da ble_mesh: Check buf->ref before unref the buffer 2020-03-13 19:24:32 +08:00
lly
60eaca9637 ble_mesh: Fix mesh memory use-after-free issue 2020-03-13 19:24:27 +08:00
lly
e01333514d ble_mesh: Add ble mesh deinit in btc task 2020-03-13 19:24:23 +08:00
lly
f0519c674f ble_mesh: Free beacon timer when deinit mesh 2020-03-13 19:24:18 +08:00
lly
de9186b908 ble_mesh: Use lock for mesh timer operations 2020-03-13 19:24:12 +08:00
lly
8e34adb94c ble_mesh: Calc incomplete timeout based on msg info 2020-03-02 02:08:13 +00:00
lly
7d41eb6f52 ble_mesh: Start the timer when starting to send the client message 2020-03-02 02:08:13 +00:00
lly
2a014db549 ble_mesh: No timeout for client message to non-unicast address 2020-03-02 02:08:13 +00:00
lly
6c207ea6d2 ble_mesh: Unify client application and lower transport layer timeout 2020-03-02 02:08:13 +00:00
lly
2611e23bd2 ble_mesh: Allow maximum 377 octets payload 2020-03-02 02:08:13 +00:00