Commit graph

7053 commits

Author SHA1 Message Date
lly 92cfbe3c6c ble_mesh: Add and use transport macro definitions [Zephyr] 2020-05-13 03:40:30 +00:00
lly e2186b1d3a 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-13 03:40:30 +00:00
lly 489d32663b 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-13 03:40:30 +00:00
lly febe084113 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-13 03:40:30 +00:00
lly b6729860dd 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-13 03:40:30 +00:00
lly 9f9acb6c4a 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-13 03:40:30 +00:00
lly 6d77a8b0c8 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-13 03:40:30 +00:00
lly fa06b60568 ble_mesh: Add PRIu64 & PRIx64 in mesh_types.h 2020-05-13 03:40:30 +00:00
lly bb09078b65 ble_mesh: Add push functions for supported bit-variants [Zephyr]
Add push functions for bit-widths supported by add and pull functions.
2020-05-13 03:40:30 +00:00
lly 0522ce7cf3 ble_mesh: Add support for 64 bit data type [Zephyr]
This enables pulling and pushing values in 64 bit format.
2020-05-13 03:40:30 +00:00
lly b41d50908b ble_mesh: Add support for 48 bit data type [Zephyr]
This enables pulling and pushing values in 48 bit format.
2020-05-13 03:40:30 +00:00
lly be57df5e19 ble_mesh: Add 48 bit variants [Zephyr]
This adds sys_*_*48 functions that operation on a 48 bits values.
2020-05-13 03:40:30 +00:00
lly fd5e18eb49 ble_mesh: Add support for 24 bit data type [Zephyr]
This enables pulling and pushing values in 24 bit format.
2020-05-13 03:40:30 +00:00
lly 4963d4ddf8 ble_mesh: Add 24 bit variants [Zephyr]
This adds sys_*_*24 functions that operation on a 24 bits values.
2020-05-13 03:40:30 +00:00
lly bc1722260f 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-13 03:40:30 +00:00
lly 968772d18a 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-13 03:40:30 +00:00
lly a45406fe6e 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-13 03:40:30 +00:00
lly 10f2ed14eb 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-13 03:40:30 +00:00
lly cd19f6faf1 ble_mesh: Check device uuid when init provisioning 2020-05-13 03:40:30 +00:00
lly abcfcc47ec 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-13 03:40:30 +00:00
lly e580f98b44 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-13 03:40:30 +00:00
lly 50b4bea45c 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-13 03:40:30 +00:00
lly 4748b07fa2 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:10:40 +08:00
Michael (XIAO Xufeng) 44d1c90d25 Merge branch 'bugfix/timer_group_intr_enable_v3.3' into 'release/v3.3'
Fix timer group intr enable (backport v3.3)

See merge request espressif/esp-idf!8531
2020-05-08 15:00:16 +08:00
Island 2c1c87b37d Merge branch 'bugfix/ble_mesh_add_missing_cpp_v3.3' into 'release/v3.3'
ble_mesh: Add missing #ifdef __cplusplus (v3.3)

See merge request espressif/esp-idf!8615
2020-05-06 18:16:20 +08:00
Island 4ac84bca8b Merge branch 'bugfix/ble_mesh_compile_error_o2_v3.3' into 'release/v3.3'
ble_mesh: Fix compile error when -O2 (performance) is chosen (v3.3)

See merge request espressif/esp-idf!8618
2020-05-06 18:15:28 +08:00
Island 5a53e67c7e Merge branch 'bugfix/ble_mesh_provisioner_check_key_v3.3' into 'release/v3.3'
ble_mesh: Check if appkey exist before deleting it (v3.3)

See merge request espressif/esp-idf!8619
2020-05-06 18:09:32 +08:00
Island 6ca0c6830b Merge branch 'bugfix/ble_mesh_node_reset_erase_v3.3' into 'release/v3.3'
ble_mesh: Fix node not erase info completely (v3.3)

See merge request espressif/esp-idf!8624
2020-05-06 18:06:36 +08:00
David Čermák 722043f734 Merge branch 'feature/config_mqtt_task_prio_v3.3' into 'release/v3.3'
esp_mqtt: configure task priority, esp_mqtt_abort_connection race condition, clenaup logs and docs (v3.3)

