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) |
Status pw::rpc::ChangeEncodedChannelId | ( | ByteSpan | rpc_packet | ) |
Rewrites an encoded packet's channel ID in place. Both channel IDs MUST be less than 128.
embed:rst:leading-asterisk * * .. pw-status-codes:: * * OK: Successfully replaced the channel ID * * DATA_LOSS: parsing the packet failed * * OUT_OF_RANGE: the encoded packet's channel ID was 128 or larger * *
|
inline |
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 | ) |
Extracts the channel ID from a pw_rpc packet.
embed:rst:leading-asterisk * * .. pw-status-codes:: * * OK: returns the channel ID in the packet * * DATA_LOSS: the packet is corrupt and the channel ID could not be found. * *