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

Commit 01555a05 authored by howardchung's avatar howardchung Committed by Yun-hao Chung
Browse files

Floss: Fix argument length checking in btclient

The required number of arguments of some commands are wrong. This fixes
the issue.

Bug: 242267170
Test: play with btclient

Change-Id: I8035438ce95e1e67db342a4c7bd874b7dafed7f0
parent 11a2ac09
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -549,7 +549,7 @@ impl CommandHandler {
                    );
                }
                "set-alias" => {
                    if args.len() < 3 {
                    if args.len() < 4 {
                        println!("usage: device set-alias <address> <new-alias>");
                        return;
                    }
@@ -623,7 +623,7 @@ impl CommandHandler {
                );
            }
            "client-connect" => {
                if args.len() < 2 {
                if args.len() < 3 {
                    println!("usage: gatt client-connect <addr>");
                    return;
                }
@@ -666,7 +666,7 @@ impl CommandHandler {
                    .client_disconnect(client_id.unwrap(), addr);
            }
            "client-read-phy" => {
                if args.len() < 2 {
                if args.len() < 3 {
                    println!("usage: gatt client-read-phy <addr>");
                    return;
                }
@@ -687,7 +687,7 @@ impl CommandHandler {
                    .client_read_phy(client_id.unwrap(), addr);
            }
            "client-discover-services" => {
                if args.len() < 2 {
                if args.len() < 3 {
                    println!("usage: gatt client-discover-services <addr>");
                    return;
                }
@@ -761,7 +761,7 @@ impl CommandHandler {
                }
            }
            "unregister-scanner" => {
                if args.len() < 2 {
                if args.len() < 3 {
                    println!("usage: le-scan unregister-scanner <scanner-id>");
                    return;
                }