Commit graph

8893 commits

Author SHA1 Message Date
lly 01a8a6c150 ble_mesh: Split mesh mutex into a separate file 2020-05-11 02:29:18 +00:00
lly c493be489f ble_mesh: Rename mesh_kernel.* to mesh_timer.* 2020-05-11 02:29:18 +00:00
lly 25dfee4bdd ble_mesh: Add and use transport macro definitions [Zephyr] 2020-05-11 02:29:18 +00:00
lly df525bf0b3 ble_mesh: Friend SeqAuth cleanup [Zephyr]
The Friend queue uses the message SeqAuth to determine whether the
message is already in the queue. To facilitate this, the SeqAuth is
passed around as a pointer throughout the transport modules. In the
bt_mesh_ctl_send functions, this parameter is also exposed in the API,
but the internal usage is inconsistent and buggy. Also, no one actually
uses this parameter.

- Removes seq_auth param from bt_mesh_ctl_send, instead passing NULL
  directly to the friend module, to enforce its addition to the queue.
- Makes the seq_auth pointer const throughout the friend module.
2020-05-11 02:29:18 +00:00
lly cd58874a9b ble_mesh: Rework msg_cache [Zephyr]
Changes the behavior of the message cache to optimize for cache
capacity. Previously, the message cache's primary function was to avoid
decrypting messages multiple times, although the cache's main function
in the spec is to avoid message rebroadcasting. Optimizing for minimal
decryption causes us to fill the network cache faster, which in turn
causes more cache misses, potentially outweighing the advantage.

Now stores src + seq in message cache instead of field hash value. This
cuts cache size in two, while including more of the sequence number than
before.

Adds messages to the cache only after the packet is successfully
decrypted. This reduces noise in the cache, and ensures that no
invalid deobfuscations are added.

Additionally, this fixes a bug where multiple calls to net_decrypt with
the same packet failed, as the message cache found its own entry from
the previous call.
2020-05-11 02:29:18 +00:00
lly ef8206cdc6 ble_mesh: Segmented TX to groups [Zephyr]
Implements several changes to the transport layer segmented tx to
improve group message performance:
- Moves retransmit counter to tx context instead of per packet. As every
  unacked packet is sent every retransmit, the retransmit counters would
  be the same in each segment. This makes it easier to control progress.
- Delays the scheduling of the retransmit until the completion of the
  last segment by adding a seg_pending counter. This is essentially the
  same as the old behavior, except that the old behavior might retrigger
  the sending before all segments are finished if the advertising is
  slow.
- Allows the group transmits to stop as soon as all retransmits have
  been exhausted, instead of timing out waiting for acks that won't
  come. This allows group tx to finish without error.
- Fixes a bug where a failed TX would block IV update.
- Cancels any pending transmissions of acked segments.
- Reduces log level for several common group tx scenarios that aren't
  erronous.
