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

Commit 6ccde79d authored by Zach Johnson's avatar Zach Johnson Committed by Gerrit Code Review
Browse files

Merge changes I014fe130,I2e0301e3

* changes:
  rusty-gd: convert hci facade to rust_grpcio build targets
  rusty-gd: add stubs for hci hal facade
parents f21f908e fe81cb57
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -763,11 +763,18 @@ cc_library_host_shared {
    rtti: true,
}

rust_protobuf {
    name: "libhci_layer_facade_proto",
    crate_name: "hci_layer_facade_proto",
rust_grpcio {
    name: "libbt_hci_proto",
    crate_name: "bt_hci_proto",
    proto: "hci/facade/facade.proto",
    proto_flags: ["-Iexternal/protobuf/src/"],
    source_stem: "facade",
    host_supported: true,
}

rust_grpcio {
    name: "libbt_hal_proto",
    crate_name: "bt_hal_proto",
    proto: "hal/facade.proto",
    source_stem: "facade",
    host_supported: true,
}
@@ -785,7 +792,6 @@ rust_protobuf {
    name: "libbt_facade_common_proto",
    crate_name: "bt_facade_common_proto",
    proto: "facade/common.proto",
    proto_flags: ["-Iexternal/protobuf/src/"],
    source_stem: "common",
    host_supported: true,
}
+3 −0
Original line number Diff line number Diff line
@@ -5,10 +5,13 @@ rust_library {
    edition: "2018",
    rustlibs: [
        "libbt_packet",
        "libbt_hal_proto",
        "libbytes",
        "libfutures",
        "libthiserror",
        "libgrpcio",
        "libtokio",
        "libprotobuf",
    ],
    host_supported: true,
}
+84 −0
Original line number Diff line number Diff line
//! BT HCI HAL facade


use bt_hal_proto::facade_grpc::{create_hci_hal_facade, HciHalFacade};
use bt_hal_proto::facade::*;
use bt_hal_proto::empty::Empty;

use tokio::runtime::Runtime;

use grpcio::*;

use std::sync::Arc;

/// HCI HAL facade service
#[derive(Clone)]
pub struct HciHalFacadeService {
    rt: Arc<Runtime>,
}

impl HciHalFacadeService {
    /// Create a new instance of HCI HAL facade service
    pub fn create(rt: Arc<Runtime>) -> grpcio::Service {
        create_hci_hal_facade(Self { rt })
    }
}

impl HciHalFacade for HciHalFacadeService {
    fn send_hci_command(
        &mut self,
        _ctx: RpcContext<'_>,
        _cmd: HciCommandPacket,
        _sink: UnarySink<Empty>,
    ) {
        unimplemented!()
    }

    fn send_hci_acl(&mut self, _ctx: RpcContext<'_>, _acl: HciAclPacket, _sink: UnarySink<Empty>) {
        unimplemented!()
    }

    fn send_hci_sco(&mut self, _ctx: RpcContext<'_>, _sco: HciScoPacket, _sink: UnarySink<Empty>) {
        unimplemented!()
    }

    fn send_hci_iso(&mut self, _ctx: RpcContext<'_>, _iso: HciIsoPacket, _sink: UnarySink<Empty>) {
        unimplemented!()
    }

    fn fetch_hci_event(
        &mut self,
        _ctx: RpcContext<'_>,
        _: Empty,
        _sink: ServerStreamingSink<HciEventPacket>,
    ) {
        unimplemented!()
    }

    fn fetch_hci_acl(
        &mut self,
        _ctx: RpcContext<'_>,
        _: Empty,
        _sink: ServerStreamingSink<HciAclPacket>,
    ) {
        unimplemented!()
    }

    fn fetch_hci_sco(
        &mut self,
        _ctx: RpcContext<'_>,
        _: Empty,
        _sink: ServerStreamingSink<HciScoPacket>,
    ) {
        unimplemented!()
    }

    fn fetch_hci_iso(
        &mut self,
        _ctx: RpcContext<'_>,
        _: Empty,
        _sink: ServerStreamingSink<HciIsoPacket>,
    ) {
        unimplemented!()
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
//! Supports sending HCI commands to the HAL and receving
//! HCI events from the HAL
pub mod rootcanal_hal;
pub mod facade;

use thiserror::Error;
use tokio::sync::mpsc;
+1 −1
Original line number Diff line number Diff line
@@ -5,11 +5,11 @@ rust_library {
    edition: "2018",
    rustlibs: [
        "libbt_hal",
        "libbt_hci_proto",
        "libbt_packet",
        "libbytes",
        "libfutures",
        "libgrpcio",
        "libhci_layer_facade_proto",
        "libnum_traits",
        "libthiserror",
        "libtokio",
Loading