mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
doc: add esp now changes to migration guides
This commit is contained in:
parent
ad66203e53
commit
f4953c453a
@ -3,6 +3,26 @@ Networking
|
|||||||
|
|
||||||
:link_to_translation:`zh_CN:[中文]`
|
:link_to_translation:`zh_CN:[中文]`
|
||||||
|
|
||||||
|
Wi-Fi
|
||||||
|
*****
|
||||||
|
|
||||||
|
Callback function type esp_now_recv_cb_t
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Previously, the first parameter of ``esp_now_recv_cb_t`` was of type ``const uint8_t *mac_addr``, which only included the address of ESP-NOW peer device.
|
||||||
|
|
||||||
|
This now changes. The first parameter is of type ``esp_now_recv_info_t``, which has members ``src_addr``, ``des_addr`` and ``rx_ctrl``. Therefore, the following updates are required:
|
||||||
|
|
||||||
|
- Redefine ESP-NOW receive callback function.
|
||||||
|
|
||||||
|
- ``src_addr`` can be used to replace original ``mac_addr``.
|
||||||
|
|
||||||
|
- ``des_addr`` is the destination MAC address of ESP-NOW packet, which can be unitcast or broadcast address. With ``des_addr``, the user can distinguish unitcast and broadcast ESP-NOW packets where broadcast ESP-NOW packets can be non-encrypted even when encryption policy is configured for the ESP-NOW.
|
||||||
|
|
||||||
|
- ``rx_ctrl`` is Rx control info of the ESP-NOW packet, which provides more information about the packet.
|
||||||
|
|
||||||
|
Please refer to the ESP-NOW example: :example_file:`wifi/espnow/main/espnow_example_main.c`
|
||||||
|
|
||||||
Ethernet
|
Ethernet
|
||||||
********
|
********
|
||||||
|
|
||||||
|
@ -3,6 +3,27 @@
|
|||||||
|
|
||||||
:link_to_translation:`en:[English]`
|
:link_to_translation:`en:[English]`
|
||||||
|
|
||||||
|
Wi-Fi
|
||||||
|
*****
|
||||||
|
|
||||||
|
|
||||||
|
回调函数类型 esp_now_recv_cb_t
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
先前, ``esp_now_recv_cb_t`` 的第一个参数的类型是 ``const uint8_t *mac_addr``, 它只包含对端 ESP-NOW 设备的地址。
|
||||||
|
|
||||||
|
类型定义已更新。 第一个参数的类型是 ``esp_now_recv_info_t``, 它包含三个成员变量 ``src_addr``,``des_addr`` 和 ``rx_ctrl``。 因此,以下更新是需要的:
|
||||||
|
|
||||||
|
- 重新定义的 ESP-NOW 收包回调函数。
|
||||||
|
|
||||||
|
- ``src_addr`` 可以等价替换原来的 ``mac_addr`` 。
|
||||||
|
|
||||||
|
- ``des_addr`` 是 ESP-NOW 包的目的 MAC 地址,它可以是单播地址或广播地址。有了 ``des_addr``,可以区分单播和广播的 ESP-NOW ,其中广播的 ESP-NOW 包在加密的 ESP-NOW 配置中也可以是非加密的。
|
||||||
|
|
||||||
|
- ``rx_ctrl`` 是 ESP-NOW 包的 Rx control info,它包含此包的更多有用信息。
|
||||||
|
|
||||||
|
请参考 ESP-NOW 样例::example_file:`wifi/espnow/main/espnow_example_main.c`
|
||||||
|
|
||||||
以太网
|
以太网
|
||||||
**************
|
**************
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user