forked from espressif/esp-idf
Merge branch 'feat/154_enable_receive_done' into 'master'
feat(ieee802154): make the receive done handler feature mandatory See merge request espressif/esp-idf!28573
This commit is contained in:
@ -127,7 +127,6 @@
|
|||||||
- "components/esp_phy/lib"
|
- "components/esp_phy/lib"
|
||||||
- "components/esp_wifi/lib"
|
- "components/esp_wifi/lib"
|
||||||
- "components/esp_coex/lib"
|
- "components/esp_coex/lib"
|
||||||
- "components/ieee802154/lib"
|
|
||||||
- "components/json/cJSON"
|
- "components/json/cJSON"
|
||||||
- "components/lwip/lwip"
|
- "components/lwip/lwip"
|
||||||
- "components/mbedtls/mbedtls"
|
- "components/mbedtls/mbedtls"
|
||||||
|
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -120,10 +120,6 @@
|
|||||||
path = components/openthread/lib
|
path = components/openthread/lib
|
||||||
url = ../../espressif/esp-thread-lib.git
|
url = ../../espressif/esp-thread-lib.git
|
||||||
|
|
||||||
[submodule "components/ieee802154/lib"]
|
|
||||||
path = components/ieee802154/lib
|
|
||||||
url = ../../espressif/esp-ieee802154-lib.git
|
|
||||||
|
|
||||||
[submodule "components/bt/controller/lib_esp32h2/esp32h2-bt-lib"]
|
[submodule "components/bt/controller/lib_esp32h2/esp32h2-bt-lib"]
|
||||||
path = components/bt/controller/lib_esp32h2/esp32h2-bt-lib
|
path = components/bt/controller/lib_esp32h2/esp32h2-bt-lib
|
||||||
url = ../../espressif/esp32h2-bt-lib.git
|
url = ../../espressif/esp32h2-bt-lib.git
|
||||||
|
@ -41,14 +41,6 @@ menu "IEEE 802.15.4"
|
|||||||
configure the CCA mode to Carrier sense AND energy above threshold
|
configure the CCA mode to Carrier sense AND energy above threshold
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config IEEE802154_RECEIVE_DONE_HANDLER
|
|
||||||
bool "Enable the receive done handler feature"
|
|
||||||
default n
|
|
||||||
help
|
|
||||||
configure the receive done handler feature, when enabled, the user must call the
|
|
||||||
function `esp_ieee802154_receive_handle_done` to inform the 802.15.4 driver that
|
|
||||||
the received frame has been processed, so the frame space could be freed.
|
|
||||||
|
|
||||||
config IEEE802154_CCA_MODE
|
config IEEE802154_CCA_MODE
|
||||||
depends on IEEE802154_ENABLED
|
depends on IEEE802154_ENABLED
|
||||||
int
|
int
|
||||||
|
@ -47,7 +47,6 @@ IEEE802154_STATIC volatile ieee802154_state_t s_ieee802154_state;
|
|||||||
static uint8_t *s_tx_frame = NULL;
|
static uint8_t *s_tx_frame = NULL;
|
||||||
#define IEEE802154_RX_FRAME_SIZE (127 + 1 + 1) // +1: len, +1: for dma test
|
#define IEEE802154_RX_FRAME_SIZE (127 + 1 + 1) // +1: len, +1: for dma test
|
||||||
|
|
||||||
#if CONFIG_IEEE802154_RECEIVE_DONE_HANDLER
|
|
||||||
// +1: for the stub buffer when the valid buffers are full.
|
// +1: for the stub buffer when the valid buffers are full.
|
||||||
//
|
//
|
||||||
// |--------------------VB[0]--------------------|
|
// |--------------------VB[0]--------------------|
|
||||||
@ -62,10 +61,6 @@ static uint8_t *s_tx_frame = NULL;
|
|||||||
// STUB : Stub buffer, used when all valid buffers are under processing, the received frame will be dropped.
|
// STUB : Stub buffer, used when all valid buffers are under processing, the received frame will be dropped.
|
||||||
static uint8_t s_rx_frame[CONFIG_IEEE802154_RX_BUFFER_SIZE + 1][IEEE802154_RX_FRAME_SIZE];
|
static uint8_t s_rx_frame[CONFIG_IEEE802154_RX_BUFFER_SIZE + 1][IEEE802154_RX_FRAME_SIZE];
|
||||||
static esp_ieee802154_frame_info_t s_rx_frame_info[CONFIG_IEEE802154_RX_BUFFER_SIZE + 1];
|
static esp_ieee802154_frame_info_t s_rx_frame_info[CONFIG_IEEE802154_RX_BUFFER_SIZE + 1];
|
||||||
#else
|
|
||||||
static uint8_t s_rx_frame[CONFIG_IEEE802154_RX_BUFFER_SIZE][IEEE802154_RX_FRAME_SIZE];
|
|
||||||
static esp_ieee802154_frame_info_t s_rx_frame_info[CONFIG_IEEE802154_RX_BUFFER_SIZE];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static uint8_t s_rx_index = 0;
|
static uint8_t s_rx_index = 0;
|
||||||
static uint8_t s_enh_ack_frame[128];
|
static uint8_t s_enh_ack_frame[128];
|
||||||
@ -85,7 +80,6 @@ typedef struct {
|
|||||||
static pending_tx_t s_pending_tx = { 0 };
|
static pending_tx_t s_pending_tx = { 0 };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_IEEE802154_RECEIVE_DONE_HANDLER
|
|
||||||
static void ieee802154_receive_done(uint8_t *data, esp_ieee802154_frame_info_t *frame_info)
|
static void ieee802154_receive_done(uint8_t *data, esp_ieee802154_frame_info_t *frame_info)
|
||||||
{
|
{
|
||||||
// If the RX done packet is written in the stub buffer, drop it silently.
|
// If the RX done packet is written in the stub buffer, drop it silently.
|
||||||
@ -113,7 +107,7 @@ static void ieee802154_transmit_done(const uint8_t *frame, const uint8_t *ack, e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t ieee802154_receive_handle_done(uint8_t *data)
|
esp_err_t ieee802154_receive_handle_done(const uint8_t *data)
|
||||||
{
|
{
|
||||||
uint16_t size = data - &s_rx_frame[0][0];
|
uint16_t size = data - &s_rx_frame[0][0];
|
||||||
if ((size % IEEE802154_RX_FRAME_SIZE) != 0
|
if ((size % IEEE802154_RX_FRAME_SIZE) != 0
|
||||||
@ -123,18 +117,6 @@ esp_err_t ieee802154_receive_handle_done(uint8_t *data)
|
|||||||
s_rx_frame_info[size / IEEE802154_RX_FRAME_SIZE].process = false;
|
s_rx_frame_info[size / IEEE802154_RX_FRAME_SIZE].process = false;
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
static void ieee802154_receive_done(uint8_t *data, esp_ieee802154_frame_info_t *frame_info)
|
|
||||||
{
|
|
||||||
esp_ieee802154_receive_done(data, frame_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ieee802154_transmit_done(const uint8_t *frame, const uint8_t *ack, esp_ieee802154_frame_info_t *ack_frame_info)
|
|
||||||
{
|
|
||||||
esp_ieee802154_transmit_done(frame, ack, ack_frame_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static IRAM_ATTR void event_end_process(void)
|
static IRAM_ATTR void event_end_process(void)
|
||||||
{
|
{
|
||||||
@ -179,8 +161,8 @@ uint8_t ieee802154_get_recent_lqi(void)
|
|||||||
IEEE802154_STATIC void set_next_rx_buffer(void)
|
IEEE802154_STATIC void set_next_rx_buffer(void)
|
||||||
{
|
{
|
||||||
uint8_t* next_rx_buffer = NULL;
|
uint8_t* next_rx_buffer = NULL;
|
||||||
#if CONFIG_IEEE802154_RECEIVE_DONE_HANDLER
|
|
||||||
uint8_t index = 0;
|
uint8_t index = 0;
|
||||||
|
|
||||||
if (s_rx_index != CONFIG_IEEE802154_RX_BUFFER_SIZE && s_rx_frame_info[s_rx_index].process == false) {
|
if (s_rx_index != CONFIG_IEEE802154_RX_BUFFER_SIZE && s_rx_frame_info[s_rx_index].process == false) {
|
||||||
// If buffer is not full, and current index is empty, set it to hardware.
|
// If buffer is not full, and current index is empty, set it to hardware.
|
||||||
next_rx_buffer = s_rx_frame[s_rx_index];
|
next_rx_buffer = s_rx_frame[s_rx_index];
|
||||||
@ -204,16 +186,7 @@ IEEE802154_STATIC void set_next_rx_buffer(void)
|
|||||||
s_rx_index = CONFIG_IEEE802154_RX_BUFFER_SIZE;
|
s_rx_index = CONFIG_IEEE802154_RX_BUFFER_SIZE;
|
||||||
next_rx_buffer = s_rx_frame[CONFIG_IEEE802154_RX_BUFFER_SIZE];
|
next_rx_buffer = s_rx_frame[CONFIG_IEEE802154_RX_BUFFER_SIZE];
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (s_rx_frame[s_rx_index][0] != 0) {
|
|
||||||
s_rx_index++;
|
|
||||||
if (s_rx_index == CONFIG_IEEE802154_RX_BUFFER_SIZE) {
|
|
||||||
s_rx_index = 0;
|
|
||||||
memset(s_rx_frame[s_rx_index], 0, sizeof(s_rx_frame[s_rx_index]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
next_rx_buffer = (uint8_t *)&s_rx_frame[s_rx_index];
|
|
||||||
#endif
|
|
||||||
ieee802154_ll_set_rx_addr(next_rx_buffer);
|
ieee802154_ll_set_rx_addr(next_rx_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,12 +338,10 @@ uint8_t esp_ieee802154_get_recent_lqi(void)
|
|||||||
return ieee802154_get_recent_lqi();
|
return ieee802154_get_recent_lqi();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_IEEE802154_RECEIVE_DONE_HANDLER
|
esp_err_t esp_ieee802154_receive_handle_done(const uint8_t *frame)
|
||||||
esp_err_t esp_ieee802154_receive_handle_done(uint8_t *frame)
|
|
||||||
{
|
{
|
||||||
return ieee802154_receive_handle_done(frame);
|
return ieee802154_receive_handle_done(frame);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
__attribute__((weak)) void esp_ieee802154_receive_done(uint8_t *data, esp_ieee802154_frame_info_t *frame_info)
|
__attribute__((weak)) void esp_ieee802154_receive_done(uint8_t *data, esp_ieee802154_frame_info_t *frame_info)
|
||||||
{
|
{
|
||||||
|
@ -115,18 +115,20 @@ esp_err_t esp_ieee802154_sleep(void);
|
|||||||
/**
|
/**
|
||||||
* @brief Set the IEEE 802.15.4 Radio to receive state.
|
* @brief Set the IEEE 802.15.4 Radio to receive state.
|
||||||
*
|
*
|
||||||
|
* @note Radio will continue receiving until it receives a valid frame.
|
||||||
|
* Refer to `esp_ieee802154_receive_done()`.
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
* - ESP_OK on success
|
* - ESP_OK on success
|
||||||
* - ESP_FAIL on failure due to invalid state.
|
* - ESP_FAIL on failure due to invalid state.
|
||||||
*
|
*
|
||||||
* Note: Radio will continue receiving until it receives a valid frame.
|
|
||||||
* Ref to esp_ieee802154_receive_done().
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
esp_err_t esp_ieee802154_receive(void);
|
esp_err_t esp_ieee802154_receive(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Transmit the given frame.
|
* @brief Transmit the given frame.
|
||||||
|
* The transmit result will be reported via `esp_ieee802154_transmit_done()`
|
||||||
|
* or `esp_ieee802154_transmit_failed()`.
|
||||||
*
|
*
|
||||||
* @param[in] frame The pointer to the frame, the frame format:
|
* @param[in] frame The pointer to the frame, the frame format:
|
||||||
* |-----------------------------------------------------------------------|
|
* |-----------------------------------------------------------------------|
|
||||||
@ -138,9 +140,6 @@ esp_err_t esp_ieee802154_receive(void);
|
|||||||
* - ESP_OK on success.
|
* - ESP_OK on success.
|
||||||
* - ESP_FAIL on failure due to invalid state.
|
* - ESP_FAIL on failure due to invalid state.
|
||||||
*
|
*
|
||||||
* Note: The transmit result will be reported via esp_ieee802154_transmit_done()
|
|
||||||
* or esp_ieee802154_transmit_failed().
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
esp_err_t esp_ieee802154_transmit(const uint8_t *frame, bool cca);
|
esp_err_t esp_ieee802154_transmit(const uint8_t *frame, bool cca);
|
||||||
|
|
||||||
@ -453,35 +452,31 @@ bool esp_ieee802154_get_rx_when_idle(void);
|
|||||||
*/
|
*/
|
||||||
esp_err_t esp_ieee802154_energy_detect(uint32_t duration);
|
esp_err_t esp_ieee802154_energy_detect(uint32_t duration);
|
||||||
|
|
||||||
#if CONFIG_IEEE802154_RECEIVE_DONE_HANDLER
|
|
||||||
/**
|
/**
|
||||||
* @brief Notify the IEEE 802.15.4 Radio that the frame is handled done by upper layer.
|
* @brief Notify the IEEE 802.15.4 Radio that the frame is handled done by upper layer.
|
||||||
*
|
*
|
||||||
* @param[in] frame The pointer to the frame which was passed from the function esp_ieee802154_receive_done.
|
* @param[in] frame The pointer to the frame which was passed from the function `esp_ieee802154_receive_done()`
|
||||||
* or ack frame from esp_ieee802154_transmit_done.
|
* or ack frame from `esp_ieee802154_transmit_done()`.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* - ESP_OK on success
|
* - ESP_OK on success
|
||||||
* - ESP_FAIL if frame is invalid.
|
* - ESP_FAIL if frame is invalid.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
esp_err_t esp_ieee802154_receive_handle_done(uint8_t *frame);
|
esp_err_t esp_ieee802154_receive_handle_done(const uint8_t *frame);
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Below are the events generated by IEEE 802.15.4 subsystem, which are in ISR context **/
|
/** Below are the events generated by IEEE 802.15.4 subsystem, which are in ISR context **/
|
||||||
/**
|
/**
|
||||||
* @brief A Frame was received.
|
* @brief A Frame was received.
|
||||||
*
|
*
|
||||||
|
* @note User must call the function `esp_ieee802154_receive_handle_done()` to notify 802.15.4 driver after the received frame is handled.
|
||||||
|
*
|
||||||
* @param[in] frame The point to the received frame, frame format:
|
* @param[in] frame The point to the received frame, frame format:
|
||||||
* |-----------------------------------------------------------------------|
|
* |-----------------------------------------------------------------------|
|
||||||
* | Len | MHR | MAC Payload (no FCS) |
|
* | Len | MHR | MAC Payload (no FCS) |
|
||||||
* |-----------------------------------------------------------------------|
|
* |-----------------------------------------------------------------------|
|
||||||
* @param[in] frame_info More information of the received frame, refer to esp_ieee802154_frame_info_t.
|
* @param[in] frame_info More information of the received frame, refer to esp_ieee802154_frame_info_t.
|
||||||
*
|
*
|
||||||
* Note: If configuration `IEEE802154_RECEIVE_DONE_HANDLER` is enabled, then the user must call the function
|
|
||||||
* `esp_ieee802154_receive_handle_done()` to inform 802.15.4 driver that the received frame is handled.
|
|
||||||
* See `esp_ieee802154_receive_handle_done()` for more informations.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
extern void esp_ieee802154_receive_done(uint8_t *frame, esp_ieee802154_frame_info_t *frame_info);
|
extern void esp_ieee802154_receive_done(uint8_t *frame, esp_ieee802154_frame_info_t *frame_info);
|
||||||
|
|
||||||
@ -494,27 +489,22 @@ extern void esp_ieee802154_receive_sfd_done(void);
|
|||||||
/**
|
/**
|
||||||
* @brief The Frame Transmission succeeded.
|
* @brief The Frame Transmission succeeded.
|
||||||
*
|
*
|
||||||
|
* @note If the ack frame is not null, user must call the function `esp_ieee802154_receive_handle_done()` to notify 802.15.4 driver
|
||||||
|
* after the ack frame is handled.
|
||||||
|
*
|
||||||
* @param[in] frame The pointer to the transmitted frame.
|
* @param[in] frame The pointer to the transmitted frame.
|
||||||
* @param[in] ack The received ACK frame, it could be NULL if the transmitted frame's AR bit is not set.
|
* @param[in] ack The received ACK frame, it could be NULL if the transmitted frame's AR bit is not set.
|
||||||
* @param[in] ack_frame_info More information of the ACK frame, refer to esp_ieee802154_frame_info_t.
|
* @param[in] ack_frame_info More information of the ACK frame, refer to esp_ieee802154_frame_info_t.
|
||||||
*
|
*
|
||||||
* Note: refer to esp_ieee802154_transmit().
|
|
||||||
*
|
|
||||||
* If configuration `IEEE802154_RECEIVE_DONE_HANDLER` is enabled and ack frame is not null, then after the upper layer has processed the frame,
|
|
||||||
* the user must call the function `esp_ieee802154_receive_handle_done()` to inform 802.15.4 driver that the ack frame is handled.
|
|
||||||
* See `esp_ieee802154_receive_handle_done()` for more informations.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
extern void esp_ieee802154_transmit_done(const uint8_t *frame, const uint8_t *ack, esp_ieee802154_frame_info_t *ack_frame_info);
|
extern void esp_ieee802154_transmit_done(const uint8_t *frame, const uint8_t *ack, esp_ieee802154_frame_info_t *ack_frame_info);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The Frame Transmission failed.
|
* @brief The Frame Transmission failed. Refer to `esp_ieee802154_transmit()`.
|
||||||
*
|
*
|
||||||
* @param[in] frame The pointer to the frame.
|
* @param[in] frame The pointer to the frame.
|
||||||
* @param[in] error The transmission failure reason, refer to esp_ieee802154_tx_error_t.
|
* @param[in] error The transmission failure reason, refer to esp_ieee802154_tx_error_t.
|
||||||
*
|
*
|
||||||
* Note: refer to esp_ieee802154_transmit().
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
extern void esp_ieee802154_transmit_failed(const uint8_t *frame, esp_ieee802154_tx_error_t error);
|
extern void esp_ieee802154_transmit_failed(const uint8_t *frame, esp_ieee802154_tx_error_t error);
|
||||||
|
|
||||||
@ -525,32 +515,31 @@ extern void esp_ieee802154_transmit_failed(const uint8_t *frame, esp_ieee802154_
|
|||||||
extern void esp_ieee802154_transmit_sfd_done(uint8_t *frame);
|
extern void esp_ieee802154_transmit_sfd_done(uint8_t *frame);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The energy detection done.
|
* @brief The energy detection done. Refer to `esp_ieee802154_energy_detect()`.
|
||||||
*
|
*
|
||||||
* @param[in] power The detected power level, in dBm.
|
* @param[in] power The detected power level, in dBm.
|
||||||
*
|
*
|
||||||
* Note: refer to esp_ieee802154_energy_detect().
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
extern void esp_ieee802154_energy_detect_done(int8_t power);
|
extern void esp_ieee802154_energy_detect_done(int8_t power);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the IEEE 802.15.4 Radio to receive state at a specific time.
|
* @brief Set the IEEE 802.15.4 Radio to receive state at a specific time.
|
||||||
*
|
*
|
||||||
|
* @note Radio will start receiving after the timestamp, and continue receiving until it receives a valid frame.
|
||||||
|
* Refer to `esp_ieee802154_receive_done()`.
|
||||||
*
|
*
|
||||||
* @param[in] time A specific timestamp for starting receiving.
|
* @param[in] time A specific timestamp for starting receiving.
|
||||||
* @return
|
* @return
|
||||||
* - ESP_OK on success
|
* - ESP_OK on success
|
||||||
* - ESP_FAIL on failure due to invalid state.
|
* - ESP_FAIL on failure due to invalid state.
|
||||||
*
|
*
|
||||||
* Note: Radio will start receiving after the timestamp, and continue receiving until it receives a valid frame.
|
|
||||||
* Ref to esp_ieee802154_receive_done().
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
esp_err_t esp_ieee802154_receive_at(uint32_t time);
|
esp_err_t esp_ieee802154_receive_at(uint32_t time);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Transmit the given frame at a specific time.
|
* @brief Transmit the given frame at a specific time.
|
||||||
|
* The transmit result will be reported via `esp_ieee802154_transmit_done()`
|
||||||
|
* or `esp_ieee802154_transmit_failed()`.
|
||||||
*
|
*
|
||||||
* @param[in] frame The pointer to the frame. Refer to `esp_ieee802154_transmit()`.
|
* @param[in] frame The pointer to the frame. Refer to `esp_ieee802154_transmit()`.
|
||||||
* @param[in] cca Perform CCA before transmission if it's true, otherwise transmit the frame directly.
|
* @param[in] cca Perform CCA before transmission if it's true, otherwise transmit the frame directly.
|
||||||
@ -560,9 +549,6 @@ esp_err_t esp_ieee802154_receive_at(uint32_t time);
|
|||||||
* - ESP_OK on success.
|
* - ESP_OK on success.
|
||||||
* - ESP_FAIL on failure due to invalid state.
|
* - ESP_FAIL on failure due to invalid state.
|
||||||
*
|
*
|
||||||
* Note: The transmit result will be reported via esp_ieee802154_transmit_done()
|
|
||||||
* or esp_ieee802154_transmit_failed().
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
esp_err_t esp_ieee802154_transmit_at(const uint8_t *frame, bool cca, uint32_t time);
|
esp_err_t esp_ieee802154_transmit_at(const uint8_t *frame, bool cca, uint32_t time);
|
||||||
|
|
||||||
|
Submodule components/ieee802154/lib deleted from 102b03c809
@ -110,7 +110,6 @@ esp_err_t ieee802154_transmit(const uint8_t *frame, bool cca);
|
|||||||
*/
|
*/
|
||||||
esp_err_t ieee802154_receive(void);
|
esp_err_t ieee802154_receive(void);
|
||||||
|
|
||||||
#if CONFIG_IEEE802154_RECEIVE_DONE_HANDLER
|
|
||||||
/**
|
/**
|
||||||
* @brief Notify the IEEE 802.15.4 Radio that the frame is handled done by upper layer.
|
* @brief Notify the IEEE 802.15.4 Radio that the frame is handled done by upper layer.
|
||||||
*
|
*
|
||||||
@ -122,8 +121,7 @@ esp_err_t ieee802154_receive(void);
|
|||||||
* - ESP_FAIL if frame is invalid.
|
* - ESP_FAIL if frame is invalid.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
esp_err_t ieee802154_receive_handle_done(uint8_t* frame);
|
esp_err_t ieee802154_receive_handle_done(const uint8_t* frame);
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Transmit the given frame at a specific time.
|
* @brief Transmit the given frame at a specific time.
|
||||||
|
@ -174,9 +174,7 @@ esp_err_t esp_openthread_radio_process(otInstance *aInstance, const esp_openthre
|
|||||||
otPlatRadioTxDone(aInstance, &s_transmit_frame, NULL, OT_ERROR_NONE);
|
otPlatRadioTxDone(aInstance, &s_transmit_frame, NULL, OT_ERROR_NONE);
|
||||||
} else {
|
} else {
|
||||||
otPlatRadioTxDone(aInstance, &s_transmit_frame, &s_ack_frame, OT_ERROR_NONE);
|
otPlatRadioTxDone(aInstance, &s_transmit_frame, &s_ack_frame, OT_ERROR_NONE);
|
||||||
#if CONFIG_IEEE802154_RECEIVE_DONE_HANDLER
|
esp_ieee802154_receive_handle_done(s_ack_frame.mPsdu - 1);
|
||||||
esp_ieee802154_receive_handle_done(s_ack_frame.mPsdu - 1);
|
|
||||||
#endif
|
|
||||||
s_ack_frame.mPsdu = NULL;
|
s_ack_frame.mPsdu = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -228,9 +226,7 @@ esp_err_t esp_openthread_radio_process(otInstance *aInstance, const esp_openthre
|
|||||||
{
|
{
|
||||||
otPlatRadioReceiveDone(aInstance, &s_receive_frame[s_recv_queue.head], OT_ERROR_NONE);
|
otPlatRadioReceiveDone(aInstance, &s_receive_frame[s_recv_queue.head], OT_ERROR_NONE);
|
||||||
}
|
}
|
||||||
#if CONFIG_IEEE802154_RECEIVE_DONE_HANDLER
|
|
||||||
esp_ieee802154_receive_handle_done(s_receive_frame[s_recv_queue.head].mPsdu - 1);
|
esp_ieee802154_receive_handle_done(s_receive_frame[s_recv_queue.head].mPsdu - 1);
|
||||||
#endif
|
|
||||||
s_receive_frame[s_recv_queue.head].mPsdu = NULL;
|
s_receive_frame[s_recv_queue.head].mPsdu = NULL;
|
||||||
s_recv_queue.head = (s_recv_queue.head + 1) % CONFIG_IEEE802154_RX_BUFFER_SIZE;
|
s_recv_queue.head = (s_recv_queue.head + 1) % CONFIG_IEEE802154_RX_BUFFER_SIZE;
|
||||||
s_recv_queue.used--;
|
s_recv_queue.used--;
|
||||||
|
@ -71,6 +71,9 @@ WIFI_DOCS = ['api-guides/wifi.rst',
|
|||||||
'api-reference/provisioning/wifi_provisioning.rst',
|
'api-reference/provisioning/wifi_provisioning.rst',
|
||||||
'migration-guides/release-5.x/5.2/wifi.rst']
|
'migration-guides/release-5.x/5.2/wifi.rst']
|
||||||
|
|
||||||
|
IEEE802154_DOCS = ['migration-guides/release-5.x/5.1/ieee802154.rst',
|
||||||
|
'migration-guides/release-5.x/5.2/ieee802154.rst']
|
||||||
|
|
||||||
NAN_DOCS = ['api-reference/network/esp_nan.rst']
|
NAN_DOCS = ['api-reference/network/esp_nan.rst']
|
||||||
|
|
||||||
WIFI_MESH_DOCS = ['api-guides/esp-wifi-mesh.rst',
|
WIFI_MESH_DOCS = ['api-guides/esp-wifi-mesh.rst',
|
||||||
@ -194,6 +197,7 @@ conditional_include_dict = {'SOC_BT_SUPPORTED':BT_DOCS,
|
|||||||
'SOC_BLUFI_SUPPORTED':BLUFI_DOCS,
|
'SOC_BLUFI_SUPPORTED':BLUFI_DOCS,
|
||||||
'SOC_WIFI_SUPPORTED':WIFI_DOCS,
|
'SOC_WIFI_SUPPORTED':WIFI_DOCS,
|
||||||
'SOC_BT_CLASSIC_SUPPORTED':CLASSIC_BT_DOCS,
|
'SOC_BT_CLASSIC_SUPPORTED':CLASSIC_BT_DOCS,
|
||||||
|
'SOC_IEEE802154_SUPPORTED':IEEE802154_DOCS,
|
||||||
'SOC_SUPPORT_COEXISTENCE':COEXISTENCE_DOCS,
|
'SOC_SUPPORT_COEXISTENCE':COEXISTENCE_DOCS,
|
||||||
'SOC_PSRAM_DMA_CAPABLE':MM_SYNC_DOCS,
|
'SOC_PSRAM_DMA_CAPABLE':MM_SYNC_DOCS,
|
||||||
'SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE':MM_SYNC_DOCS,
|
'SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE':MM_SYNC_DOCS,
|
||||||
|
13
docs/en/migration-guides/release-5.x/5.1/ieee802154.rst
Normal file
13
docs/en/migration-guides/release-5.x/5.1/ieee802154.rst
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
IEEE 802.15.4
|
||||||
|
=============
|
||||||
|
|
||||||
|
:link_to_translation:`zh_CN:[中文]`
|
||||||
|
|
||||||
|
Receive Handle Done
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
It is required since IDF v5.1.3 release.
|
||||||
|
|
||||||
|
User must call the function :cpp:func:`esp_ieee802154_receive_handle_done` to notify 802.15.4 driver after the received frame is handled. Otherwise the frame buffer will not be freed for future use.
|
@ -7,6 +7,7 @@ Migration from 5.0 to 5.1
|
|||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
gcc
|
gcc
|
||||||
|
:SOC_IEEE802154_SUPPORTED: ieee802154
|
||||||
peripherals
|
peripherals
|
||||||
storage
|
storage
|
||||||
networking
|
networking
|
||||||
|
9
docs/en/migration-guides/release-5.x/5.2/ieee802154.rst
Normal file
9
docs/en/migration-guides/release-5.x/5.2/ieee802154.rst
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
IEEE 802.15.4
|
||||||
|
=============
|
||||||
|
|
||||||
|
:link_to_translation:`zh_CN:[中文]`
|
||||||
|
|
||||||
|
Receive Handle Done
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
User must call the function :cpp:func:`esp_ieee802154_receive_handle_done` to notify 802.15.4 driver after the received frame is handled. Otherwise the frame buffer will not be freed for future use.
|
@ -8,6 +8,7 @@ Migration from 5.1 to 5.2
|
|||||||
|
|
||||||
bluetooth-classic
|
bluetooth-classic
|
||||||
gcc
|
gcc
|
||||||
|
:SOC_IEEE802154_SUPPORTED: ieee802154
|
||||||
peripherals
|
peripherals
|
||||||
protocols
|
protocols
|
||||||
storage
|
storage
|
||||||
|
13
docs/zh_CN/migration-guides/release-5.x/5.1/ieee802154.rst
Normal file
13
docs/zh_CN/migration-guides/release-5.x/5.1/ieee802154.rst
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
IEEE 802.15.4
|
||||||
|
=============
|
||||||
|
|
||||||
|
:link_to_translation:`en:[English]`
|
||||||
|
|
||||||
|
Receive Handle Done
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
这个功能仅包括在 IDF v5.1.3 以及之后的发布中。
|
||||||
|
|
||||||
|
当收到的数据帧被处理后, 用户需要调用函数 :cpp:func:`esp_ieee802154_receive_handle_done` 通知 802.15.4 驱动层,否则这个数据空间将不会被释放。
|
@ -7,6 +7,7 @@
|
|||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
gcc
|
gcc
|
||||||
|
:SOC_IEEE802154_SUPPORTED: ieee802154
|
||||||
peripherals
|
peripherals
|
||||||
storage
|
storage
|
||||||
networking
|
networking
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
IEEE 802.15.4
|
||||||
|
=============
|
||||||
|
|
||||||
|
:link_to_translation:`en:[English]`
|
||||||
|
|
||||||
|
Receive Handle Done
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
当收到的数据帧被处理后, 用户需要调用函数 :cpp:func:`esp_ieee802154_receive_handle_done` 通知 802.15.4 驱动层,否则这个数据空间将不会被释放。
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
bluetooth-classic
|
bluetooth-classic
|
||||||
gcc
|
gcc
|
||||||
|
:SOC_IEEE802154_SUPPORTED: ieee802154
|
||||||
peripherals
|
peripherals
|
||||||
protocols
|
protocols
|
||||||
storage
|
storage
|
||||||
|
@ -822,6 +822,7 @@ void esp_ieee802154_transmit_done(const uint8_t *frame, const uint8_t *ack, esp_
|
|||||||
if (ack != NULL) {
|
if (ack != NULL) {
|
||||||
ESP_EARLY_LOGI(TAG, "Rx ack %d bytes", ack[0]);
|
ESP_EARLY_LOGI(TAG, "Rx ack %d bytes", ack[0]);
|
||||||
esp_ieee802154_frame_print(ack);
|
esp_ieee802154_frame_print(ack);
|
||||||
|
esp_ieee802154_receive_handle_done(ack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -829,6 +830,7 @@ void esp_ieee802154_receive_done(uint8_t *frame, esp_ieee802154_frame_info_t *fr
|
|||||||
{
|
{
|
||||||
ESP_EARLY_LOGI(TAG, "Rx Done %d bytes", frame[0]);
|
ESP_EARLY_LOGI(TAG, "Rx Done %d bytes", frame[0]);
|
||||||
esp_ieee802154_frame_print(frame);
|
esp_ieee802154_frame_print(frame);
|
||||||
|
esp_ieee802154_receive_handle_done(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
void esp_ieee802154_energy_detect_done(int8_t power)
|
void esp_ieee802154_energy_detect_done(int8_t power)
|
||||||
|
@ -33,10 +33,3 @@ CONFIG_LWIP_IPV6_NUM_ADDRESSES=8
|
|||||||
CONFIG_LWIP_MULTICAST_PING=y
|
CONFIG_LWIP_MULTICAST_PING=y
|
||||||
CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM=y
|
CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM=y
|
||||||
# end of lwIP
|
# end of lwIP
|
||||||
|
|
||||||
#
|
|
||||||
# IEEE 802.15.4
|
|
||||||
#
|
|
||||||
CONFIG_IEEE802154_ENABLED=y
|
|
||||||
CONFIG_IEEE802154_RECEIVE_DONE_HANDLER=y
|
|
||||||
# end of IEEE 802.15.4
|
|
||||||
|
@ -30,12 +30,6 @@ CONFIG_LOG_BOOTLOADER_LEVEL_ERROR=y
|
|||||||
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=n
|
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=n
|
||||||
# End of deprecated options
|
# End of deprecated options
|
||||||
|
|
||||||
#
|
|
||||||
# IEEE 802.15.4
|
|
||||||
#
|
|
||||||
CONFIG_IEEE802154_RECEIVE_DONE_HANDLER=y
|
|
||||||
# end of IEEE 802.15.4
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Configurations for optimizing the size of ot_rcp firmware
|
# Configurations for optimizing the size of ot_rcp firmware
|
||||||
#
|
#
|
||||||
|
@ -25,9 +25,8 @@
|
|||||||
#include "protocol_examples_common.h"
|
#include "protocol_examples_common.h"
|
||||||
#include "esp_zigbee_gateway.h"
|
#include "esp_zigbee_gateway.h"
|
||||||
|
|
||||||
#include "esp_vfs_dev.h"
|
#include "driver/uart_vfs.h"
|
||||||
#include "esp_vfs_usb_serial_jtag.h"
|
#include "driver/usb_serial_jtag_vfs.h"
|
||||||
#include "driver/usb_serial_jtag.h"
|
|
||||||
|
|
||||||
#if (!defined ZB_MACSPLIT_HOST && defined ZB_MACSPLIT_DEVICE)
|
#if (!defined ZB_MACSPLIT_HOST && defined ZB_MACSPLIT_DEVICE)
|
||||||
#error Only Zigbee gateway host device should be defined
|
#error Only Zigbee gateway host device should be defined
|
||||||
@ -44,9 +43,9 @@ esp_err_t esp_zb_gateway_console_init(void)
|
|||||||
setvbuf(stdin, NULL, _IONBF, 0);
|
setvbuf(stdin, NULL, _IONBF, 0);
|
||||||
|
|
||||||
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
||||||
esp_vfs_dev_usb_serial_jtag_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
usb_serial_jtag_vfs_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
||||||
/* Move the caret to the beginning of the next line on '\n' */
|
/* Move the caret to the beginning of the next line on '\n' */
|
||||||
esp_vfs_dev_usb_serial_jtag_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF);
|
usb_serial_jtag_vfs_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF);
|
||||||
|
|
||||||
/* Enable non-blocking mode on stdin and stdout */
|
/* Enable non-blocking mode on stdin and stdout */
|
||||||
fcntl(fileno(stdout), F_SETFL, O_NONBLOCK);
|
fcntl(fileno(stdout), F_SETFL, O_NONBLOCK);
|
||||||
@ -54,8 +53,8 @@ esp_err_t esp_zb_gateway_console_init(void)
|
|||||||
|
|
||||||
usb_serial_jtag_driver_config_t usb_serial_jtag_config = USB_SERIAL_JTAG_DRIVER_CONFIG_DEFAULT();
|
usb_serial_jtag_driver_config_t usb_serial_jtag_config = USB_SERIAL_JTAG_DRIVER_CONFIG_DEFAULT();
|
||||||
ret = usb_serial_jtag_driver_install(&usb_serial_jtag_config);
|
ret = usb_serial_jtag_driver_install(&usb_serial_jtag_config);
|
||||||
esp_vfs_usb_serial_jtag_use_driver();
|
usb_serial_jtag_vfs_use_driver();
|
||||||
esp_vfs_dev_uart_register();
|
uart_vfs_dev_register();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,9 +31,3 @@ CONFIG_ZB_ENABLED=y
|
|||||||
CONFIG_ZB_ZCZR=y
|
CONFIG_ZB_ZCZR=y
|
||||||
# end of Zboss
|
# end of Zboss
|
||||||
# end of Component config
|
# end of Component config
|
||||||
|
|
||||||
#
|
|
||||||
# IEEE802154
|
|
||||||
#
|
|
||||||
CONFIG_IEEE802154_RECEIVE_DONE_HANDLER=y
|
|
||||||
# end of IEEE802154
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## IDF Component Manager Manifest File
|
## IDF Component Manager Manifest File
|
||||||
dependencies:
|
dependencies:
|
||||||
espressif/esp-zboss-lib: "~1.0.9"
|
espressif/esp-zboss-lib: "1.0.9"
|
||||||
espressif/esp-zigbee-lib: "~1.0.9"
|
espressif/esp-zigbee-lib: "1.0.9"
|
||||||
## Required IDF version
|
## Required IDF version
|
||||||
idf:
|
idf:
|
||||||
version: ">=5.0.0"
|
version: ">=5.0.0"
|
||||||
|
@ -14,10 +14,4 @@ CONFIG_PARTITION_TABLE_MD5=y
|
|||||||
CONFIG_ZB_ENABLED=y
|
CONFIG_ZB_ENABLED=y
|
||||||
CONFIG_ZB_RCP=y
|
CONFIG_ZB_RCP=y
|
||||||
# end of ZBOSS Source
|
# end of ZBOSS Source
|
||||||
|
|
||||||
#
|
|
||||||
# IEEE802154
|
|
||||||
#
|
|
||||||
CONFIG_IEEE802154_RECEIVE_DONE_HANDLER=y
|
|
||||||
# end of IEEE802154
|
|
||||||
# end of Component config
|
# end of Component config
|
||||||
|
@ -28,10 +28,4 @@ CONFIG_MBEDTLS_ECJPAKE_C=y
|
|||||||
CONFIG_ZB_ENABLED=y
|
CONFIG_ZB_ENABLED=y
|
||||||
CONFIG_ZB_ZED=y
|
CONFIG_ZB_ZED=y
|
||||||
# end of Zboss
|
# end of Zboss
|
||||||
|
|
||||||
#
|
|
||||||
# IEEE802154
|
|
||||||
#
|
|
||||||
CONFIG_IEEE802154_RECEIVE_DONE_HANDLER=y
|
|
||||||
# end of IEEE802154
|
|
||||||
# end of Component config
|
# end of Component config
|
||||||
|
@ -27,6 +27,5 @@ CONFIG_MBEDTLS_ECJPAKE_C=y
|
|||||||
#
|
#
|
||||||
CONFIG_ZB_ENABLED=y
|
CONFIG_ZB_ENABLED=y
|
||||||
CONFIG_ZB_ZCZR=y
|
CONFIG_ZB_ZCZR=y
|
||||||
CONFIG_IEEE802154_RECEIVE_DONE_HANDLER=y
|
|
||||||
# end of Zboss
|
# end of Zboss
|
||||||
# end of Component config
|
# end of Component config
|
||||||
|
@ -20,7 +20,6 @@ submodules:
|
|||||||
- "/components/esp_phy/lib/"
|
- "/components/esp_phy/lib/"
|
||||||
- "/components/esp_wifi/lib/"
|
- "/components/esp_wifi/lib/"
|
||||||
- "/components/heap/tlsf/"
|
- "/components/heap/tlsf/"
|
||||||
- "/components/ieee802154/lib/"
|
|
||||||
- "/components/json/cJSON/"
|
- "/components/json/cJSON/"
|
||||||
- "/components/lwip/lwip/"
|
- "/components/lwip/lwip/"
|
||||||
- "/components/mbedtls/mbedtls/"
|
- "/components/mbedtls/mbedtls/"
|
||||||
|
@ -18,7 +18,6 @@ skip:
|
|||||||
- "components/esp_phy/lib"
|
- "components/esp_phy/lib"
|
||||||
- "components/esp_wifi/lib"
|
- "components/esp_wifi/lib"
|
||||||
- "components/esp_wifi/lib_esp32"
|
- "components/esp_wifi/lib_esp32"
|
||||||
- "components/ieee802154/lib"
|
|
||||||
- "components/json/cJSON"
|
- "components/json/cJSON"
|
||||||
- "components/lwip/lwip"
|
- "components/lwip/lwip"
|
||||||
- "components/mbedtls/mbedtls"
|
- "components/mbedtls/mbedtls"
|
||||||
|
Reference in New Issue
Block a user