nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
Loading...
Searching...
No Matches
service.hpp File Reference

rclcpp::Service<S> — the arena-registered (callback-style) service server, and Service<S>::SharedPtr = rclcpp::ServiceHandle<S>. More...

#include <cstdint>
#include <cstddef>
#include "rclcpp/detail/callback_context.hpp"
#include "rclcpp/detail/config.hpp"
#include "rclcpp/detail/entity_name.hpp"
#include "rclcpp/result.hpp"
#include "rclcpp/service_handle.hpp"
#include "rclcpp/size_bound.hpp"
#include "rclcpp/detail/nros_cpp_ffi.h"
#include "rclcpp/qos.hpp"
#include "rclcpp/detail/rmw_request_id.hpp"
#include "rclcpp/node.hpp"
#include "rclcpp/logging.hpp"
#include "rclcpp/inplace_fn.hpp"
Include dependency graph for service.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  rclcpp::Service< S >

Namespaces

namespace  rclcpp

Typedefs

typedef bool(* nros_cpp_service_request_callback_t) (const uint8_t *req, size_t req_len, uint8_t *resp, size_t resp_cap, size_t *resp_len, void *ctx)
typedef bool(* nros_cpp_service_request_id_callback_t) (const uint8_t *req, size_t req_len, rmw_request_id_t *request_id, uint8_t *resp, size_t resp_cap, size_t *resp_len, void *ctx)
 Issue 2081 — a service trampoline that also receives the request's id.

Functions

nros_cpp_ret_t nros_cpp_service_server_register (const nros_cpp_node_t *node, const char *service_name, const char *type_name, const char *type_hash, nros_cpp_qos_t qos, nros_cpp_service_request_callback_t callback, void *context, uint8_t sched_context, size_t *out_handle_id)
nros_cpp_ret_t nros_cpp_service_server_register_capturing (const nros_cpp_node_t *node, const char *service_name, const char *type_name, const char *type_hash, nros_cpp_qos_t qos, nros_cpp_service_request_callback_t callback, const uint8_t *capture, size_t capture_len, void(*capture_drop)(void *), uint8_t sched_context, size_t *out_handle_id)
nros_cpp_ret_t nros_cpp_service_server_register_with_request_id (const nros_cpp_node_t *node, const char *service_name, const char *type_name, const char *type_hash, nros_cpp_qos_t qos, nros_cpp_service_request_id_callback_t callback, void *context, const uint8_t *capture, size_t capture_len, void(*capture_drop)(void *), uint8_t sched_context, size_t *out_handle_id)

Detailed Description

rclcpp::Service<S> — the arena-registered (callback-style) service server, and Service<S>::SharedPtr = rclcpp::ServiceHandle<S>.

The POLL-style server — caller-owned storage, take_request() / send_response() — is rclcpp::PollService<S> in rclcpp/polling_service.hpp since phase-456 W5. See there for why the two are separate types.

Typedef Documentation

◆ nros_cpp_service_request_callback_t

typedef bool(* nros_cpp_service_request_callback_t) (const uint8_t *req, size_t req_len, uint8_t *resp, size_t resp_cap, size_t *resp_len, void *ctx)

◆ nros_cpp_service_request_id_callback_t

typedef bool(* nros_cpp_service_request_id_callback_t) (const uint8_t *req, size_t req_len, rmw_request_id_t *request_id, uint8_t *resp, size_t resp_cap, size_t *resp_len, void *ctx)

Issue 2081 — a service trampoline that also receives the request's id.

Function Documentation

◆ nros_cpp_service_server_register()

nros_cpp_ret_t nros_cpp_service_server_register ( const nros_cpp_node_t * node,
const char * service_name,
const char * type_name,
const char * type_hash,
nros_cpp_qos_t qos,
nros_cpp_service_request_callback_t callback,
void * context,
uint8_t sched_context,
size_t * out_handle_id )

◆ nros_cpp_service_server_register_capturing()

nros_cpp_ret_t nros_cpp_service_server_register_capturing ( const nros_cpp_node_t * node,
const char * service_name,
const char * type_name,
const char * type_hash,
nros_cpp_qos_t qos,
nros_cpp_service_request_callback_t callback,
const uint8_t * capture,
size_t capture_len,
void(* capture_drop )(void *),
uint8_t sched_context,
size_t * out_handle_id )

◆ nros_cpp_service_server_register_with_request_id()

nros_cpp_ret_t nros_cpp_service_server_register_with_request_id ( const nros_cpp_node_t * node,
const char * service_name,
const char * type_name,
const char * type_hash,
nros_cpp_qos_t qos,
nros_cpp_service_request_id_callback_t callback,
void * context,
const uint8_t * capture,
size_t capture_len,
void(* capture_drop )(void *),
uint8_t sched_context,
size_t * out_handle_id )