Skip to content

Commit 04e3ff5

Browse files
committed
Fix event config loading defaulting to RT_UNRELIABLE
Summary: When events are first parsed, the config loader reads eventgroups first. Because the event doesn't have an existing configuration, it creates one with RT_UNRELIABLE by default. But when the actual event is parsed, it detects the dummy event and displays a VSOMEIP_INFO message; and the event reliability type is not being correctly updated to RT_RELIABLE. This fix changes the default reliability type to RT_UNKNOWN when events are created from 'eventgroup' parsing. And then updates the event correctly when the actual event entry is parsed.
1 parent d584217 commit 04e3ff5

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

implementation/configuration/src/configuration_impl.cpp

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,28 +2203,37 @@ void configuration_impl::load_event(
22032203
}
22042204

22052205
if (its_event_id > 0) {
2206+
// If event reliability type was not configured,
2207+
if (its_reliability == reliability_type_e::RT_UNKNOWN) {
2208+
if (_service->unreliable_ != ILLEGAL_PORT) {
2209+
its_reliability = reliability_type_e::RT_UNRELIABLE;
2210+
} else if (_service->reliable_ != ILLEGAL_PORT) {
2211+
its_reliability = reliability_type_e::RT_RELIABLE;
2212+
}
2213+
VSOMEIP_WARNING << "Reliability type for event ["
2214+
<< std::hex << _service->service_ << "."
2215+
<< _service->instance_ << "."
2216+
<< its_event_id << "] was not configured Using : "
2217+
<< ((its_reliability == reliability_type_e::RT_RELIABLE)
2218+
? "RT_RELIABLE" : "RT_UNRELIABLE");
2219+
}
2220+
22062221
auto found_event = _service->events_.find(its_event_id);
22072222
if (found_event != _service->events_.end()) {
2208-
VSOMEIP_INFO << "Multiple configurations for event ["
2223+
if (found_event->second->reliability_ == reliability_type_e::RT_UNKNOWN) {
2224+
auto its_event = found_event->second;
2225+
its_event->reliability_ = its_reliability;
2226+
its_event->is_field_ = its_is_field;
2227+
its_event->cycle_ = its_cycle;
2228+
its_event->update_on_change_ = its_update_on_change;
2229+
its_event->change_resets_cycle_ = its_change_resets_cycle;
2230+
} else {
2231+
VSOMEIP_WARNING << "Multiple configurations for event ["
22092232
<< std::hex << _service->service_ << "."
22102233
<< _service->instance_ << "."
22112234
<< its_event_id << "].";
2212-
} else {
2213-
// If event reliability type was not configured,
2214-
if (its_reliability == reliability_type_e::RT_UNKNOWN) {
2215-
if (_service->unreliable_ != ILLEGAL_PORT) {
2216-
its_reliability = reliability_type_e::RT_UNRELIABLE;
2217-
} else if (_service->reliable_ != ILLEGAL_PORT) {
2218-
its_reliability = reliability_type_e::RT_RELIABLE;
2219-
}
2220-
VSOMEIP_WARNING << "Reliability type for event ["
2221-
<< std::hex << _service->service_ << "."
2222-
<< _service->instance_ << "."
2223-
<< its_event_id << "] was not configured Using : "
2224-
<< ((its_reliability == reliability_type_e::RT_RELIABLE)
2225-
? "RT_RELIABLE" : "RT_UNRELIABLE");
22262235
}
2227-
2236+
} else {
22282237
auto its_event = std::make_shared<event>(
22292238
its_event_id, its_is_field, its_reliability,
22302239
its_cycle, its_change_resets_cycle,
@@ -2294,7 +2303,7 @@ void configuration_impl::load_eventgroup(
22942303
its_event = find_event->second;
22952304
} else {
22962305
its_event = std::make_shared<event>(its_event_id,
2297-
false, reliability_type_e::RT_UNRELIABLE,
2306+
false, reliability_type_e::RT_UNKNOWN,
22982307
std::chrono::milliseconds::zero(),
22992308
false, true);
23002309
}

0 commit comments

Comments
 (0)