Commit graph

1494 commits

Author SHA1 Message Date
lly ad14507e3f ble_mesh: Use 24-bit functions [Zephyr]
Use 24-bit functions for byteorder and net_buf in order to make the
byteorder used more readable.
2020-05-21 15:19:47 +08:00
lly c9d1255ce4 ble_mesh: Optimize net_buf_simple routines [Zephyr]
Use sys_put_xyz() helpers instead of memcpy() whenever possible. This
brings in straight-line inline code for pushes and adds of known,
small sizes.
2020-05-21 15:19:46 +08:00
lly 25569cd9de ble_mesh: Add PRIu64 & PRIx64 in mesh_types.h 2020-05-21 15:19:46 +08:00
lly 416e8958fa ble_mesh: Add push functions for supported bit-variants [Zephyr]
Add push functions for bit-widths supported by add and pull functions.
2020-05-21 15:19:45 +08:00
lly cde1592bf3 ble_mesh: Add support for 64 bit data type [Zephyr]
This enables pulling and pushing values in 64 bit format.
2020-05-21 15:19:44 +08:00
lly 0af05fdee1 ble_mesh: Add support for 48 bit data type [Zephyr]
This enables pulling and pushing values in 48 bit format.
2020-05-21 15:19:44 +08:00
lly 4536a485be ble_mesh: Add 48 bit variants [Zephyr]
This adds sys_*_*48 functions that operation on a 48 bits values.
2020-05-21 15:19:43 +08:00
lly e7d37f2d1a ble_mesh: Add support for 24 bit data type [Zephyr]
This enables pulling and pushing values in 24 bit format.
2020-05-21 15:19:42 +08:00
lly fd17ff2f0b ble_mesh: Add 24 bit variants [Zephyr]
This adds sys_*_*24 functions that operation on a 24 bits values.
2020-05-21 15:19:41 +08:00
lly e322c5950b 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-21 15:19:41 +08:00
lly 1f96a6f35d 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-21 15:19:40 +08:00
lly 4fddf1156b 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-21 15:19:39 +08:00
lly 833483bb22 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-21 15:19:39 +08:00
lly 3d4948664b ble_mesh: Check device uuid when init provisioning 2020-05-21 15:19:38 +08:00
lly 203f871420 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-21 15:19:37 +08:00
lly 2c6a3f9e5b 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-21 15:19:36 +08:00
lly 2b6131b5f4 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-21 15:19:36 +08:00
Island 793d2b11f1 Merge branch 'bugfix/ble_mesh_not_ignore_msg_in_fast_prov_v4.0' into 'release/v4.0'
ble_mesh: Not ignore msg when fast prov is enabled (v4.0)

See merge request espressif/esp-idf!8711
2020-05-21 15:16:08 +08:00
Island 471171cb32 Merge branch 'feat/ble_mesh_sensor_model_example_v4.0' into 'release/v4.0'
ble_mesh: Add ble mesh sensor model examples (v4.0)

See merge request espressif/esp-idf!8508
2020-05-21 15:14:22 +08:00
Island 3b4ff12246 Merge branch 'bugfix/ble_mesh_compile_error_o2_v4.0' into 'release/v4.0'
ble_mesh: Fix compile error when -O2 (performance) is chosen (v4.0)

See merge request espressif/esp-idf!8617
2020-05-21 15:13:56 +08:00
Island 351dba9272 Merge branch 'bugfix/ble_mesh_provisioner_check_key_v4.0' into 'release/v4.0'
ble_mesh: Check if appkey exist before deleting it (v4.0)

See merge request espressif/esp-idf!8620
2020-05-21 15:13:31 +08:00
Island 7b6236c2d9 Merge branch 'bugfix/ble_mesh_node_reset_erase_v4.0' into 'release/v4.0'
ble_mesh: Fix node not erase info completely (v4.0)

