Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. C/C++
  4. Comms
  5. pw_rpc
  6. pw_protobuf RPC
  7. pw::rpc::PwpbClientWriter< Request, Response > Class Template Reference
pw::rpc::PwpbClientWriter< Request, Response > Class Template Reference

Overview

template<typename Request, typename Response>
class pw::rpc::PwpbClientWriter< Request, Response >

Sends pw_protobuf requests and receives the final pw_protobuf response in a client streaming RPC on a client.

Template Parameters
RequestThe generated pw_protobuf request message struct type.
ResponseThe generated pw_protobuf response message struct type.
Inheritance diagram for pw::rpc::PwpbClientWriter< Request, Response >:
pw::rpc::internal::PwpbUnaryResponseClientCall< Response >

Public Member Functions

constexpr PwpbClientWriter ()=default
 Creates an inactive PwpbClientWriter into which an active call can be moved.
 
 PwpbClientWriter (PwpbClientWriter &&)=default
 
PwpbClientWriter & operator= (PwpbClientWriter &&)=default
 
Status Write (const Request &request)
 Encodes and sends a streamed Request message to the server.
 

Friends

class internal::Call
 
class internal::PwpbUnaryResponseClientCall< Response >
 

Member Function Documentation

◆ Write()

template<typename Request , typename Response >
Status pw::rpc::PwpbClientWriter< Request, Response >::Write ( const Request &  request)
inline

Encodes and sends a streamed Request message to the server.

Parameters
[in]requestThe Request message struct to encode and send.
Returns
  • OK: The request was successfully sent.
  • FAILED_PRECONDITION: The writer is closed.
  • INTERNAL: pw_rpc was unable to encode the pw_protobuf message.
  • Other error codes from the ChannelOutput implementation if sending the packet failed.

The documentation for this class was generated from the following file: