Skip to content

Commit 8428564

Browse files
authored
[ASR] fix double init in BLEManager and OTA (#31579)
* fix BLE pairing issue because the initialization time of ble is earlier the callback registration time * fix ota fail issue * Restyled by clang-format * Update ASR582X SDK to v1.9.1
1 parent a2d98f8 commit 8428564

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/platform/ASR/ASROTAImageProcessor.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
#include <app/clusters/ota-requestor/OTADownloader.h>
2121
#include <app/clusters/ota-requestor/OTARequestorInterface.h>
2222

23-
/// No error, operation OK
24-
#define LEGA_OTA_OK 0L
25-
2623
namespace chip {
2724

2825
CHIP_ERROR ASROTAImageProcessor::PrepareDownload()
@@ -121,7 +118,8 @@ void ASROTAImageProcessor::HandlePrepareDownload(intptr_t context)
121118

122119
imageProcessor->mHeaderParser.Init();
123120

124-
imageProcessor->mDownloader->OnPreparedForDownload(err == LEGA_OTA_OK ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL);
121+
imageProcessor->mDownloader->OnPreparedForDownload(
122+
((err == LEGA_OTA_OK) || (err == LEGA_OTA_INIT_ALREADY)) ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL);
125123
}
126124

127125
void ASROTAImageProcessor::HandleFinalize(intptr_t context)

src/platform/ASR/BLEManagerImpl.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ CHIP_ERROR BLEManagerImpl::_Init()
110110
}
111111
else
112112
{
113+
matter_ble_stack_open();
114+
matter_ble_add_service();
115+
BLEMgrImpl().SetStackInit();
113116
mFlags.Set(Flags::kFlag_StackInitialized, true);
114117
log_i("ble is alread open!\n");
115118
}

0 commit comments

Comments
 (0)