1010#include " libcyphal/application/node.hpp"
1111#include " libcyphal/presentation/presentation.hpp"
1212#include " libcyphal/presentation/server.hpp"
13+ #include " libcyphal/time_provider.hpp"
14+ #include " libcyphal/transport/types.hpp"
1315#include " libcyphal/types.hpp"
1416
1517#include < cetl/pf17/cetlpf.hpp>
@@ -52,9 +54,12 @@ class ExecCmdProvider // NOSONAR cpp:S4963
5254 // /
5355 // / @param node The application layer node instance. In use to access heartbeat producer.
5456 // / @param presentation The presentation layer instance. In use to create 'ExecuteCommand' service server.
57+ // / @param time_provider The time provider - in use to calculate RPC call deadlines.
5558 // / @return The ExecuteCommand provider instance or a failure.
5659 // /
57- static auto make (libcyphal::application::Node& node, libcyphal::presentation::Presentation& presentation)
60+ static auto make (libcyphal::application::Node& node,
61+ libcyphal::presentation::Presentation& presentation,
62+ libcyphal::ITimeProvider& time_provider)
5863 -> libcyphal::Expected<Derived, libcyphal::presentation::Presentation::MakeFailure>
5964 {
6065 auto maybe_srv = presentation.makeServer <Service>();
@@ -63,7 +68,7 @@ class ExecCmdProvider // NOSONAR cpp:S4963
6368 return std::move (*failure);
6469 }
6570
66- return Derived{node, presentation, cetl::get<Server>(std::move (maybe_srv))};
71+ return Derived{node, presentation, time_provider, cetl::get<Server>(std::move (maybe_srv))};
6772 }
6873
6974 ExecCmdProvider (ExecCmdProvider&& other) noexcept
@@ -96,16 +101,19 @@ class ExecCmdProvider // NOSONAR cpp:S4963
96101 // / The user should override the method to handle custom commands.
97102 // / If the method returns `false`, the server will respond with a `STATUS_BAD_COMMAND` status.
98103 // /
99- // / @param command The command to be executed.
100- // / @param parameter The command parameter.
101- // / @param response The response to be sent back to the requester.
104+ // / @param command The command to be executed.
105+ // / @param parameter The command parameter.
106+ // / @param metadata The transport RX metadata.
107+ // / @param response The response to be sent back to the requester.
102108 // /
103- virtual bool onCommand (const Request::_traits_::TypeOf::command command,
104- const cetl::string_view parameter,
105- Response& response) noexcept
109+ virtual bool onCommand (const Request::_traits_::TypeOf::command command,
110+ const cetl::string_view parameter,
111+ const libcyphal::transport::ServiceRxMetadata& metadata,
112+ Response& response) noexcept
106113 {
107114 (void ) command;
108115 (void ) parameter;
116+ (void ) metadata;
109117 (void ) response;
110118
111119 return false ;
@@ -126,7 +134,7 @@ class ExecCmdProvider // NOSONAR cpp:S4963
126134 server_.setOnRequestCallback ([this ](const auto & arg, auto continuation) {
127135 //
128136 Response response{alloc_};
129- if (!onCommand (arg.request .command , makeStringView (arg.request .parameter ), response))
137+ if (!onCommand (arg.request .command , makeStringView (arg.request .parameter ), arg. metadata , response))
130138 {
131139 response.status = Response::STATUS_BAD_COMMAND;
132140 }
0 commit comments