21#if defined(PW_RPC_CLIENT_STREAM_END_CALLBACK) && \
22 PW_RPC_CLIENT_STREAM_END_CALLBACK
24 "Warning PW_RPC_CLIENT_STREAM_END_CALLBACK is deprecated! " \
25 "Use PW_RPC_COMPLETION_REQUEST_CALLBACK instead.")
26#define PW_RPC_COMPLETION_REQUEST_CALLBACK 1
29#undef PW_RPC_CLIENT_STREAM_END_CALLBACK
44#ifndef PW_RPC_COMPLETION_REQUEST_CALLBACK
45#define PW_RPC_COMPLETION_REQUEST_CALLBACK 0
52#ifndef PW_RPC_METHOD_STORES_TYPE
53#define PW_RPC_METHOD_STORES_TYPE 0
68#ifndef PW_RPC_NANOPB_STRUCT_MIN_BUFFER_SIZE
69#define PW_RPC_NANOPB_STRUCT_MIN_BUFFER_SIZE 64
85#ifndef PW_RPC_USE_GLOBAL_MUTEX
86#define PW_RPC_USE_GLOBAL_MUTEX 1
113#ifndef PW_RPC_YIELD_MODE
114#if PW_RPC_USE_GLOBAL_MUTEX == 0
115#define PW_RPC_YIELD_MODE PW_RPC_YIELD_MODE_BUSY_LOOP
117#define PW_RPC_YIELD_MODE PW_RPC_YIELD_MODE_SLEEP
127#define PW_RPC_YIELD_MODE_BUSY_LOOP 100
128#define PW_RPC_YIELD_MODE_SLEEP 101
129#define PW_RPC_YIELD_MODE_YIELD 102
136#ifndef PW_RPC_YIELD_SLEEP_DURATION
140#if defined(_WIN32) || defined(__APPLE__) || \
141 defined(__linux__) && !defined(__ZEPHYR__)
142#define PW_RPC_YIELD_SLEEP_DURATION std::chrono::milliseconds(1)
144#define PW_RPC_YIELD_SLEEP_DURATION pw::chrono::SystemClock::duration(1)
151#if PW_RPC_YIELD_MODE != PW_RPC_YIELD_MODE_SLEEP
152#undef PW_RPC_YIELD_SLEEP_DURATION
170#ifndef PW_RPC_CALLBACK_TIMEOUT_TICKS
171#define PW_RPC_CALLBACK_TIMEOUT_TICKS 10000
192#ifndef PW_RPC_DYNAMIC_ALLOCATION
193#define PW_RPC_DYNAMIC_ALLOCATION 0
200#ifndef PW_RPC_ALLOW_INVOCATIONS_ON_STACK
201#define PW_RPC_ALLOW_INVOCATIONS_ON_STACK 1
205 "If PW_RPC_ALLOW_INVOCATIONS_ON_STACK is 0, "
206 "PW_RPC_DYNAMIC_ALLOCATION must be 1 to allow RPC calls.");
208#if defined(PW_RPC_DYNAMIC_CONTAINER) || \
209 defined(PW_RPC_DYNAMIC_CONTAINER_INCLUDE)
212 "PW_RPC_DYNAMIC_ALLOCATION is disabled, so PW_RPC_DYNAMIC_CONTAINER and "
213 "PW_RPC_DYNAMIC_CONTAINER_INCLUDE have no effect and should not be set.");
230#ifndef PW_RPC_DYNAMIC_CONTAINER
231#define PW_RPC_DYNAMIC_CONTAINER(type) std::vector<type>
239#ifndef PW_RPC_DYNAMIC_CONTAINER_INCLUDE
240#define PW_RPC_DYNAMIC_CONTAINER_INCLUDE <vector>
247#ifndef PW_RPC_MAKE_UNIQUE_PTR
248#define PW_RPC_MAKE_UNIQUE_PTR(type, ...) \
249 std::unique_ptr<type>(new type(__VA_ARGS__))
255#ifndef PW_RPC_MAKE_UNIQUE_PTR_INCLUDE
256#define PW_RPC_MAKE_UNIQUE_PTR_INCLUDE <memory>
265#ifndef PW_RPC_ENCODING_BUFFER_SIZE_BYTES
266#define PW_RPC_ENCODING_BUFFER_SIZE_BYTES 512
273#ifndef PW_RPC_PWPB_SCRATCH_BUFFER_SIZE_BYTES
274#define PW_RPC_PWPB_SCRATCH_BUFFER_SIZE_BYTES 64
278#ifndef PW_RPC_CONFIG_LOG_LEVEL
279#define PW_RPC_CONFIG_LOG_LEVEL PW_LOG_LEVEL_INFO
283#ifndef PW_RPC_CONFIG_LOG_MODULE_NAME
284#define PW_RPC_CONFIG_LOG_MODULE_NAME "PW_RPC"
287namespace pw::rpc::cfg {
289template <
typename...>
290constexpr std::bool_constant<PW_RPC_COMPLETION_REQUEST_CALLBACK>
291 kClientStreamEndCallbackEnabled;
293template <
typename...>
294constexpr std::bool_constant<PW_RPC_METHOD_STORES_TYPE> kMethodStoresType;
296template <
typename...>
297constexpr std::bool_constant<PW_RPC_DYNAMIC_ALLOCATION>
298 kDynamicAllocationEnabled;
300inline constexpr size_t kNanopbStructMinBufferSize =
303inline constexpr size_t kEncodingBufferSizeBytes =
306inline constexpr size_t kPwpbScratchBufferSizeBytes =
309#undef PW_RPC_NANOPB_STRUCT_MIN_BUFFER_SIZE
310#undef PW_RPC_ENCODING_BUFFER_SIZE_BYTES
311#undef PW_RPC_PWPB_SCRATCH_BUFFER_SIZE_BYTES
319#ifndef PW_RPC_NANOPB_STRUCT_BUFFER_STACK_ALLOCATE
320#define PW_RPC_NANOPB_STRUCT_BUFFER_STACK_ALLOCATE 1
324#if PW_RPC_NANOPB_STRUCT_BUFFER_STACK_ALLOCATE
325#define _PW_RPC_NANOPB_STRUCT_STORAGE_CLASS
327#define _PW_RPC_NANOPB_STRUCT_STORAGE_CLASS static
330#undef PW_RPC_NANOPB_STRUCT_BUFFER_STACK_ALLOCATE
#define PW_RPC_ALLOW_INVOCATIONS_ON_STACK
Definition: config.h:201
#define PW_RPC_PWPB_SCRATCH_BUFFER_SIZE_BYTES
Definition: config.h:274
#define PW_RPC_NANOPB_STRUCT_MIN_BUFFER_SIZE
Definition: config.h:69
#define PW_RPC_DYNAMIC_ALLOCATION
Definition: config.h:193
#define PW_RPC_ENCODING_BUFFER_SIZE_BYTES
Definition: config.h:266