Commit graph

1376 commits

Author SHA1 Message Date
Jiang Jiang Jian fb924ece79 Merge branch 'bugfix/btdm_fix_multi_open_evt_and_clear_blufi_prepare_write_len' into 'release/v4.0'
component/bt: fix multi open evt and clear blufi prepare write len(backport v4.0)

See merge request espressif/esp-idf!7324
2020-02-13 11:08:41 +08:00
Jiang Jiang Jian e07a64925b Merge branch 'bugfix/coex_bt_ble_stuck_v4.0' into 'release/v4.0'
components/bt: Fix A2DP stuck when BLE's interval is too small

See merge request espressif/esp-idf!7220
2020-02-13 11:08:20 +08:00
Jiang Jiang Jian e07ecea868 Merge branch 'hfp_a2dp_iphone_4.1' into 'release/v4.0'
components bt/: Disable sniff mode during (e)SCO connection for HFP. [backport 4.0]

See merge request espressif/esp-idf!7249
2020-02-13 11:08:10 +08:00
Jiang Jiang Jian d5bd2256f4 Merge branch 'bugfix/fix_ble_mesh_memory_leak_v4.0' into 'release/v4.0'
ble_mesh: Fix memory leak when node is reset (v4.0)

See merge request espressif/esp-idf!7278
2020-02-13 10:58:09 +08:00
Jiang Jiang Jian c235640bf4 Merge branch 'bugfix/ble_mesh_update_lightness_last_v4.0' into 'release/v4.0'
ble_mesh: Update lightness last state when actual state is changed (v4.0)

See merge request espressif/esp-idf!7281
2020-02-13 10:58:06 +08:00
lly 04fc15a4f3 ble_mesh: Fix memory leak when node is reset
When node is being reset, the init functions of each sig-defined
models will be invoked again, this will cause memory leak because
some model internal data will be allocated again.
Hence before trying to allocate memory for them, we add some check
to make sure no memory has been allocated previously.
And for client model, when the init functions are invoked again,
we will clear the list items.
2020-02-12 12:03:31 +00:00
zhiweijian 93409bd57e component/bt: fix blufi prepare write buf len invalid 2020-01-14 17:25:54 +08:00
zhiweijian 32ba52760f Component/bt: Fix GATTC trigger open event multiple times 2020-01-14 17:24:36 +08:00
lly 14a408c478 ble_mesh: Fix PreviousAddress endianess in Friend Request
The upper transport layer is using big endian ordering. The
PreviousAddress field of a Friend Request message should therefore
be converted to native endianess using sys_cpu_to_be16().
2020-01-13 10:40:25 +08:00
lly 92d0d7ad49 ble_mesh: Fix next_period computation
If the duration to publish is roughly the same as the period, we might
end up with elapsed == period, which returns 0 and cancel the periodic
publication. Instead 1 should be returned, just like when the elapsed
time is greater than the period.
2020-01-13 10:40:20 +08:00
lly 19c9ae400b ble_mesh: Make model publication struct more compact
Previously the FastPeriodDivisor value was introduced to the model
publication struct. Based on the way it was grouped it seems the
intention was to fit it within the same octet as other bit fields,
but it actually makes the octet overflow by one bit. This ends up
creating another u8_t variable which in turn adds 24 bits of padding
after it.

To keep the size of the struct as compact as possible, group the flag
together with the key index, since that only requires 12 bits. Some
care is needed here, since the mesh stack does have special internal
key index values that require more than 12 bits such as
BLE_MESH_KEY_UNUSED and BLE_MESH_KEY_DEV. In this case restricting
ourselves to 12 bits is fine since the value in the model publication
struct follows 1:1 the value received in the Config Model Publication
Set message, and there the parameter is defined to be exactly 12 bits.
2020-01-13 10:40:13 +08:00
lly 566fb11a73 ble_mesh: Fix compile error when using release optimization level 2020-01-13 10:40:05 +08:00
lly 928480ada9 ble_mesh: Remove useless CONFIG_BLE_MESH_NODE
For Low Power node and Proxy Server, the two features
depend on BLE_MESH_NODE in Kconfig.in, here in the
stack there is no need to judge if CONFIG_BLE_MESH_NODE
is enabled.
2020-01-13 10:39:57 +08:00
lly da0205b166 ble_mesh: Fixes Provisioner not support friend feature 2020-01-13 10:39:52 +08:00
lly 610fc8124a ble_mesh: Fixes wrong subnet info used for Friend Clear
When Friend node tries to send Friend Clear message to other
Friend nodes, it should use the subnet information based on
the net_idx from friendship.
2020-01-13 10:39:42 +08:00
lly 21dbee1291 ble_mesh: fix provisioner failed to send msg to 0xFFFF
According to Mesh Spec 3.4.5.3, a node shall implement a local
network interface. And here we limit the situation just based
on the spec, and Provisioner directly sending the msg without
passing through the local network interface.
2020-01-13 10:39:37 +08:00
lly e5431e55a9 ble_mesh: fix virtual addr wrong return value
Fixes missing return value on `va_del`
Fixes wrong return value on `va_add`
2020-01-13 10:39:28 +08:00
lly 4405560483 ble_mesh: Persistent storage of Virtual Address
The 16-bit format group addresses will be stored,
but we don't store (or restore) the virtual label UUIDs,
i.e. after a power cycle the 16-bit group addresses
would be meaningless.
2020-01-13 10:39:22 +08:00
lly 51616eacee ble_mesh: Proxy forwards ALL_NODES addr
Unless explicitly blacklisted, the Proxy node will forward all messages
for the ALL_NODES address to the GATT proxy client.
2020-01-13 10:39:15 +08:00
lly 4aa7f31f02 ble_mesh: Model message macros
Creates macros for determining model message lengths based on opcode,
payload length and MIC size. Also adds macro wrapping
NET_BUF_SIMPLE_DEFINE to serve the most common use case.
2020-01-13 10:39:10 +08:00
lly 318f83e33a ble_mesh: Use net_buf_simple_clone
Uses net_buf_simple_clone to access the sdu of an unsegmented app packet
for re-encryption.
2020-01-13 10:39:03 +08:00
lly 4bf2ceee4e ble_mesh: Skip local messages in rx
Local messages are already enqueued for the LPN in the tx path, and
don't have to be added again in the rx path.
2020-01-13 10:38:59 +08:00
lly a9c5092baf ble_mesh: Ensure seqnum match in app/net
Re-encrypts single-segment application messages when the network seqnum
has changed, to avoid encrypting messages with different seqnums in
network and transport. This operation is only required for unsegmented
messages, as segmented messages don't need to use the same seqnum in
network.

