Sends pw_protobuf responses and receives pw_protobuf requests for a bidirectional 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 | PwpbServerReaderWriter ()=default |
Creates an inactive PwpbServerReaderWriter into which an active call can be moved. | |
| PwpbServerReaderWriter (PwpbServerReaderWriter &&)=default | |
| PwpbServerReaderWriter & | operator= (PwpbServerReaderWriter &&)=default |
| Status | Write (const Response &response) |
Encodes and sends a streamed Response message to the client. | |
| Status | Finish (Status status=OkStatus()) |
| Closes the RPC and sends the final status to the client. | |
| Status | TryFinish (Status status=OkStatus()) |
| Attempts to close the RPC and send the final status to the client. | |
Static Public Member Functions | |
| template<auto kMethod, typename ServiceImpl > | |
| static PwpbServerReaderWriter | Open (Server &server, uint32_t channel_id, ServiceImpl &service) |
Creates a PwpbServerReaderWriter that is ready to send responses for 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 status to the client.
| [in] | status | The overall status of the RPC to send to the client. |
ChannelOutput implementation if sending the packet failed.
|
inlinestatic |
Creates a PwpbServerReaderWriter that is ready to send responses for a particular RPC.
This can be used for testing or to send responses to 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 responses. |
| [in,out] | service | The registered service instance handling the RPC. |
PwpbServerReaderWriter bound to the specified channel and method.
|
inline |
Attempts to close the RPC and send the final status to the client.
Unlike Finish(), the call remains open if sending the final packet fails, allowing the caller to retry.
| [in] | status | The overall status of the RPC to send to the client. |
ChannelOutput implementation if sending the packet failed (the call remains active).
|
inline |
Encodes and sends a streamed Response message to the client.
| [in] | response | The Response message struct to encode and send. |
pw_rpc was unable to encode the pw_protobuf message.ChannelOutput implementation if sending the packet failed.