2020-05-11 02:29:18 +00:00
lly fd9a16805a ble_mesh: Add comment explaining use of byte order [Zephyr]
Add comment that explains why a different byte order is used for the
3-byte opcode on the CID part of the opcode.
2020-05-11 02:29:18 +00:00
lly 4d1d5261cc 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-11 02:29:18 +00:00
lly da99734ba8 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-11 02:29:18 +00:00
lly 4fd1b2db0e ble_mesh: Add PRIu64 & PRIx64 in mesh_types.h 2020-05-11 02:29:18 +00:00
lly fb84166cbd ble_mesh: Add push functions for supported bit-variants [Zephyr]
Add push functions for bit-widths supported by add and pull functions.
2020-05-11 02:29:18 +00:00
lly ee1eb994b7 ble_mesh: Add support for 64 bit data type [Zephyr]
This enables pulling and pushing values in 64 bit format.
2020-05-11 02:29:18 +00:00
lly b186be52f0 ble_mesh: Add support for 48 bit data type [Zephyr]
This enables pulling and pushing values in 48 bit format.
2020-05-11 02:29:18 +00:00
lly 23c8bbcbf5 ble_mesh: Add 48 bit variants [Zephyr]
This adds sys_*_*48 functions that operation on a 48 bits values.
2020-05-11 02:29:18 +00:00
lly 4e1d3974fb ble_mesh: Add support for 24 bit data type [Zephyr]
This enables pulling and pushing values in 24 bit format.
2020-05-11 02:29:18 +00:00
lly 26dbfdcb9d ble_mesh: Add 24 bit variants [Zephyr]
This adds sys_*_*24 functions that operation on a 24 bits values.
2020-05-11 02:29:18 +00:00
lly 95440c4d28 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 02:29:18 +00:00
lly 1f47cfff7f 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 02:29:18 +00:00
lly 31b175e372 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 02:29:18 +00:00
lly e385197c27 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 02:29:18 +00:00
lly cc549897d5 ble_mesh: Check device uuid when init provisioning 2020-05-11 02:29:18 +00:00
lly ca3d1637ca 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 02:29:18 +00:00
lly 6c868a070b 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 02:29:18 +00:00
lly aad8908d9c 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 02:29:18 +00:00
Michael (XIAO Xufeng) f7ec57b615 Merge branch 'feature/usb_wrap_headers' into 'master'
usb: add usb_wrap headers, move some code from LL to HAL

See merge request espressif/esp-idf!8395
2020-05-10 19:19:14 +08:00
David Čermák e86f530e42 Merge branch 'bugfix/mdns_config_stacksize' into 'master'
mdns: Allow config mDNS task stack size (GitHub PR)

Closes IDFGH-3219

See merge request espressif/esp-idf!8635
2020-05-09 19:49:15 +08:00
Jiang Jiang Jian 27d0ca52b2 Merge branch 'bugfix/fix_memleak_in_wpa3_feature' into 'master'
fix(wpa_supplicant): fix memleak in wpa3 feature

See merge request espressif/esp-idf!8643
2020-05-08 22:34:01 +08:00
Mahavir Jain 5425ef85ce Merge branch 'bugfix/pthread_tcb_cleanup_wrapper' into 'master'
Fix linking for vPortCleanUpTCB wrapper

See merge request espressif/esp-idf!8652
2020-05-08 21:31:35 +08:00
Krzysztof Budzynski fc4a5609ac Merge branch 'bugfix/docs_esp_https_ota' into 'master'
Resolve documentation issue reported by boarchuz in...

See merge request espressif/esp-idf!8648
2020-05-08 16:30:42 +08:00
Shubham Kulkarni 4a83b488a8 pthread: Use INTERFACE in target_link_libraries for vPortCleanUpTCB wrapper 2020-05-08 11:55:23 +05:30
Michael (XIAO Xufeng) 178c7c2e82 Merge branch 'bugfix/spi_lock_suppress_alter_log' into 'master'
spi: suppress spi_bus_lock_touch log level

Closes IDFGH-3030

See merge request espressif/esp-idf!8634
2020-05-08 11:26:11 +08:00
Krzysztof f1c7b0ba6f Resolve documentation issue reported by boarchuz in https://esp32.com/viewtopic.php?f=5&t=14148#p59419 2020-05-07 22:00:27 +02:00
Axel Lin cf7e48c779 mdns: Allow config mDNS task stack size
Signed-off-by: Axel Lin <axel.lin@gmail.com>

Merges https://github.com/espressif/esp-idf/pull/5216
2020-05-07 21:49:02 +02:00
David Čermák 3a2f059f11 Merge branch 'bugfix/pppos_connect_dhcpc_failed' into 'master'
esp_netif: fix default connect handler to check dhcpc return value

Closes IDFGH-3173

