aboutsummaryrefslogtreecommitdiff
path: root/system/gd/rust/linux/client/src/command_handler.rs
diff options
context:
space:
mode:
authorSonny Sasaka <sonnysasaka@google.com>2022-02-28 14:25:51 -0800
committerSonny Sasaka <sonnysasaka@google.com>2022-03-03 16:49:18 -0800
commit0f48b96b45651446bba6bcb3cd42a28108e6f369 (patch)
tree74f42ec45164205651c72a8c40a6c1c48368e289 /system/gd/rust/linux/client/src/command_handler.rs
parentf98f0cb77cbfd85706c8e1b41f9eb72e989fb6ce (diff)
Floss: Add export_for_rpc to RPCProxy
This is a refactor that moves the logic of exporting a D-Bus object to be inside the object itself that implements RPCProxy. This will make DBus projection for btclient code easier. Bug: 200732080 Tag: #floss Test: Build floss on Linux and test btclient manually Change-Id: I3f584b08ce86d77ca36642c4ef37b75a14fea649
Diffstat (limited to 'system/gd/rust/linux/client/src/command_handler.rs')
-rw-r--r--system/gd/rust/linux/client/src/command_handler.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/system/gd/rust/linux/client/src/command_handler.rs b/system/gd/rust/linux/client/src/command_handler.rs
index 284654e444..99711c2edd 100644
--- a/system/gd/rust/linux/client/src/command_handler.rs
+++ b/system/gd/rust/linux/client/src/command_handler.rs
@@ -538,11 +538,16 @@ impl CommandHandler {
enforce_arg_len(args, 1, "gatt <commands>", || match &args[0][0..] {
"register-client" => {
+ let dbus_connection = self.context.lock().unwrap().dbus_connection.clone();
+ let dbus_crossroads = self.context.lock().unwrap().dbus_crossroads.clone();
+
self.context.lock().unwrap().gatt_dbus.as_mut().unwrap().register_client(
String::from(GATT_CLIENT_APP_UUID),
Box::new(BtGattCallback::new(
String::from("/org/chromium/bluetooth/client/bluetooth_gatt_callback"),
self.context.clone(),
+ dbus_connection,
+ dbus_crossroads,
)),
false,
);