See merge request espressif/esp-idf!8477
2020-05-06 16:18:51 +08:00
lly 745aecb03d 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:45:02 +08:00
lly e36d1d2f8a ble_mesh: Check if appkey exist before deleting it 2020-05-06 11:37:03 +08:00
lly 1432daf4c6 ble_mesh: Add length check for some mesh operations 2020-05-06 11:33:41 +08:00
lly 6e7d43dd89 ble_mesh: Fix compile error when -O2 (performance) is chosen 2020-05-06 11:33:08 +08:00
lly 3b9e0657d8 ble_mesh: Add missing #ifdef __cplusplus 2020-05-06 11:19:05 +08:00
Mahavir Jain 511dc5516d Merge branch 'bugfix/wifi_prov_not_stopping_v3.3' into 'release/v3.3'
wifi_provisioning: Catch the Wi-Fi events even after Connection errors (v3.3)

See merge request espressif/esp-idf!8609
2020-05-06 11:18:27 +08:00
Island 53a0b3f951 Merge branch 'feat/ble_mesh_ble_adv_simultaneously_v3.3' into 'release/v3.3'
ble_mesh: Support BLE advertising simultaneously (v3.3)

See merge request espressif/esp-idf!8486
2020-05-06 11:14:52 +08:00
Island b0aeff4797 Merge branch 'bugfix/ble_mesh_rpl_list_size_v3.3' into 'release/v3.3'
ble_mesh: Associate replay protection list size with nodes count (v3.3)

See merge request espressif/esp-idf!8497
2020-05-06 11:14:42 +08:00
Island b33b6c4f2a Merge branch 'doc/ble_mesh_fixes_v3.3' into 'release/v3.3'
doc: Fix some ble mesh description (v3.3)

See merge request espressif/esp-idf!8504
2020-05-06 11:12:46 +08:00
Island 93a13dfd10 Merge branch 'feat/ble_mesh_sensor_model_example_v3.3' into 'release/v3.3'
ble_mesh: Add ble mesh sensor model examples (v3.3)

See merge request espressif/esp-idf!8509
2020-05-06 11:11:36 +08:00
Island 551af6c4f3 Merge branch 'bugfix/ble_mesh_time_scene_wrong_name_v3.3' into 'release/v3.3'
ble_mesh: Fix time scene wrong macro name (v3.3)

See merge request espressif/esp-idf!8512
2020-05-06 11:10:38 +08:00
Piyush Shah f66fbb75e2 wifi_provisioning: Catch the Wi-Fi events even after Connection errors
It was observed that after sending credentials, if the first
Wi-Fi conection attempt fails, the Wi-Fi provisioning managager
ignores subsequent Wi-Fi events. So, even if the device eventually
connects to the AP, the provisioning stays on indefinitely.

Changing a check so that subsequent events are also captured and
provisioning finishes successfully.
2020-05-05 22:10:25 +05:30
David Cermak dea0a75547 mqtt: clenaup logs and docs, esp_mqtt_abort_connection race condition
esp_mqtt_abort_connection: Fixed an issue which could result in a race condition and subsequent crash

esp_mqtt: Change an error print to use ESP_LOGE instead of ESP_LOGI
Move Sending MQTT connect message log from Info to Debug level
docs: Makes clear that publish API could block
Change the message printed after MQTT connection failure
2020-05-04 08:06:59 +02:00
Simon Brélivet 5ede2678aa esp_mqtt: add option to configure mqtt task priority.
Merges https://github.com/espressif/esp-idf/pull/4947
2020-05-04 08:06:59 +02:00
lly a2dbe4c452 ble_mesh: Fix client local parameters not initialized 2020-04-30 11:47:12 +00:00
lly eedaf45f43 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:47:12 +00:00
lly eabf436a23 ble_mesh: Remove some redundant functions 2020-04-30 11:47:12 +00:00
lly 63ab37d721 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:47:12 +00:00
lly 77cf16e337 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:47:12 +00:00
lly 80feb4e70a ble_mesh: Update next alloc address when node info is added 2020-04-30 11:47:12 +00:00
lly 9cb7faf4bd ble_mesh: Fix Provisioner provisioning deadlock 2020-04-30 11:47:12 +00:00
lly fecfd754d9 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:47:12 +00:00
lly dbc44ccc7e 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:47:12 +00:00
lly 6e45c091e3 doc: Fix some ble mesh description 2020-04-30 11:39:07 +00:00
lly d77da91ffb ble_mesh: Add some common macros for sensor model 2020-04-30 11:32:53 +00:00
lly 13817a190c ble_mesh: Allow empty sensor series column value 2020-04-30 11:32:53 +00:00
lly 4e858153a8 ble_mesh: Check if same sensor (settings) property id exists 2020-04-30 11:32:53 +00:00
lly ca95b54ce4 ble_mesh: Allow empty sensor settings exist 2020-04-30 11:32:53 +00:00
lly 9b1b2f9b5d ble_mesh: Support BLE advertising simultaneously 2020-04-30 08:23:24 +00:00
Angus Gratton 093e40b14d Merge branch 'bugfix/heap_psram_fill_v3.3' into 'release/v3.3'
heap: Only fill new heaps with FREE_FILL_PATTERN if Comprehensive poisoning is on (v3.3)

