Skip to content

Commit 9024489

Browse files
committed
restyled update
1 parent b88108f commit 9024489

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

examples/thread-br-app/esp32/README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ guides to get started.
1111

1212
---
1313

14-
- [Matter ESP32 Thread Border Router Example](#matter-esp32-thread-border-router-example)
15-
- [OpenThread Border Router Board](#openthread-border-router-board)
16-
- [OpenThread RCP](#openthread-rcp)
17-
- [OpenThread CLI](#openthread-cli)
18-
- [Setup Thread Network](#setup-thread-network)
19-
- [Commissioning Thread End Devices](#commissioning-thread-end-devices)
20-
- [Generate OTA Firmware For BR](#generate-ota-firmware-for-br)
14+
- [Matter ESP32 Thread Border Router Example](#matter-esp32-thread-border-router-example)
15+
- [OpenThread Border Router Board](#openthread-border-router-board)
16+
- [OpenThread RCP](#openthread-rcp)
17+
- [OpenThread CLI](#openthread-cli)
18+
- [Setup Thread Network](#setup-thread-network)
19+
- [Commissioning Thread End Devices](#commissioning-thread-end-devices)
20+
- [Generate OTA Firmware For BR](#generate-ota-firmware-for-br)
2121

2222
---
2323

@@ -97,10 +97,12 @@ the Thread network.
9797

9898
### Generate OTA Firmware For BR
9999

100-
After enable the option `CONFIG_CREATE_OTA_IMAGE_WITH_RCP_FW` in menuconfig, will generate
101-
OTA image with rcp firmware in build process, named `ota_with_rcp_image` in build folder.
100+
After enable the option `CONFIG_CREATE_OTA_IMAGE_WITH_RCP_FW` in menuconfig,
101+
will generate OTA image with rcp firmware in build process, named
102+
`ota_with_rcp_image` in build folder.
102103

103104
Then can add a Matter OTA header for the ota_with_rcp_image file.
105+
104106
```
105107
./ota_image_tool.py create -v 65521 -p 32768 --version 1 --version-str "v1.0" -da sha256 build/ota_with_rcp_image ota_with_rcp_image.ota
106-
```
108+
```

src/platform/ESP32/OTAImageProcessorImpl.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,13 @@ esp_err_t OTAImageProcessorImpl::DeltaOTAWriteCallback(const uint8_t * buf, size
283283
#if defined(CONFIG_AUTO_UPDATE_RCP) && defined(CONFIG_OPENTHREAD_BORDER_ROUTER)
284284
esp_err_t OTAImageProcessorImpl::ProcessRcpImage(intptr_t context, const uint8_t * buffer, uint32_t bufLen)
285285
{
286-
esp_err_t err = ESP_OK;
286+
esp_err_t err = ESP_OK;
287287
auto * imageProcessor = reinterpret_cast<OTAImageProcessorImpl *>(context);
288288

289289
if (!imageProcessor->mRcpDone)
290290
{
291291
size_t rcpOtaReceivedLen = 0;
292-
err = esp_rcp_ota_receive(imageProcessor->mRcpOtaHandle, buffer, bufLen, &rcpOtaReceivedLen);
292+
err = esp_rcp_ota_receive(imageProcessor->mRcpOtaHandle, buffer, bufLen, &rcpOtaReceivedLen);
293293

294294
if (esp_rcp_ota_get_state(imageProcessor->mRcpOtaHandle) == ESP_RCP_OTA_STATE_FINISHED)
295295
{
@@ -369,9 +369,9 @@ void OTAImageProcessorImpl::HandlePrepareDownload(intptr_t context)
369369
#endif // CONFIG_ENABLE_ENCRYPTED_OTA
370370

371371
#if defined(CONFIG_AUTO_UPDATE_RCP) && defined(CONFIG_OPENTHREAD_BORDER_ROUTER)
372-
imageProcessor->mRcpOtaHandle = 0;
372+
imageProcessor->mRcpOtaHandle = 0;
373373
imageProcessor->mBrFirmwareSize = 0;
374-
imageProcessor->mRcpDone = false;
374+
imageProcessor->mRcpDone = false;
375375
if (esp_rcp_ota_begin(&imageProcessor->mRcpOtaHandle) != ESP_OK)
376376
{
377377
return;
@@ -424,9 +424,9 @@ void OTAImageProcessorImpl::HandleFinalize(intptr_t context)
424424
#elif defined(CONFIG_AUTO_UPDATE_RCP) && defined(CONFIG_OPENTHREAD_BORDER_ROUTER)
425425
esp_err_t err = esp_rcp_ota_end(imageProcessor->mRcpOtaHandle);
426426
err |= esp_ota_end(imageProcessor->mOTAUpdateHandle);
427-
imageProcessor->mRcpOtaHandle = 0;
427+
imageProcessor->mRcpOtaHandle = 0;
428428
imageProcessor->mBrFirmwareSize = 0;
429-
imageProcessor->mRcpDone = false;
429+
imageProcessor->mRcpDone = false;
430430
#else
431431
esp_err_t err = esp_ota_end(imageProcessor->mOTAUpdateHandle);
432432
#endif // CONFIG_ENABLE_DELTA_OTA
@@ -473,9 +473,9 @@ void OTAImageProcessorImpl::HandleAbort(intptr_t context)
473473
{
474474
ESP_LOGE(TAG, "ESP RCP OTA abort failed");
475475
}
476-
imageProcessor->mRcpOtaHandle = 0;
476+
imageProcessor->mRcpOtaHandle = 0;
477477
imageProcessor->mBrFirmwareSize = 0;
478-
imageProcessor->mRcpDone = false;
478+
imageProcessor->mRcpDone = false;
479479
#endif
480480

481481
if (esp_ota_abort(imageProcessor->mOTAUpdateHandle) != ESP_OK)
@@ -541,9 +541,9 @@ void OTAImageProcessorImpl::HandleProcessBlock(intptr_t context)
541541
// Apply the patch and writes that data to the passive partition.
542542
err = esp_delta_ota_feed_patch(imageProcessor->mDeltaOTAUpdateHandle, blockToWrite.data() + index, blockToWrite.size() - index);
543543
#elif defined(CONFIG_AUTO_UPDATE_RCP) && defined(CONFIG_OPENTHREAD_BORDER_ROUTER)
544-
err = imageProcessor->ProcessRcpImage(context, blockToWrite.data(), blockToWrite.size());
544+
err = imageProcessor->ProcessRcpImage(context, blockToWrite.data(), blockToWrite.size());
545545
#else
546-
err = esp_ota_write(imageProcessor->mOTAUpdateHandle, blockToWrite.data(), blockToWrite.size());
546+
err = esp_ota_write(imageProcessor->mOTAUpdateHandle, blockToWrite.data(), blockToWrite.size());
547547
#endif // CONFIG_ENABLE_DELTA_OTA
548548

549549
#ifdef CONFIG_ENABLE_ENCRYPTED_OTA

src/platform/ESP32/OTAImageProcessorImpl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
#if defined(CONFIG_AUTO_UPDATE_RCP) && defined(CONFIG_OPENTHREAD_BORDER_ROUTER)
3737
#include "esp_check.h"
38-
#include "esp_rcp_update.h"
3938
#include "esp_rcp_ota.h"
39+
#include "esp_rcp_update.h"
4040
#endif
4141

4242
namespace chip {

0 commit comments

Comments
 (0)