Skip to content

Commit

Permalink
Rename API to create_service_server to be consistent with create_serv…
Browse files Browse the repository at this point in the history
…ice_client.
  • Loading branch information
aentinger committed Jan 9, 2023
1 parent 48ef1b5 commit 43eecd1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Node::Heap<Node::DEFAULT_O1HEAP_SIZE> node_heap;
CircularBuffer<Node::TReceiveCircularBuffer>::Heap<Node::DEFAULT_RX_QUEUE_SIZE> node_rx_queue;
Node node_hdl(node_heap.data(), node_heap.size(), node_rx_queue.data(), node_rx_queue.size(), micros);

ServiceServer execute_command_srv = node_hdl.create_service<ExecuteCommand_1_0::Request<>, ExecuteCommand_1_0::Response<>>(
ServiceServer execute_command_srv = node_hdl.create_service_server<ExecuteCommand_1_0::Request<>, ExecuteCommand_1_0::Response<>>(
ExecuteCommand_1_0::Request<>::PORT_ID,
2*1000*1000UL,
onExecuteCommand_1_0_Request_Received);
Expand Down
6 changes: 3 additions & 3 deletions src/Node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ class Node
OnReceiveCb&& on_receive_cb);

template <typename T_REQ, typename T_RSP, typename OnRequestCb>
ServiceServer create_service(CanardPortID const port_id,
CanardMicrosecond const tx_timeout_usec,
OnRequestCb&& on_request_cb);
ServiceServer create_service_server(CanardPortID const port_id,
CanardMicrosecond const tx_timeout_usec,
OnRequestCb&& on_request_cb);

template <typename T_REQ, typename T_RSP, typename OnResponseCb>
ServiceClient<T_REQ> create_service_client(CanardPortID const port_id,
Expand Down
6 changes: 3 additions & 3 deletions src/Node.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Subscription Node::create_subscription(CanardPortID const port_id,
}

template <typename T_REQ, typename T_RSP, typename OnRequestCb>
ServiceServer Node::create_service(CanardPortID const port_id,
CanardMicrosecond const tx_timeout_usec,
OnRequestCb&& on_request_cb)
ServiceServer Node::create_service_server(CanardPortID const port_id,
CanardMicrosecond const tx_timeout_usec,
OnRequestCb&& on_request_cb)
{
auto srv = std::make_shared<impl::ServiceServer<T_REQ, T_RSP, OnRequestCb>>(
*this,
Expand Down
2 changes: 1 addition & 1 deletion src/nodeinfo/NodeInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ NodeInfo::NodeInfo(Node & node_hdl,
typedef uavcan::node::GetInfo_1_0::Request<> TGetInfoRequest;
typedef uavcan::node::GetInfo_1_0::Response<> TGetInfoResponse;

_node_info_srv = node_hdl.create_service<TGetInfoRequest, TGetInfoResponse>(
_node_info_srv = node_hdl.create_service_server<TGetInfoRequest, TGetInfoResponse>(
TGetInfoRequest::PORT_ID,
2*1000*1000UL,
[this](TGetInfoRequest const & req) -> TGetInfoResponse
Expand Down
4 changes: 2 additions & 2 deletions src/register/RegisterList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ RegisterList::RegisterList(Node & node_hdl)
};


_reg_list_srv = node_hdl.create_service<TListRequest, TListResponse>(
_reg_list_srv = node_hdl.create_service_server<TListRequest, TListResponse>(
TListRequest::PORT_ID,
2*1000*1000UL,
[this](TListRequest const & req)
Expand All @@ -238,7 +238,7 @@ RegisterList::RegisterList(Node & node_hdl)
});


_reg_access_srv = node_hdl.create_service<TAccessRequest, TAccessResponse>(
_reg_access_srv = node_hdl.create_service_server<TAccessRequest, TAccessResponse>(
TAccessRequest::PORT_ID,
2*1000*1000UL,
[this](TAccessRequest const & req)
Expand Down

0 comments on commit 43eecd1

Please sign in to comment.