thin-edge.io icon indicating copy to clipboard operation
thin-edge.io copied to clipboard

Simplify c8y_api::smartrest::topic module avoiding all redundant code to create topics

Open albinsuresh opened this issue 1 year ago • 1 comments

Is your refactoring request related to a problem? Please describe.

The c8y_api::smartrest::topic has various mechanisms to generate SmartREST topics for the main device, immediate child device, nested child devices and services. The recently introduced publish_topic_from_ancestors API already covers most of these cases and the rest are just redundant, especially the ones like C8yTopic::ChildSmartRestResponse, dedicated for immediate child devices only.

Describe the solution you'd like

Refactor the c8y_api::smartrest::topic module with a smaller set of helper functions to create topics for all kinds of targets: the main device, immediate child device, nested child devices and services.

albinsuresh avatar Oct 05 '23 06:10 albinsuresh