Merged
Conversation
Collaborator
viacheslauK
commented
Dec 26, 2025
- Rework of JSON subscription flow: JSON receiver FB no longer parses all signals itself — it now creates nested JSON decoder function blocks (jsonDecoderMqttFb) that parse individual values/timestamps and produce signals.
- New JSON decoder FB: added mqtt_json_decoder_fb_impl.{h,cpp} to extract a single value + optional timestamp from incoming JSON and emit data/domain samples.
- JSON config handling changed: SignalList (big JSON string) → JsonConfig (string) and JsonConfigFile (path). JSON FB reads config (or file), extracts topic and per-signal descriptors and creates nested decoders. New "Topic" property.
- Stronger topic validation and subscription QoS: added PROPERTY_NAME_SUB_QOS / DEFAULT_SUB_QOS; subscription/unsubscribe now use the configured QoS.
- Status system refactor: introduced a generic StatusHelper to manage enumerated statuses (component / subscription / parsing / publishing / setting), replacing many manual EnumerationWithIntValue usages.
- Publisher FB improvements: cleaner status reporting (SignalStatus / PublishingStatus / SettingStatus), validation of properties (QoS, topic when sharedTs or multi), rename of publishing modes to descriptive enum names, and more robust publishing status tracking.
- Raw FB changes: Topic property replaced SignalList.
- MqttDataWrapper changes: JSON parsing & descriptor extraction reworked (now returns per-signal MqttMsgDescriptor with unit info), value/timestamp extraction refactored; API signatures changed.
- Tests and examples: many unit tests added / updated (including new test for json decoder), new example JSON files for tests, updates to examples (custom-mqtt-sub, raw-mqtt-sub, ref-dev-mqtt-pub) to use the new FB/type/property names and behavior.
- Renames & cleanups: several handler/source/header files renamed to clearer names (single_handler → atomic_signal_atomic_sample_handler, multisingle → atomic_signal_sample_arr_handler, multiple_shared → group_signal_shared_ts_handler, multiple → signal_arr_atomic_sample_handler), constants and FB type IDs removed leading '@' (e.g. @rootMqttFb → rootMqttFb), and general code cleanup (status helper, removal of old helper functions).
NikolaiShipilov
left a comment
There was a problem hiding this comment.
I’ve tested JSON subscriber FB with the GUI app and first impression is positive. Feature-wise, almost everything works as intended; only a few details need clarification.
In addition to the inline review comments (which are mostly recommendations), I’d like to point out the following items that should be addressed before merging:
- Base/derived receiver FB design: The organization of the base and derived receiver FB implementations needs refinement, particularly around virtual methods. Some base class methods seems to be redundantly marked as virtual even though they don’t require to be overridden in derived classes, while others overridden (including some pure virtual ones) are invoked from ctors and dtors of derived classes, so likely should be just a private methods of derived classes.
- FB type naming: Also renaming the FB types as pointed in inline comment is worth doing before the merge.
| std::shared_ptr<mqtt::MqttAsyncClient> subscriber; | ||
| EnumerationPtr subscriptionStatus; | ||
| StatusHelper<SubscriptionStatus> subscriptionStatus; | ||
| int qos = DEFAULT_SUB_QOS; |
There was a problem hiding this comment.
Would it make sense to introduce enum type for passing around the qos values ? Smth like this:
enum class QosValueType : daq::EnumType
{
AtMostOnce = 0, // QoS 0
AtLeastOnce = 1, // QoS 1
ExactlyOnce = 2 // QoS 2
};
NikolaiShipilov
approved these changes
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.