See merge request espressif/esp-idf!8623
2020-05-21 15:12:21 +08:00
lly 9a654ec590 ble_mesh: Add some common macros for sensor model 2020-05-20 10:51:55 +00:00
lly 193828f121 ble_mesh: Allow empty sensor series column value 2020-05-20 10:51:55 +00:00
lly fab2dcb790 ble_mesh: Check if same sensor (settings) property id exists 2020-05-20 10:51:55 +00:00
lly d3619d0b45 ble_mesh: Allow empty sensor settings exist 2020-05-20 10:51:55 +00:00
Jiang Jiang Jian 4695eeddee Merge branch 'bufix/fix_v4.0_bluedroid_bugs_mr' into 'release/v4.0'
component/bt: fix notify malloc failed , fix no BLE_AUTH_CMPL_EVT and fix bluedroid btc deinit crash(backport 4.0)

See merge request espressif/esp-idf!8755
2020-05-16 19:53:15 +08:00
zhiweijian 6ee978c6aa add congest direct callback and fix malloc failed when multi_connection notify performance test 2020-05-15 16:18:31 +08:00
wangcheng d231b25bc4 fix bta_dm_deinit_cb crash 2020-05-15 16:16:26 +08:00
wangcheng 456c8bdbdf master missing BLE_AUTH_CMPL_EVT after restart 2020-05-15 16:16:26 +08:00
Hrishikesh Dhayagude 02c47360f1 Add NimBLE config options in sdkconfig.rename 2020-05-14 11:31:53 +10:00
lly b47111c708 ble_mesh: Not ignore msg when fast prov is enabled
When fast provisioning is enabled, Provisioner shall not
ignore messages from the nodes whose addresses are not in
the provisioning database. Because other nodes which are
not provisioned by the Primary Provisioner will send node
address messages to the Primary Provisioner.
2020-05-13 10:09:50 +08:00
lly 814108f9ac ble_mesh: Add length check for some mesh operations 2020-05-07 09:18:15 +00:00
lly baf0fb3576 ble_mesh: Fix compile error when -O2 (performance) is chosen 2020-05-07 09:18:15 +00:00
lly a895bb157f 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-07 09:16:51 +00:00
lly 30c645d9c2 ble_mesh: Check if appkey exist before deleting it 2020-05-06 11:39:02 +08:00
Island 5f71ec3640 Merge branch 'bugfix/ble_mesh_rpl_list_size_v4.0' into 'release/v4.0'
ble_mesh: Associate replay protection list size with nodes count (v4.0)

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

See merge request espressif/esp-idf!8503
2020-05-06 11:12:57 +08:00
Island beb64a1af4 Merge branch 'bugfix/ble_mesh_add_missing_cpp_v4.0' into 'release/v4.0'
ble_mesh: Add missing #ifdef __cplusplus (v4.0)

See merge request espressif/esp-idf!8506
2020-05-06 11:12:25 +08:00
lly b97d4c617b ble_mesh: Fix time scene wrong macro name 2020-04-27 16:26:23 +08:00
lly 765bd76ba3 ble_mesh: Add missing #ifdef __cplusplus 2020-04-27 15:34:14 +08:00
lly 9370264cac doc: Fix some ble mesh description 2020-04-27 15:25:46 +08:00
lly 8bfa01cc28 ble_mesh: Fix client local parameters not initialized 2020-04-27 14:39:40 +08:00
lly 90a9444696 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-27 14:39:40 +08:00
lly b9fd2673a7 ble_mesh: Remove some redundant functions 2020-04-27 14:39:39 +08:00
lly 7595116353 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-27 14:39:38 +08:00
lly 9aae0f2dee 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-27 14:39:38 +08:00
lly f137546a4b ble_mesh: Update next alloc address when node info is added 2020-04-27 14:39:37 +08:00
lly 388043c203 ble_mesh: Fix Provisioner provisioning deadlock 2020-04-27 14:39:37 +08:00
lly c496fa79de 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-27 14:39:36 +08:00