Loading system/bta/gatt/bta_gattc_api.cc +3 −8 Original line number Diff line number Diff line Loading @@ -203,16 +203,11 @@ void BTA_GATTC_Close(uint16_t conn_id) { * Returns void * ******************************************************************************/ void BTA_GATTC_ConfigureMTU(uint16_t conn_id, uint16_t mtu) { tBTA_GATTC_API_CFG_MTU* p_buf = (tBTA_GATTC_API_CFG_MTU*)osi_malloc(sizeof(tBTA_GATTC_API_CFG_MTU)); p_buf->hdr.event = BTA_GATTC_API_CFG_MTU_EVT; p_buf->hdr.layer_specific = conn_id; p_buf->mtu = mtu; bta_sys_sendmsg(p_buf); void BTA_GATTC_ConfigureMTU(uint16_t conn_id, uint16_t mtu) { BTA_GATTC_ConfigureMTU(conn_id, mtu, NULL, NULL); } void BTA_GATTC_ConfigureMTU(uint16_t conn_id, uint16_t mtu, GATT_CONFIGURE_MTU_OP_CB callback, void* cb_data) { tBTA_GATTC_API_CFG_MTU* p_buf = Loading system/gd/rust/common/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ rust_library { rustlibs: [ "libtokio", "libnix", "liblazy_static", "liblog_rust", "libcxx", "libgrpcio", Loading Loading @@ -40,6 +41,7 @@ rust_test_host { rustlibs: [ "libtokio", "libnix", "liblazy_static", "liblog_rust", "libenv_logger", "libcxx", Loading system/gd/rust/facade/src/main.rs +7 −19 Original line number Diff line number Diff line Loading @@ -14,8 +14,9 @@ use futures::stream::StreamExt; use grpcio::*; use log::debug; use nix::sys::signal; use std::net::{IpAddr, Ipv4Addr, Shutdown, SocketAddr}; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::sync::{Arc, Mutex}; use tokio::io::AsyncWriteExt; use tokio::net::TcpStream; use tokio::runtime::Runtime; Loading @@ -35,29 +36,16 @@ async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { .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("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), ) .arg( Arg::with_name("rootcanal-port") .long("rootcanal-port") .takes_value(true), ) .arg(Arg::with_name("rootcanal-port").long("rootcanal-port").takes_value(true)) .arg(Arg::with_name("btsnoop").long("btsnoop").takes_value(true)) .arg( Arg::with_name("btconfig") .long("btconfig") .takes_value(true), ) .arg(Arg::with_name("btconfig").long("btconfig").takes_value(true)) .get_matches(); let root_server_port = value_t!(matches, "root-server-port", u16).unwrap(); Loading @@ -84,8 +72,8 @@ async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { async fn indicate_started(signal_port: u16) { let address = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), signal_port); let stream = TcpStream::connect(address).await.unwrap(); stream.shutdown(Shutdown::Both).unwrap(); let mut stream = TcpStream::connect(address).await.unwrap(); stream.shutdown().await.unwrap(); } // TODO: remove as this is a temporary nix-based hack to catch SIGINT Loading system/gd/rust/link/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ rust_library { "libnum_traits", "libthiserror", "libtokio", "libtokio_stream", "libprotobuf", "libgddi", "liblog_rust", Loading system/gd/rust/link/src/acl/core.rs +3 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ use tokio::runtime::Runtime; use tokio::select; use tokio::sync::mpsc::{channel, Receiver, Sender}; use tokio::sync::{oneshot, Mutex}; use tokio_stream::wrappers::ReceiverStream; module! { core_module, Loading Loading @@ -108,11 +109,11 @@ async fn provide_acl_dispatch( match bt { Classic => { classic_outbound.push(fragmenting_stream( in_rx, controller.acl_buffer_length.into(), handle, bt, close_rx)); ReceiverStream::new(in_rx), controller.acl_buffer_length.into(), handle, bt, close_rx)); }, Le => { le_outbound.push(fragmenting_stream( in_rx, controller.le_buffer_length.into(), handle, bt, close_rx)); ReceiverStream::new(in_rx), controller.le_buffer_length.into(), handle, bt, close_rx)); }, } Loading Loading
system/bta/gatt/bta_gattc_api.cc +3 −8 Original line number Diff line number Diff line Loading @@ -203,16 +203,11 @@ void BTA_GATTC_Close(uint16_t conn_id) { * Returns void * ******************************************************************************/ void BTA_GATTC_ConfigureMTU(uint16_t conn_id, uint16_t mtu) { tBTA_GATTC_API_CFG_MTU* p_buf = (tBTA_GATTC_API_CFG_MTU*)osi_malloc(sizeof(tBTA_GATTC_API_CFG_MTU)); p_buf->hdr.event = BTA_GATTC_API_CFG_MTU_EVT; p_buf->hdr.layer_specific = conn_id; p_buf->mtu = mtu; bta_sys_sendmsg(p_buf); void BTA_GATTC_ConfigureMTU(uint16_t conn_id, uint16_t mtu) { BTA_GATTC_ConfigureMTU(conn_id, mtu, NULL, NULL); } void BTA_GATTC_ConfigureMTU(uint16_t conn_id, uint16_t mtu, GATT_CONFIGURE_MTU_OP_CB callback, void* cb_data) { tBTA_GATTC_API_CFG_MTU* p_buf = Loading
system/gd/rust/common/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ rust_library { rustlibs: [ "libtokio", "libnix", "liblazy_static", "liblog_rust", "libcxx", "libgrpcio", Loading Loading @@ -40,6 +41,7 @@ rust_test_host { rustlibs: [ "libtokio", "libnix", "liblazy_static", "liblog_rust", "libenv_logger", "libcxx", Loading
system/gd/rust/facade/src/main.rs +7 −19 Original line number Diff line number Diff line Loading @@ -14,8 +14,9 @@ use futures::stream::StreamExt; use grpcio::*; use log::debug; use nix::sys::signal; use std::net::{IpAddr, Ipv4Addr, Shutdown, SocketAddr}; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::sync::{Arc, Mutex}; use tokio::io::AsyncWriteExt; use tokio::net::TcpStream; use tokio::runtime::Runtime; Loading @@ -35,29 +36,16 @@ async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { .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("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), ) .arg( Arg::with_name("rootcanal-port") .long("rootcanal-port") .takes_value(true), ) .arg(Arg::with_name("rootcanal-port").long("rootcanal-port").takes_value(true)) .arg(Arg::with_name("btsnoop").long("btsnoop").takes_value(true)) .arg( Arg::with_name("btconfig") .long("btconfig") .takes_value(true), ) .arg(Arg::with_name("btconfig").long("btconfig").takes_value(true)) .get_matches(); let root_server_port = value_t!(matches, "root-server-port", u16).unwrap(); Loading @@ -84,8 +72,8 @@ async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { async fn indicate_started(signal_port: u16) { let address = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), signal_port); let stream = TcpStream::connect(address).await.unwrap(); stream.shutdown(Shutdown::Both).unwrap(); let mut stream = TcpStream::connect(address).await.unwrap(); stream.shutdown().await.unwrap(); } // TODO: remove as this is a temporary nix-based hack to catch SIGINT Loading
system/gd/rust/link/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ rust_library { "libnum_traits", "libthiserror", "libtokio", "libtokio_stream", "libprotobuf", "libgddi", "liblog_rust", Loading
system/gd/rust/link/src/acl/core.rs +3 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ use tokio::runtime::Runtime; use tokio::select; use tokio::sync::mpsc::{channel, Receiver, Sender}; use tokio::sync::{oneshot, Mutex}; use tokio_stream::wrappers::ReceiverStream; module! { core_module, Loading Loading @@ -108,11 +109,11 @@ async fn provide_acl_dispatch( match bt { Classic => { classic_outbound.push(fragmenting_stream( in_rx, controller.acl_buffer_length.into(), handle, bt, close_rx)); ReceiverStream::new(in_rx), controller.acl_buffer_length.into(), handle, bt, close_rx)); }, Le => { le_outbound.push(fragmenting_stream( in_rx, controller.le_buffer_length.into(), handle, bt, close_rx)); ReceiverStream::new(in_rx), controller.le_buffer_length.into(), handle, bt, close_rx)); }, } Loading