Reinstates the special adv data for friend messages to store the app key
index.
2020-01-13 10:38:54 +08:00
lly 9e47e04897 ble_mesh: Expose app key get function 2020-01-13 10:38:48 +08:00
lly ca0bfb84d0 ble_mesh: Expose header parsing outside net 2020-01-13 10:38:38 +08:00
lly cc772c1324 ble_mesh: Remove unused macro FRIEND_BUF_SIZE 2020-01-13 10:38:31 +08:00
lly c344a4a3b9 ble_mesh: Make RSSI value available to mesh applications 2020-01-13 10:38:26 +08:00
lly 32387250bc ble_mesh: Encrypt friend packets on send
Stores friend queue packets unencrypted, removing any out-of-order
issues caused by seqnum allocation. Also moves as much of the metadata
storage as possible into the packet, allowing us to free up some bytes
of net_buf user data for friend packets.
2020-01-13 10:38:21 +08:00
lly a870460f72 ble_mesh: Expose SeqZero mask
Makes a define for the seqzero 13-bit mask in transport, and exposes it
in the header for use in the friend module.
2020-01-13 10:38:15 +08:00
lly cf2c5b8d96 ble_mesh: Update lightness last state when actual state is changed 2020-01-10 15:33:59 +08:00
weitianhua a388eb8806 componnets_bt/:fix hfp/a2dp coex bug with iphone 2020-01-08 19:25:29 +08:00
baohongde 3ae110b30c components/bt: Fix A2DP stuck when BLE's interval is too small
1. Fix the cumulative time switch from BLE to classic BT
2. Enhance classic BT performance while enable calssic BT and BLE at the same time
2020-01-06 20:31:54 +08:00
baohongde d93bff2699 components/bt: Revert changes of security mask 2019-12-29 06:29:23 +00:00
Jiang Jiang Jian d41c020649 Merge branch 'bugfix/fix_ble_mesh_adv_buf_unref_v4.0' into 'release/v4.0'
ble_mesh: Fix adv buf unref and link_id in exceptional list (v4.0)

See merge request espressif/esp-idf!7080
2019-12-22 16:02:24 +08:00
lly 53e6eb8467 ble_mesh: Fix using wrong name for PB-GATT 2019-12-20 17:13:20 +08:00
lly ebaa3e1c3e ble_mesh: Fix adv buf unref and link_id in exceptional list 2019-12-20 17:13:15 +08:00
lly 23770edb43 ble_mesh: Add unlock when failed to create alarm 2019-12-20 15:34:10 +08:00
lly 6ea738eeb0 ble_mesh: Rename ble mesh lock/unlock functions
Rename BLE Mesh internal lock/unlock functions, also seperate
the list, buf and atomic lock/unlock functions
2019-12-20 15:34:06 +08:00
lly 3e6d04fc86 ble_mesh: Use mutex to protect client list operations 2019-12-20 15:34:01 +08:00
lly 9dc45e788d ble_mesh: Remove useless parameters of lock/unlock 2019-12-20 15:33:56 +08:00
lly bf712e4f91 ble_mesh: Client model check timer remaining time
Before handling status message, client models need check if the
corresponding timer has expired. And if timeout happens, the
status message will be treated as a publish message.
2019-12-20 15:33:50 +08:00
Geng Yu Chao f955c49423 Bugfix/btdm fix doc and host bug backport v4.0 2019-12-18 14:19:27 +08:00
baohongde a82215d161 components/bt: Fix AVRC metadata length error 2019-12-14 05:48:26 +00:00
Chinmay Chhajed 2887131b39 Changes in menuconfig options to not compile any host when using hci
examples as no host is required there.
2019-12-06 12:09:16 +08:00
Jiang Jiang Jian a5b803540a Merge branch 'bugfix/btdm_allow_start_adv_again_v4.0' into 'release/v4.0'
component/bt: allow to send stop adv again and fix tx prog crash(backport v4.0)

See merge request espressif/esp-idf!6653
2019-12-04 20:24:07 +08:00
Prasad Alatkar 69c86bc37e NimBLE: Fix erroneous behaviour of NPL when controller not ready to receive (Backport v4.0) 2019-12-01 17:53:49 +08:00
zhiweijian 8d189d9fb4 component/bt: allow adv stop again when adv is already stoped and fix crash when tx prog sometimes 2019-11-27 20:15:08 +08:00
weitianhua e7a6fdca54 component/bt: Fix bugs in HFP feature 2019-11-27 16:48:26 +08:00
Jiang Jiang Jian 48dfbe05a4 Merge branch 'fixed_queue_v4.0' into 'release/v4.0'
component_bt/: Fix_pointer_type_fixed_queue v4.0

See merge request espressif/esp-idf!6846
2019-11-27 16:39:51 +08:00
weitianhua 5d00321d07 fix_pointer_type_fixed_queue 2019-11-27 15:06:15 +08:00