Receives pw_protobuf requests and sends the final pw_protobuf response for a client streaming RPC on a server.
| Request | The generated pw_protobuf request message struct type. |
| Response | The generated pw_protobuf response message struct type. |
Public Member Functions | |
| constexpr | PwpbServerReader ()=default |
Creates an inactive PwpbServerReader into which an active call can be moved. | |
| PwpbServerReader (PwpbServerReader &&)=default | |
| PwpbServerReader & | operator= (PwpbServerReader &&)=default |
| Status | Finish (const Response &response, Status status=OkStatus()) |
Closes the RPC and sends the final Response message and status. | |
| Status | TryFinish (const Response &response, Status status=OkStatus()) |
Attempts to close the RPC and send the final Response message and status to the client. | |
Static Public Member Functions | |
| template<auto kMethod, typename ServiceImpl > | |
| static PwpbServerReader | Open (Server &server, uint32_t channel_id, ServiceImpl &service) |
Creates a PwpbServerReader that is ready to send a response to a particular RPC. | |
Friends | |
| class | internal::Call |
| class | internal::PwpbMethod |
| class | Server |
| template<typename , typename , uint32_t > | |
| class | internal::test::InvocationContext |
|
inline |
Closes the RPC and sends the final Response message and status.
| [in] | response | The Response message struct to encode and send. |
| [in] | status | The overall status of the RPC to send to the client. |
pw_rpc was unable to encode the pw_protobuf message.ChannelOutput implementation if sending the packet failed.
|
inlinestatic |
Creates a PwpbServerReader that is ready to send a response to a particular RPC.
This can be used for testing or to finish an RPC that has not been started by a client.
| kMethod | Pointer to the generated service method. |
| ServiceImpl | The service implementation class. |
| [in,out] | server | The RPC Server on which to open the call. |
| [in] | channel_id | The ID of the channel on which to send the response. |
| [in,out] | service | The registered service instance handling the RPC. |
PwpbServerReader bound to the specified channel and method.
|
inline |
Attempts to close the RPC and send the final Response message and status to the client.
Unlike Finish(), the call remains open if sending the packet fails, allowing the caller to retry.
| [in] | response | The Response message struct to encode and send. |
| [in] | status | The overall status of the RPC to send to the client. |
pw_rpc was unable to encode the pw_protobuf message.ChannelOutput implementation if sending the packet failed (the call remains active).