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

Commit b615cb1b authored by Zach Johnson's avatar Zach Johnson
Browse files

Add stub for rusty-gd facade service

Only parses command line args for now, but will
be expanded gradually in future patches.

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I122f110db529b065ed8c47b9c61e25704746360a
parent 97337854
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
rust_binary {
    name: "rusty_bluetooth_stack_with_facade",
    crate_name: "rusty_bt_stack_with_facade",
    srcs: ["src/main.rs"],
    edition: "2018",
    rustlibs: [
      "libclap",
    ],
    host_supported: true,
}
+38 −0
Original line number Diff line number Diff line
//! Starts the facade services that allow us to test the Bluetooth stack

#[macro_use]
extern crate clap;
use clap::{App, Arg};

fn main() {
    let matches = App::new("rusty_bluetooth_stack_with_facade")
        .about("The bluetooth stack, with testing facades enabled and exposed via gRPC.")
        .arg(
            Arg::with_name("root-server-port")
                .long("root-server-port")
                .default_value("8897")
                .takes_value(true),
        )
        .arg(
            Arg::with_name("grpc-port")
                .long("grpc-port")
                .default_value("8899")
                .takes_value(true),
        )
        .arg(
            Arg::with_name("signal-port")
                .long("signal-port")
                .default_value("8895")
                .takes_value(true),
        )
        .get_matches();

    let root_server_port = value_t!(matches, "root-server-port", u16).unwrap();
    let grpc_port = value_t!(matches, "grpc-port", u16).unwrap();
    let signal_port = value_t!(matches, "signal-port", u16).unwrap();

    println!(
        "root server port: {}, grpc port: {}, signal port {}",
        root_server_port, grpc_port, signal_port
    );
}