pw_rpc: Set the test method context channel ID

Use the internal::Channel constructor to change the channel ID.

Change-Id: Ib18f42a39e497406e22b9a6dc9e45e8ebdcf9437
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/56883
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Carlos Chinchilla <cachinchilla@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
diff --git a/pw_rpc/public/pw_rpc/internal/test_method_context.h b/pw_rpc/public/pw_rpc/internal/test_method_context.h
index b741aba..1b23324 100644
--- a/pw_rpc/public/pw_rpc/internal/test_method_context.h
+++ b/pw_rpc/public/pw_rpc/internal/test_method_context.h
@@ -30,6 +30,9 @@
  public:
   Service& service() { return service_; }
 
+  // Sets the channel ID, which defaults to an arbitrary value.
+  void set_channel_id(uint32_t id) { channel_ = Channel(id, &output_); }
+
   // The total number of responses sent, which may be larger than
   // responses.max_size().
   size_t total_responses() const { return output_.total_responses(); }