See merge request espressif/esp-idf!8492
2020-04-30 13:45:07 +08:00
Angus Gratton 2086c993d8 Merge branch 'bugfix/fix_spi_flash_clock_config_error_v3.3' into 'release/v3.3'
flash: fix spi flash clock config error (backport v3.3)

See merge request espressif/esp-idf!8514
2020-04-29 13:22:03 +08:00
morris 67131b7d78 timer_group: fix intr_enable
timer group interrupt enable is controled by level_int_ena instead of int_ena

Closes https://github.com/espressif/esp-idf/issues/5103
2020-04-28 12:39:54 +08:00
dowster 6a448bd030 Fix typo with sigmadelta.h #ifdef 2020-04-28 12:37:29 +08:00
Jiang Jiang Jian b6599abb1f Merge branch 'bugfix/can_not_get_IP_address_from_China_mobile_v3.3' into 'release/v3.3'
wifi: fix the bug that ESP32 can't get IP address from China Mobile router (v3.3)

See merge request espressif/esp-idf!8400
2020-04-28 11:36:58 +08:00
chenjianqiang de6e8ccea7 flash: fix spi flash clock config error
Closes https://github.com/espressif/esp-idf/issues/5099
2020-04-27 17:34:15 +08:00
lly caeb040857 ble_mesh: Fix time scene wrong macro name 2020-04-27 16:27:52 +08:00
Angus Gratton 543aa45f76 heap: Only fill new heaps with FREE_FILL_PATTERN if Comprehensive poisoning is on
Significantly speeds up heap initialization at startup when default "Light" heap
poisoning is enabled.

Tip via reddit user LinkeSeitentasche https://www.reddit.com/r/esp32/comments/fnj51a/a_guide_to_improving_esp32_boot_speed/
2020-04-27 16:34:43 +10:00
Angus Gratton ad5e4236b4 idf: Bump ESP-IDF version to v3.3.2
Feature was merged after v3.3.2 release.
2020-04-27 15:45:47 +10:00
lly 012b810d29 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-26 06:44:45 +00:00
Jiang Jiang Jian 957e88d12f Merge branch 'bugfix/dns_lookup_failed' into 'release/v3.3'
lw-ip:bugfix for dns lookup failed

See merge request espressif/esp-idf!8308
2020-04-21 11:27:16 +08:00
Jiang Jiang Jian 47b891c25b Merge branch 'optimization/TCPv6_connect_for_v3.3' into 'release/v3.3'
lw-ip:optimization TCPv6 connect for v3.3(backport v3.3)

See merge request espressif/esp-idf!8022
2020-04-21 11:26:28 +08:00
zhangyanjiao 6f85135471 wifi: fix the bug that ESP32 can't get IP address from China Mobile router 2020-04-20 10:56:08 +08:00
Jiang Jiang Jian f3f88e241b Merge branch 'bugfix/btdm_backports_v3.3_0328' into 'release/v3.3'
Bugfix/btdm backports v3.3 0328

See merge request espressif/esp-idf!8153
2020-04-16 21:08:10 +08:00
Angus Gratton 249da85fd9 Merge branch 'bufgix/esp_ota_get_app_elf_sha256_v3.3' into 'release/v3.3'
app_update: Fix case when elf file SHA256 should be printed by panic handler while cache is disabled (v3.3)

See merge request espressif/esp-idf!8368
2020-04-16 14:31:31 +08:00
Angus Gratton a0b1f1bb07 Merge branch 'bugfix/efuse_get_coding_scheme_and_ut_v3.3' into 'release/v3.3'
efuse: Fix get_coding_scheme() using ESP_EARLY_LOG* instead of ESP_LOG* (v3.3)

