aboutsummaryrefslogtreecommitdiff
path: root/pw_rpc/nanopb/public/pw_rpc/nanopb/client_reader_writer.h
diff options
context:
space:
mode:
Diffstat (limited to 'pw_rpc/nanopb/public/pw_rpc/nanopb/client_reader_writer.h')
-rw-r--r--pw_rpc/nanopb/public/pw_rpc/nanopb/client_reader_writer.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/pw_rpc/nanopb/public/pw_rpc/nanopb/client_reader_writer.h b/pw_rpc/nanopb/public/pw_rpc/nanopb/client_reader_writer.h
index 3aac5a576..bc3fbe814 100644
--- a/pw_rpc/nanopb/public/pw_rpc/nanopb/client_reader_writer.h
+++ b/pw_rpc/nanopb/public/pw_rpc/nanopb/client_reader_writer.h
@@ -55,6 +55,8 @@ class NanopbUnaryResponseClientCall : public UnaryResponseClientCall {
return call;
}
+ ~NanopbUnaryResponseClientCall() { DestroyClientCall(); }
+
protected:
constexpr NanopbUnaryResponseClientCall() = default;
@@ -146,6 +148,8 @@ class NanopbStreamResponseClientCall : public StreamResponseClientCall {
return call;
}
+ ~NanopbStreamResponseClientCall() { DestroyClientCall(); }
+
protected:
constexpr NanopbStreamResponseClientCall() = default;
@@ -220,6 +224,8 @@ class NanopbClientReaderWriter
using internal::Call::active;
using internal::Call::channel_id;
+ using internal::ClientCall::id;
+
// Writes a response struct. Returns the following Status codes:
//
// OK - the response was successfully sent
@@ -233,16 +239,18 @@ class NanopbClientReaderWriter
&request);
}
- // Notifies the server that no further client stream messages will be sent.
- using internal::ClientCall::CloseClientStream;
+ // Notifies the server that the client has requested to stop communication by
+ // sending CLIENT_REQUEST_COMPLETION.
+ using internal::ClientCall::RequestCompletion;
// Cancels this RPC. Closes the call locally and sends a CANCELLED error to
// the server.
using internal::Call::Cancel;
- // Closes this RPC locally. Sends a CLIENT_STREAM_END, but no cancellation
- // packet. Future packets for this RPC are dropped, and the client sends a
- // FAILED_PRECONDITION error in response because the call is not active.
+ // Closes this RPC locally. Sends a CLIENT_REQUEST_COMPLETION, but no
+ // cancellation packet. Future packets for this RPC are dropped, and the
+ // client sends a FAILED_PRECONDITION error in response because the call is
+ // not active.
using internal::ClientCall::Abandon;
// Functions for setting RPC event callbacks.
@@ -284,12 +292,15 @@ class NanopbClientReader
using internal::Call::active;
using internal::Call::channel_id;
+ using internal::ClientCall::id;
+
// Functions for setting RPC event callbacks.
using internal::NanopbStreamResponseClientCall<Response>::set_on_next;
using internal::Call::set_on_error;
using internal::StreamResponseClientCall::set_on_completed;
using internal::Call::Cancel;
+ using internal::Call::RequestCompletion;
using internal::ClientCall::Abandon;
private:
@@ -325,6 +336,8 @@ class NanopbClientWriter
using internal::Call::active;
using internal::Call::channel_id;
+ using internal::ClientCall::id;
+
// Functions for setting RPC event callbacks.
using internal::NanopbUnaryResponseClientCall<Response>::set_on_completed;
using internal::Call::set_on_error;
@@ -335,7 +348,7 @@ class NanopbClientWriter
}
using internal::Call::Cancel;
- using internal::Call::CloseClientStream;
+ using internal::Call::RequestCompletion;
using internal::ClientCall::Abandon;
private:
@@ -371,6 +384,8 @@ class NanopbUnaryReceiver
using internal::Call::active;
using internal::Call::channel_id;
+ using internal::ClientCall::id;
+
// Functions for setting RPC event callbacks.
using internal::NanopbUnaryResponseClientCall<Response>::set_on_completed;
using internal::Call::set_on_error;