|
49 | 49 | // we just double the timeout to give enough time for the BDX init to come in a reasonable amount of time.
|
50 | 50 | constexpr System::Clock::Timeout kBdxInitReceivedTimeout = System::Clock::Seconds16(10 * 60);
|
51 | 51 |
|
52 |
| -// Time in seconds after which the requestor should retry calling query image if busy status is receieved |
53 |
| -constexpr uint32_t kDelayedActionTimeSeconds = 120; |
| 52 | +// Time in seconds after which the requestor should retry calling query image if |
| 53 | +// busy status is receieved. The spec minimum is 2 minutes, but in practice OTA |
| 54 | +// generally takes a lot longer than that and devices only retry a few times |
| 55 | +// before giving up. Default to 10 minutes for now, until we have a better |
| 56 | +// system of computing an expected completion time for the currently-running |
| 57 | +// OTA. |
| 58 | +constexpr uint32_t kDelayedActionTimeSeconds = 600; |
54 | 59 |
|
55 | 60 | constexpr System::Clock::Timeout kBdxTimeout = System::Clock::Seconds16(5 * 60); // OTA Spec mandates >= 5 minutes
|
56 | 61 | constexpr System::Clock::Timeout kBdxPollIntervalMs = System::Clock::Milliseconds32(50);
|
@@ -132,6 +137,14 @@ void SetDelegate(id<MTROTAProviderDelegate> delegate, dispatch_queue_t delegateN
|
132 | 137 | void ResetState()
|
133 | 138 | {
|
134 | 139 | assertChipStackLockedByCurrentThread();
|
| 140 | + if (mNodeId.HasValue() && mFabricIndex.HasValue()) { |
| 141 | + ChipLogProgress(Controller, |
| 142 | + "Resetting state for OTA Provider; no longer providing an update for node id 0x" ChipLogFormatX64 |
| 143 | + ", fabric index %u", |
| 144 | + ChipLogValueX64(mNodeId.Value()), mFabricIndex.Value()); |
| 145 | + } else { |
| 146 | + ChipLogProgress(Controller, "Resetting state for OTA Provider"); |
| 147 | + } |
135 | 148 | if (mSystemLayer) {
|
136 | 149 | mSystemLayer->CancelTimer(HandleBdxInitReceivedTimeoutExpired, this);
|
137 | 150 | }
|
@@ -678,7 +691,6 @@ bool GetPeerNodeInfo(CommandHandler * commandHandler, const ConcreteCommandPath
|
678 | 691 | handler->AddResponse(cachedCommandPath, protocolNotSupportedResponse);
|
679 | 692 | }
|
680 | 693 | handle.Release();
|
681 |
| - gOtaSender.ResetState(); |
682 | 694 | }
|
683 | 695 |
|
684 | 696 | errorHandler:^(NSError *) {
|
|
0 commit comments