See merge request espressif/esp-idf!8362
2020-04-16 14:29:54 +08:00
Marius Vikhammer 9f2056dad4 app_update: fix test failure for get_app_elf_sha256 test
Commit fc03161f updated esp_ota_get_app_elf_sha256 to store and return
X number of bytes of the hash, but the test case still expected 64 bytes.

Updated test case to use CONFIG value for expected length.
2020-04-15 21:49:32 +08:00
KonstantinKondrashov 2705b76371 app_update: Fix case when elf file SHA256 should be printed by panic handler while cache is disabled
Closes: IDF-1342
2020-04-15 21:07:02 +08:00
KonstantinKondrashov 383cd73e38 efuse: Fix get_coding_scheme() when CONFIG_SECURE_FLASH_ENC_ENABLED and LOG_LEVEL is Debug
Closes: https://github.com/espressif/esp-idf/issues/4862
2020-04-15 20:24:41 +08:00
KonstantinKondrashov a5f9a0cbe4 esp32: Add a Kconfig option- Number of attempts to repeat 32k XTAL calibration
Closes: IDF-1479
2020-04-15 16:52:23 +08:00
Jiang Jiang Jian 2ebad4639e Merge branch 'bugfix/psram_single_bit_error_v3.3' into 'release/v3.3'
psram: support psram 2T mode to fix single bit error (backport v3.3)

See merge request espressif/esp-idf!7011
2020-04-15 13:28:22 +08:00
Jiang Jiang Jian a656caed7a Merge branch 'nimble/fix_ble_hs_reset_v3.3' into 'release/v3.3'
NimBLE: Reset master and slave states on host reset and fix build failure (backport v3.3)

See merge request espressif/esp-idf!8219
2020-04-15 13:28:04 +08:00
Jiang Jiang Jian 2aba47f8dd Merge branch 'bugfix/backport_some_wifi_bugs_0326_v3.3' into 'release/v3.3'
esp32: backport some WiFi fixes (backport v3.3)

See merge request espressif/esp-idf!8186
2020-04-15 13:07:01 +08:00
chenjianqiang 22c0334ad9 psram: support psram 2T mode to fix single bit error
1. add enable PSRAM 2T mode function
2. abort when himem and 2T mode are enabled meanwhile
3. set SPIRAM_2T_MODE as "n" by default, enable it when needed
2020-04-13 15:25:13 +08:00
xueyunfei 6cdb27a361 bugfix for dns lookup failed 2020-04-10 11:07:54 +08:00
Angus Gratton ec0605db4c Merge branch 'feature/idf_version_header_v3.3' into 'release/v3.3'
esp_common: add version definitions in code and build system (backport v3.3)

See merge request espressif/esp-idf!8233
2020-04-08 15:08:03 +08:00
Angus Gratton cde76fece9 Merge branch 'bugfix/efuse_write_config_v3.3' into 'release/v3.3'
efuse: set timing configuration before writing (backport v3.3)

See merge request espressif/esp-idf!8231
2020-04-08 15:06:30 +08:00
Prasad Alatkar aad04405fc NimBLE: Reset master and slave states on host reset and fix build failure (backport v3.3) 2020-04-07 10:52:01 +05:30
Mahavir Jain 8c5a0a0a57 Merge branch 'feature/upgrade_mbedtls_to_v3.3' into 'release/v3.3'
mbedtls: upgrade to release v2.16.5 (v3.3)

See merge request espressif/esp-idf!7988
2020-04-07 12:10:07 +08:00
Shubham Kulkarni 6f39fea03d esp_ota_ops.c: Fix size calculation to erase partition range for OTA image
Closes https://github.com/espressif/esp-idf/issues/4953
2020-04-06 13:40:12 +05:30
Ivan Grokhotkov ca6b009c26 esp_common: add version definitions in code and build system
Closes https://github.com/espressif/esp-idf/issues/4679
2020-04-03 01:24:33 +02:00
Ivan Grokhotkov dd5190868a efuse: set timing configuration before writing 2020-04-03 00:51:36 +02:00
Marius Vikhammer b56012783c tcp_transport/ws_client: websockets now correctly handle messages longer than buffer
transport_ws can now be read multiple times in a row to read frames larger than the buffer.

Added reporting of total payload length and offset to the user in websocket_client.

Added local example test for long messages.

