Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c63a485b authored by Sarvesh Kalwit's avatar Sarvesh Kalwit
Browse files

floss: Unregister a GATT Server in btclient

Support the ability to unregister a registered GATT Server via btclient.

Bug: 323943663
Test: m -j && manually with btclient
Flag: Exempt, Floss-only change

Change-Id: Ib8c8a959f2b114a8f8152d68661f21800cfabdb5
parent 1bfba0cf
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -224,6 +224,7 @@ fn build_commands() -> HashMap<String, CommandOption> {
                ),
                String::from("gatt register-notification <address> <handle> <enable|disable>"),
                String::from("gatt register-server"),
                String::from("gatt unregister-server <server_id>"),
                String::from("gatt server-connect <server_id> <client_address>"),
                String::from("gatt server-disconnect <server_id> <client_address>"),
                String::from("gatt server-add-heartrate-service <server_id>"),
@@ -1325,6 +1326,13 @@ impl CommandHandler {
                    false,
                );
            }
            "unregister-server" => {
                let server_id = String::from(get_arg(args, 1)?)
                    .parse::<i32>()
                    .or(Err("Failed parsing server id"))?;

                self.lock_context().gatt_dbus.as_mut().unwrap().unregister_server(server_id);
            }
            "server-connect" => {
                let server_id = String::from(get_arg(args, 1)?)
                    .parse::<i32>()