Classes | |
class | pw::rpc::ChannelOutput |
Functions | |
Result< uint32_t > | pw::rpc::ExtractChannelId (ConstByteSpan packet) |
template<uint32_t kNewChannelId> | |
Status | pw::rpc::ChangeEncodedChannelId (ByteSpan rpc_packet) |
Status | pw::rpc::ChangeEncodedChannelId (ByteSpan rpc_packet, uint32_t new_channel_id) |
constexpr size_t | pw::rpc::MaxSafePayloadSize (size_t encode_buffer_size=cfg::kEncodingBufferSizeBytes) |
Rewrites an encoded packet's channel ID in place. Both channel IDs MUST be less than 128.
Version of ChangeEncodedChannelId
with a runtime variable channel ID. Prefer the template parameter version when possible to avoid a runtime check on the new channel ID.
Result< uint32_t > pw::rpc::ExtractChannelId | ( | ConstByteSpan | packet | ) |
|
constexpr |
Returns the maximum payload size of an RPC packet for RPC endpoints as configured. This can be used when allocating response encode buffers for RPC services. If the RPC encode buffer is too small to fit RPC packet headers, this returns zero.
By default, this function uses PW_RPC_ENCODING_BUFFER_SIZE_BYTES
to determine the largest supported payload, even when dynamic allocation is enabled.
MaxSafePayloadSize
does NOT account for the channel MTU, which may be smaller. Call MaxWriteSizeBytes()
on an RPC's call object (reader/writer) to account for channel MTU.