Closes IDF-1083
2020-04-02 07:30:12 +00:00
Marius Vikhammer d6ef9d73bb websocket: backport of websocket client to v3.3
Backports the websocket client and example to ESP-IDF release 3.3.
2020-04-02 07:30:12 +00:00
Jiang Jiang Jian a71e85fb63 Merge branch 'bugfix/btdm_dont_dequeue_the_command_queue_v3.3' into 'release/v3.3'
component/bt: fix don't dequeue the command queue after process the read_by_type_req(backport v3.3)

See merge request espressif/esp-idf!8183
2020-04-02 12:08:40 +08:00
liu zhifu a0d61eca20 esp32: backport some WiFi fixes to v3.3
Backport following Wifi fixes:

1. Optimize WiFi sleep in WiFi/BT coexist mode
   I> If any data TX/RX in WiFi slice, force wakeup next TBTT
   II> Increase active timeout to coex TBTT to avoid sleep in WiFi slice

2. Fix esp_wifi_stop() crash
   esp_wifi_stop() crashes if it's called when WiFi is not initialized.

3. Fix WiFi log print level

4. Return fails if AP's configuring AP channel is out of range

5. esp_wifi_sta_get_ap_info() returns actual values of group ciphers
2020-04-02 10:27:11 +08:00
Mahavir Jain 530b35b222 mbedtls: upgrade to release v2.16.5
For detailed release notes please refer to:
https://tls.mbed.org/tech-updates/releases/mbedtls-2.16.5-and-2.7.14-released

Closes: IDFGH-2638
Closes: https://github.com/espressif/esp-idf/issues/4716
2020-04-01 13:46:09 +00:00
Sagar Bijwe 5723e717e5 wpa_supplicant: Fix SAE test-case failure on mbedtls version udpate
Problem:
mbedtls_ctr_drbg_context was initialized in crypto_ec_point_mul. This
was okay in releases before 2.16.4 as entropy_len used to get set to
MBEDTLS_CTR_DRBG_ENTROPY_LEN in function mbedtls_ctr_drbg_seed. The
function is now changed to set the length to
MBEDTLS_CTR_DRBG_ENTROPY_LEN if previous length is 0 and hence the bug.

Solution:
Initialize mbedtls_ctr_drbg_context in crypto_ec_point_mul.
2020-04-01 13:46:09 +00:00
Angus Gratton ba9ef572c0 Merge branch 'backport/malloc_zero_return_null_v3.3' into 'release/v3.3'
backport/malloc_zero_return_null_v3.3

See merge request espressif/esp-idf!8144
2020-04-01 14:42:50 +08:00
xiewenxiang 23474dc737 component/bt: fix don't dequeue the command queue after process the read_by_type_req(backport v3.3) 2020-03-31 16:45:57 +08:00
Prasad Alatkar 296ab7c80e Wifi_provisioning_ble: Change service_uuid to non standard 128 bit UUID (v3.3)
- Modifies UUIDs in scheme_ble, manager example and esp_prov tool to custom 128
  bit UUID
2020-03-30 11:20:30 +05:30
baohongde 0ac0a3126f components/coex: Fix wakeup delay with DFS 2020-03-28 21:15:21 +08:00
baohongde 41fe01cc99 components/bt: Fix assert when create conntion cancel 2020-03-28 21:08:52 +08:00
Felipe Neves 48e78e6e07 multi_heap: ensure that malloc(0) return NULL pointer in any poisoning configuration 2020-03-27 14:35:50 -03:00
Angus Gratton 6c9c253ed1 Merge branch 'bugfix/esp_event_bugfixes_v3.3' into 'release/v3.3'
esp_event-related fixes (v3.3)

See merge request espressif/esp-idf!8073
2020-03-26 16:20:10 +08:00
Jiang Jiang Jian c44a9f9a4e Merge branch 'bugfix/send_ok_when_sta_disconnect_for_v3.3' into 'release/v3.3'
lw-ip:bugfix for TCPv6 send ok when sta disconnect for 3.3

See merge request espressif/esp-idf!8016
2020-03-25 11:15:52 +08:00
Jiang Jiang Jian 6feb88f69b Merge branch 'bugfix/Add_lwip_assert_control_v3.3' into 'release/v3.3'
lw-ip: Add lw-ip assert control (backport v3.3)