See merge request espressif/esp-idf!8581
2020-05-08 03:25:09 +08:00
David Cermak 65b993234d esp_hid: fix memory leak if getting dev reports fails 2020-05-07 12:56:54 +00:00
Mahavir Jain d7fb9d54ba Merge branch 'feature/get_url' into 'master'
Add API to get URL from HTTP client

Closes IDFGH-3094

See merge request espressif/esp-idf!8637
2020-05-07 17:57:16 +08:00
Zhang Jun Hao e9b3feb85d fix(wpa_supplicant): fix memleak in wpa3 feature 2020-05-07 17:28:07 +08:00
Shubham Kulkarni 890f541edf esp_http_client: Add API to get URL from client
Closes: https://github.com/espressif/esp-idf/issues/5115
2020-05-07 14:20:28 +05:30
Angus Gratton b2fe7f681e Merge branch 'bugfix/esp32_eco3_init_syscall_table' into 'master'
newlib: initialize syscall_table_ptr_app in single core mode

Closes IDFGH-3254

See merge request espressif/esp-idf!8596
2020-05-07 15:17:13 +08:00
Mahavir Jain a2263571b5 Merge branch 'feature/mbedtls_chacha_poly' into 'master'
mbedtls: Add config options for chacha20, poly1305 and chachapoly

See merge request espressif/esp-idf!8605
2020-05-07 03:44:23 +08:00
Michael (XIAO Xufeng) e04bb43b9f spi: suppress spi_bus_lock_touch log level
The log in the spi_bus_lock_touch may be annoying. This commit suppress 
the log level, and make the log visible only when the device altered.

Resolves https://github.com/espressif/esp-idf/issues/5056
2020-05-07 00:32:24 +08:00
David Čermák a064e0c4de Merge branch 'bugfix/tcp_connect_tout' into 'master'
tcp_transport: Implement connect timeout

Closes IDFGH-2971, IDFGH-2810, and IDFGH-1541

See merge request espressif/esp-idf!8428
2020-05-06 20:07:05 +08:00
Ivan Grokhotkov d5195d19ae Merge branch 'feature/endian_h_compat_header' into 'master'
newlib: add endian.h header file for compatibility (Github PR)

See merge request espressif/esp-idf!8236
2020-05-06 16:54:41 +08:00
Jiang Jiang Jian 09d4767947 Merge branch 'mesh/power_save_function' into 'master'
mesh/ps: add duty control and support only transmit/receive on active duty

See merge request espressif/esp-idf!8152
2020-05-06 15:53:49 +08:00
David Cermak c2053a8e65 esp_netif: fix default connect handler to check dhcpc return value
Closes https://github.com/espressif/esp-idf/issues/5184
2020-05-06 07:26:50 +02:00
Ivan Grokhotkov a97cd645ad Merge branch 'bugfix/linenoise_stack_alloc' into 'master'
console: linenoise: move allocations from stack to heap, fix calloc result checking (Github PR)

Merges https://github.com/espressif/esp-idf/pull/5161

Closes IDFGH-3144

See merge request espressif/esp-idf!8612
2020-05-06 13:21:56 +08:00
Ivan Grokhotkov 30a6a8f932 Update linenoise.c: calloc returning NULL is not handled
Calloc function tries to allocate 4096 bytes.
If such memory is not available, it returns NULL pointer.
This exception was not handled in the code, causing a dirty crash.
2020-05-06 13:21:56 +08:00
Jiang Jiang Jian 62c36a0372 Merge branch 'feature/enable_wpa3_pmf_by_default' into 'master'
esp_wifi: Enable WPA3 & PMF by default

See merge request espressif/esp-idf!8600
2020-05-06 10:53:13 +08:00
Piyush Shah 62e1d6712b mbedtls: Add config options for chacha20, poly1305 and chachapoly 2020-05-05 16:41:31 +00:00
David Cermak a8e370eced tcp_transport: unit test for tcp connection timeout 2020-05-05 15:53:09 +02:00