Skip to content

Commit 5313459

Browse files
committed
💉 Fix PHM monitoring flow bugs:
- Initialize offset to parse FIFO packet correctly; - Fix PHM manifest parsing bugs; - Offering the recovery action before initializing the GlobalSupervision; - Typo fix.
1 parent c8bf3a3 commit 5313459

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

src/application/helper/fifo_checkpoint_communicator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ namespace application
7878
const std::vector<uint8_t> cPayload(
7979
_buffer.cbegin(), _buffer.cend());
8080

81-
std::size_t _offset;
81+
std::size_t _offset = 0;
8282
const uint32_t cCheckpoint{
8383
ara::com::helper::ExtractInteger(cPayload, _offset)};
8484

src/application/helper/log_recovery_action.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace application
4242
return;
4343
}
4444

45-
_logStream << " of is expired on "
45+
_logStream << " is expired on "
4646
<< executionError.functionGroup->GetInstance().ToString();
4747

4848
mLoggingFramework->Log(mLogger, cErrorLevel, _logStream);

src/application/platform/platform_health_management.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#include "../helper/argument_configuration.h"
32
#include "./platform_health_management.h"
43

@@ -41,7 +40,8 @@ namespace application
4140
content.c_str(), content.length());
4241

4342
const arxml::ArxmlNode cCheckpointIdNode{
44-
cCheckpointReader.GetRootNode({"CHECKPOINT-ID"})};
43+
cCheckpointReader.GetRootNode(
44+
{"SUPERVISION-CHECKPOINT", "CHECKPOINT-ID"})};
4545

4646
const auto cResult{cCheckpointIdNode.GetValue<uint32_t>()};
4747
return cResult;
@@ -111,29 +111,29 @@ namespace application
111111

112112
const auto cExpectedAliveIndications{
113113
cAliveSupervisionReader.GetRootNode(
114-
{"EXPECTED-ALIVE-INDICATIONS"})
114+
{"ALIVE-SUPERVISION", "EXPECTED-ALIVE-INDICATIONS"})
115115
.GetValue<uint16_t>()};
116116

117117
const auto cMinMargin{
118118
cAliveSupervisionReader.GetRootNode(
119-
{"MIN-MARGIN"})
119+
{"ALIVE-SUPERVISION", "MIN-MARGIN"})
120120
.GetValue<uint16_t>()};
121121

122122
const auto cMaxMargin{
123123
cAliveSupervisionReader.GetRootNode(
124-
{"MAX-MARGIN"})
124+
{"ALIVE-SUPERVISION", "MAX-MARGIN"})
125125
.GetValue<uint16_t>()};
126126

127127
const auto cAliveReferenceCycleUInt{
128128
cAliveSupervisionReader.GetRootNode(
129-
{"ALIVE-REFERENCE-CYCLE"})
129+
{"ALIVE-SUPERVISION", "ALIVE-REFERENCE-CYCLE"})
130130
.GetValue<uint32_t>()};
131131
const std::chrono::milliseconds cAliveReferenceCycle(
132132
cAliveReferenceCycleUInt);
133133

134134
const auto cFailedReferenceCyclesTolerance{
135135
cAliveSupervisionReader.GetRootNode(
136-
{"FAILED-REFERENCE-CYCLES-TOLERANCE"})
136+
{"ALIVE-SUPERVISION", "FAILED-REFERENCE-CYCLES-TOLERANCE"})
137137
.GetValue<uint8_t>()};
138138

139139
mAliveSupervision =
@@ -195,13 +195,13 @@ namespace application
195195

196196
const auto cMinDeadlineUInt{
197197
cDeadlineSupervisionReader.GetRootNode(
198-
{"MIN-DEADLINE"})
198+
{"DEADLINE-SUPERVISION", "MIN-DEADLINE"})
199199
.GetValue<uint32_t>()};
200200
const std::chrono::milliseconds cMinDeadline(cMinDeadlineUInt);
201201

202202
const auto cMaxDeadlineUInt{
203203
cDeadlineSupervisionReader.GetRootNode(
204-
{"MAX-DEADLINE"})
204+
{"DEADLINE-SUPERVISION", "MAX-DEADLINE"})
205205
.GetValue<uint32_t>()};
206206
const std::chrono::milliseconds cMaxDeadline(cMaxDeadlineUInt);
207207

@@ -211,7 +211,7 @@ namespace application
211211

212212
const arxml::ArxmlNode cCheckpointTransition{
213213
cDeadlineSupervisionReader.GetRootNode(
214-
{"TRANSITION", "CHECKPOINT-TRANSITION"})};
214+
{"DEADLINE-SUPERVISION", "TRANSITION", "CHECKPOINT-TRANSITION"})};
215215

216216
std::string _sourceCheckpointIdStr;
217217
bool _successful{
@@ -307,6 +307,7 @@ namespace application
307307
configureAliveSupervision(cArxmlReader, _checkpoints);
308308
configureDeadlineSupervision(cArxmlReader, _checkpoints);
309309

310+
mRecoveryAction.Offer();
310311
mGlobalSupervision =
311312
new ara::phm::supervisors::GlobalSupervision(
312313
{mAliveSupervision, mDeadlineSupervision});

0 commit comments

Comments
 (0)