See merge request espressif/esp-idf!8028
2020-03-23 15:07:40 +08:00
Renz Christian Bagaporo 84227aeac0 esp_event: remove extra line from source file 2020-03-22 22:34:38 +08:00
Renz Christian Bagaporo 2e3a949f3a esp_event: test that handlers can unregister themselves 2020-03-22 22:34:30 +08:00
Renz Christian Bagaporo 0890ce9115 esp_event: iterate loop nodes safely as well 2020-03-22 22:34:21 +08:00
Xentec 9b16cb75f8 esp_event: fix crash when unregistering a handler instance in itself
When a handler instance is the last one in the list und unregisters
itself, the handler iterator will be invalidated by entering free'd
memory. Same applies for event base and id, if they become empty.

Merges https://github.com/espressif/esp-idf/pull/4139
2020-03-22 22:34:07 +08:00
Ivan Grokhotkov f6763a9d84 newlib: don't define non-thread-safe versions of getc, putc
getc, getchar, putc, putchar were defined both as functions and as
macros. The macro versions are not thread safe, and should not be used
in multithreaded applications.

Upstream fix: b0f271d1db
2020-03-19 12:44:20 +01:00
xiehang 3d821dc821 LWIP: Add lwip assert control 2020-03-19 19:15:24 +08:00
xueyunfei 1cb4cd5ec6 optimization TCPv6 connect 2020-03-19 11:43:44 +08:00
xueyunfei 649a6afeb9 bugfix for TCPv6 send ok when sta disconnect 2020-03-18 17:58:07 +08:00
Jiang Jiang Jian 9e70825d1e Merge branch 'bugfix/sntp_init_can_run_before_net_connection_v3.3' into 'release/v3.3'
lw_ip: Add to sys_arch_protect() a check that the mutex is created before use if not then creates it (v3.3)

See merge request espressif/esp-idf!7758
2020-03-18 12:07:08 +08:00
Island 151b6d9bef Merge branch 'bugfix/allow_adv_stop_again_in_host' into 'release/v3.3'
Fix allow to send stop adv hci cmd when host adv state is disable

See merge request espressif/esp-idf!7993
2020-03-17 23:52:04 +08:00
lly cc07e9d203 ble_mesh: Fix ble mesh nimble host deinit 2020-03-17 14:42:46 +08:00
gengyuchao ab175f8845 fix allow to send stop adv hci cmd when host adv state is disable 2020-03-16 21:37:07 +08:00
Jiang Jiang Jian 206a844e4a Merge branch 'bugfix/fix_scan_get_rssi_err_v3.3' into 'release/v3.3'
esp_wifi: Fix scan get rssi err (backport v3.3)

See merge request espressif/esp-idf!7963
2020-03-16 20:56:30 +08:00
Jiang Jiang Jian bf568f2eb4 Merge branch 'bugfix/ble_mesh_miscellaneous_fix_v3.3' into 'release/v3.3'
Bugfix/ble mesh miscellaneous fix (v3.3)

See merge request espressif/esp-idf!7971
2020-03-16 13:27:35 +08:00
Jiang Jiang Jian 36cddd0bae Merge branch 'bugfix/ble_mesh_update_3.3' into 'release/v3.3'
Bugfix/ble mesh update 3.3

See merge request espressif/esp-idf!7801
2020-03-16 13:26:44 +08:00
Prasad Alatkar 4fb4c01c53 NimBLE: Add Host based privacy (RPA) feature support (v3.3)
- This feature removes dependency on controller to use privacy (RPA)
2020-03-15 21:43:01 +05:30
Prasad Alatkar 237f7eb92a NimBLE: Fix check for static random address & add MSYS_1 in menuconfig (v3.3) 2020-03-15 21:43:01 +05:30
Hrishikesh Dhayagude 5ca8851be8 NimBLE: Use dynamic buffers instead of static memory (v3.3)
The NimBLE host buffers that consume a significant amount of memory are
now allocated dynamically.
The advantage is that, the memory can be reclaimed in cases where BLE
is turned off and not required for the current boot cycle
2020-03-15 21:43:01 +05:30
Prasad Alatkar b6c88b683f NimBLE: Misc changes in host flow control, ble_gap_unpair, ble_hs_hci_rx_evt & example (v3.3)
- Add menuconfig option for NimBLE host flow control
- Include changes in `blecent` example from upstream PR!702
- add ble_hs_lock in ble_gap_unpair Upstream PR!584
- ble_hs_hci_rx_evt, upstream PR!738
2020-03-15 21:43:01 +05:30
lly a8763e6517 ble_mesh: Move dev_role to the end of model_pub 2020-03-13 19:53:26 +08:00
lly de022501b7 ble_mesh: Use the right netkey during iv update 2020-03-13 19:53:23 +08:00
lly 0d6dd36af9 ble_mesh: Use the right net_idx & app_idx for publish 2020-03-13 19:53:19 +08:00
lly 68dba56ac8 ble_mesh: Check buf->ref before unref the buffer 2020-03-13 19:53:16 +08:00
lly 9f32f4b405 ble_mesh: Fix mesh memory use-after-free issue 2020-03-13 19:53:12 +08:00
lly c19a01d100 ble_mesh: Add ble mesh deinit in btc task 2020-03-13 19:53:08 +08:00
lly 2ae6eedb30 ble_mesh: Free beacon timer when deinit mesh 2020-03-13 19:53:02 +08:00
lly e73ad2c391 ble_mesh: Use lock for mesh timer operations 2020-03-13 19:52:50 +08:00
xiehang 6de264be1e esp_wifi: Fix scan get rssi err
Remove software modify rssi
2020-03-13 19:41:11 +08:00
Jiang Jiang Jian 766eace598 Merge branch 'bugfix/backport_some_wifi_bugs_0310_v3.3' into 'release/v3.3'
Backport some wifi bugs 0310 (backport v3.3)

