mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-03 02:20:57 +02:00
Merge branch 'feat/update_ot_upstream' into 'master'
feat(openthread): update OT upstream to 3b3dd203b See merge request espressif/esp-idf!42040
This commit is contained in:
@@ -113,6 +113,7 @@ if(CONFIG_OPENTHREAD_ENABLED)
|
||||
"openthread/src/core/thread/mesh_forwarder.cpp"
|
||||
"openthread/src/core/thread/mesh_forwarder_ftd.cpp"
|
||||
"openthread/src/core/thread/mesh_forwarder_mtd.cpp"
|
||||
"openthread/src/core/thread/message_framer.cpp"
|
||||
"openthread/src/core/thread/mle.cpp"
|
||||
"openthread/src/core/thread/mle_router.cpp"
|
||||
"openthread/src/core/thread/mle_types.cpp"
|
||||
|
@@ -57,12 +57,6 @@ typedef struct
|
||||
void (*energy_scan_done)(int8_t max_rssi); /* Callback for Energy Scan Done.*/
|
||||
void (*transmit_started)(const uint8_t *frame); /* Callback for Transmit Started.*/
|
||||
void (*switchover_done)(bool success); /* Callback for Switchover Done.*/
|
||||
|
||||
#if CONFIG_OPENTHREAD_DIAG
|
||||
void (*diag_receive_done)(const uint8_t *frame, esp_ieee802154_frame_info_t *frame_info); /* Callback for Receive Done (diag).*/
|
||||
void (*diag_transmit_done)(const uint8_t *frame, esp_ieee802154_frame_info_t *frame_info); /* Callback for Transmit Done (diag).*/
|
||||
void (*diag_transmit_failed)(esp_ieee802154_tx_error_t error); /* Callback for Transmit Failed (diag).*/
|
||||
#endif // CONFIG_OPENTHREAD_DIAG
|
||||
} esp_radio_spinel_callbacks_t; /* ESP Radio Spinel Callbacks.*/
|
||||
|
||||
/**
|
||||
|
Submodule components/openthread/lib updated: 8f3bd568ba...984efc1578
Submodule components/openthread/openthread updated: b945928d72...3b3dd203be
@@ -5,4 +5,4 @@ supplier: 'Organization: Espressif Systems (Shanghai) CO LTD'
|
||||
originator: 'Organization: Google LLC'
|
||||
description: OpenThread released by Google is an open-source implementation of the Thread networking
|
||||
url: https://github.com/espressif/openthread
|
||||
hash: b945928d722177cd9caeab2e1025499628c101ef
|
||||
hash: 3b3dd203be690995d1a89b110322e4eafafc3a3b
|
||||
|
@@ -165,12 +165,7 @@ esp_err_t esp_openthread_radio_process(otInstance *aInstance, const esp_openthre
|
||||
|
||||
if (get_event(EVENT_TX_DONE)) {
|
||||
clr_event(EVENT_TX_DONE);
|
||||
#if CONFIG_OPENTHREAD_DIAG
|
||||
if (otPlatDiagModeGet()) {
|
||||
otPlatDiagRadioTransmitDone(aInstance, &s_transmit_frame, OT_ERROR_NONE);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
||||
if (s_ack_frame.mPsdu == NULL) {
|
||||
otPlatRadioTxDone(aInstance, &s_transmit_frame, NULL, OT_ERROR_NONE);
|
||||
} else {
|
||||
@@ -179,16 +174,10 @@ esp_err_t esp_openthread_radio_process(otInstance *aInstance, const esp_openthre
|
||||
s_ack_frame.mPsdu = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (get_event(EVENT_TX_FAILED)) {
|
||||
clr_event(EVENT_TX_FAILED);
|
||||
#if CONFIG_OPENTHREAD_DIAG
|
||||
if (otPlatDiagModeGet()) {
|
||||
otPlatDiagRadioTransmitDone(aInstance, &s_transmit_frame, OT_ERROR_CHANNEL_ACCESS_FAILURE);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
||||
otError err = OT_ERROR_NONE;
|
||||
|
||||
switch (s_tx_error) {
|
||||
@@ -210,7 +199,6 @@ esp_err_t esp_openthread_radio_process(otInstance *aInstance, const esp_openthre
|
||||
|
||||
otPlatRadioTxDone(aInstance, &s_transmit_frame, NULL, err);
|
||||
}
|
||||
}
|
||||
|
||||
if (get_event(EVENT_ENERGY_DETECT_DONE)) {
|
||||
clr_event(EVENT_ENERGY_DETECT_DONE);
|
||||
@@ -219,14 +207,7 @@ esp_err_t esp_openthread_radio_process(otInstance *aInstance, const esp_openthre
|
||||
|
||||
while (atomic_load(&s_recv_queue.used)) {
|
||||
if (s_receive_frame[s_recv_queue.head].mPsdu != NULL) {
|
||||
#if CONFIG_OPENTHREAD_DIAG
|
||||
if (otPlatDiagModeGet()) {
|
||||
otPlatDiagRadioReceiveDone(aInstance, &s_receive_frame[s_recv_queue.head], OT_ERROR_NONE);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
otPlatRadioReceiveDone(aInstance, &s_receive_frame[s_recv_queue.head], OT_ERROR_NONE);
|
||||
}
|
||||
esp_ieee802154_receive_handle_done(s_receive_frame[s_recv_queue.head].mPsdu - 1);
|
||||
s_receive_frame[s_recv_queue.head].mPsdu = NULL;
|
||||
s_recv_queue.head = (s_recv_queue.head + 1) % CONFIG_IEEE802154_RX_BUFFER_SIZE;
|
||||
|
@@ -100,10 +100,6 @@ esp_err_t esp_openthread_radio_init(const esp_openthread_platform_config_t *conf
|
||||
|
||||
ot::Spinel::RadioSpinelCallbacks callbacks;
|
||||
memset(&callbacks, 0, sizeof(callbacks));
|
||||
#if CONFIG_OPENTHREAD_DIAG
|
||||
callbacks.mDiagReceiveDone = otPlatDiagRadioReceiveDone;
|
||||
callbacks.mDiagTransmitDone = otPlatDiagRadioTransmitDone;
|
||||
#endif // CONFIG_OPENTHREAD_DIAG
|
||||
callbacks.mEnergyScanDone = otPlatRadioEnergyScanDone;
|
||||
callbacks.mReceiveDone = otPlatRadioReceiveDone;
|
||||
callbacks.mTransmitDone = otPlatRadioTxDone;
|
||||
|
@@ -185,58 +185,6 @@ void SwitchoverDone(otInstance *aInstance, bool aSuccess)
|
||||
s_esp_radio_spinel_callbacks[idx].switchover_done(aSuccess);
|
||||
}
|
||||
|
||||
#if CONFIG_OPENTHREAD_DIAG
|
||||
void DiagReceiveDone(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
esp_radio_spinel_idx_t idx = get_index_from_instance(aInstance);
|
||||
assert(s_esp_radio_spinel_callbacks[idx].diag_receive_done);
|
||||
uint8_t *frame = (uint8_t *)malloc(aFrame->mLength + 1);
|
||||
esp_ieee802154_frame_info_t frame_info;
|
||||
if (frame) {
|
||||
frame[0] = aFrame->mLength;
|
||||
memcpy((void *)(frame + 1), aFrame->mPsdu, frame[0]);
|
||||
frame_info.rssi = aFrame->mInfo.mRxInfo.mRssi;
|
||||
frame_info.timestamp = aFrame->mInfo.mRxInfo.mTimestamp;
|
||||
frame_info.pending = aFrame->mInfo.mRxInfo.mAckedWithFramePending;
|
||||
s_esp_radio_spinel_callbacks[idx].diag_receive_done(frame, &frame_info);
|
||||
free(frame);
|
||||
} else {
|
||||
ESP_LOGE(ESP_SPINEL_LOG_TAG, "Fail to alloc memory for frame");
|
||||
}
|
||||
}
|
||||
|
||||
void DiagTransmitDone(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
esp_radio_spinel_idx_t idx = get_index_from_instance(aInstance);
|
||||
assert(s_esp_radio_spinel_callbacks[idx].diag_transmit_done && s_esp_radio_spinel_callbacks[idx].diag_transmit_failed);
|
||||
if (aError == OT_ERROR_NONE) {
|
||||
uint8_t *frame = (uint8_t *)malloc(aFrame->mLength + 1);
|
||||
if (frame) {
|
||||
esp_ieee802154_frame_info_t ack_info;
|
||||
frame[0] = aFrame->mLength;
|
||||
memcpy((void *)(frame + 1), aFrame->mPsdu, frame[0]);
|
||||
s_esp_radio_spinel_callbacks[idx].diag_transmit_done(frame, &ack_info);
|
||||
free(frame);
|
||||
} else {
|
||||
ESP_LOGE(ESP_SPINEL_LOG_TAG, "Fail to alloc memory for frame");
|
||||
}
|
||||
} else {
|
||||
switch (aError) {
|
||||
case OT_ERROR_CHANNEL_ACCESS_FAILURE:
|
||||
s_esp_radio_spinel_callbacks[idx].diag_transmit_failed(ESP_IEEE802154_TX_ERR_CCA_BUSY);
|
||||
break;
|
||||
case OT_ERROR_NO_ACK:
|
||||
s_esp_radio_spinel_callbacks[idx].diag_transmit_failed(ESP_IEEE802154_TX_ERR_NO_ACK);
|
||||
break;
|
||||
default:
|
||||
s_esp_radio_spinel_callbacks[idx].diag_transmit_failed(ESP_IEEE802154_TX_ERR_CCA_BUSY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_OPENTHREAD_DIAG
|
||||
|
||||
|
||||
void esp_radio_spinel_set_callbacks(const esp_radio_spinel_callbacks_t aCallbacks, esp_radio_spinel_idx_t idx)
|
||||
{
|
||||
s_esp_radio_spinel_callbacks[idx] = aCallbacks;
|
||||
@@ -247,10 +195,6 @@ void esp_radio_spinel_set_callbacks(const esp_radio_spinel_callbacks_t aCallback
|
||||
Callbacks.mEnergyScanDone = EnergyScanDone;
|
||||
Callbacks.mTxStarted = TxStarted;
|
||||
Callbacks.mSwitchoverDone = SwitchoverDone;
|
||||
#if CONFIG_OPENTHREAD_DIAG
|
||||
Callbacks.mDiagReceiveDone = DiagReceiveDone;
|
||||
Callbacks.mDiagTransmitDone = DiagTransmitDone;
|
||||
#endif // CONFIG_OPENTHREAD_DIAG
|
||||
|
||||
s_radio[idx].SetCallbacks(Callbacks);
|
||||
}
|
||||
|
Reference in New Issue
Block a user