See merge request espressif/esp-idf!7935
2020-03-13 19:38:01 +08:00
Mahavir Jain 6babdfc0b7 ipc: prevent code getting pulled in for unicore configuration 2020-03-12 16:28:00 +05:30
KonstantinKondrashov 7013d2d7c5 lwip: Add to sys_arch_protect() a check that the mutex is created before use if not then creates it
Closes: https://github.com/espressif/esp-idf/issues/944
Closes: https://github.com/espressif/esp-idf/issues/3931
Closes: WIFI-1019
2020-03-11 19:23:24 +08:00
xiehang c9e7a04a9e Update wifi lib
1. Add wifi stop check at wifi deinit entry.
2. Add TX packets size check.
3. Reduce wifi bin size.
4. Fix the bug for setting channel when wifi in NULL mode.
5. Place the Vendor Specific element at the end according to the protocol.
6. Coex adjust scheme when bt is in connnected status.
2020-03-10 20:01:39 +08:00
Shubham Kulkarni 5def4ad7fe esp_https_ota.c: Add errno check for WiFi disconnection while performing OTA 2020-03-09 13:21:21 +05:30
Shubham Kulkarni 3cceacc931 OTA: Add fix in case of URL redirection
Test case for URL Redirection and Chunked server is added
2020-03-09 13:21:21 +05:30
Shubham Kulkarni 9df632482c OTA: Fixed OTA with chunked servers
If esp_http_client_read returns 0, errno check is performed if complete data is not received.
2020-03-09 13:21:21 +05:30
Chinmay Chhajed 72fb22ed51 This MR is intended to fix Bluetooth event scheduling when WiFi is also enabled.
The global interrupts will be disabled before taking current
time for scheduling further bluetooth events. Earlier disabling
interrupts was taking some time because of which WiFi events were
interrupting in current bluetooth scheduling.

Also fixes ble crash issue triggered by ble event irq miss (0x20000).
2020-03-05 18:58:28 +05:30
Angus Gratton 1eaccfae4a cmake: Fix bug where PHY partition offset incorrectly set 2020-03-02 23:27:51 +00:00
lly 0e2c77b185 ble_mesh: Calc incomplete timeout based on msg info 2020-02-27 15:47:26 +08:00
lly 91ad0f9f4a ble_mesh: Start the timer when starting to send the client message 2020-02-27 15:47:12 +08:00
lly 70eadc0b05 ble_mesh: No timeout for client message to non-unicast address 2020-02-27 15:46:54 +08:00
lly 49fc8c86b3 ble_mesh: Unify client application and lower transport layer timeout 2020-02-27 15:46:19 +08:00
lly 04a6ac3cf5 ble_mesh: Allow maximum 377 octets payload 2020-02-27 15:46:03 +08:00
lly 9fa5c14d58 ble_mesh: Reset transport info when node is removed 2020-02-27 15:45:46 +08:00
lly cc19e1da9b ble_mesh: Provisioner ignores msg from removed node 2020-02-27 15:45:15 +08:00
liu zhifu 96bb4c6e78 esp32: fix the bug that WiFi stop leads to memory leak 2020-02-27 14:28:39 +08:00