Loading system/gd/rust/linux/client/src/dbus_iface.rs +12 −0 Original line number Diff line number Diff line Loading @@ -1962,6 +1962,18 @@ impl IBluetoothSocketManager for BluetoothSocketManagerDBus { dbus_generated!() } #[dbus_method("ListenUsingRfcomm")] fn listen_using_rfcomm( &mut self, callback: CallbackId, channel: Option<i32>, application_uuid: Option<Uuid>, name: Option<String>, flags: Option<i32>, ) -> SocketResult { dbus_generated!() } #[dbus_method("CreateInsecureL2capChannel")] fn create_insecure_l2cap_channel( &mut self, Loading system/gd/rust/linux/service/src/iface_bluetooth.rs +12 −0 Original line number Diff line number Diff line Loading @@ -750,6 +750,18 @@ impl IBluetoothSocketManager for IBluetoothSocketManagerDBus { dbus_generated!() } #[dbus_method("ListenUsingRfcomm")] fn listen_using_rfcomm( &mut self, callback: CallbackId, channel: Option<i32>, application_uuid: Option<Uuid>, name: Option<String>, flags: Option<i32>, ) -> SocketResult { dbus_generated!() } #[dbus_method("ListenUsingRfcommWithServiceRecord")] fn listen_using_rfcomm_with_service_record( &mut self, Loading system/gd/rust/linux/stack/src/socket_manager.rs +59 −4 Original line number Diff line number Diff line Loading @@ -100,7 +100,24 @@ impl BluetoothServerSocket { } } fn make_rfcomm_channel(flags: i32, name: String, uuid: Uuid) -> Self { fn make_rfcomm_channel( flags: i32, name: Option<String>, channel: Option<i32>, uuid: Option<Uuid>, ) -> Self { BluetoothServerSocket { id: 0, sock_type: SocketType::Rfcomm, flags, psm: None, channel: channel, name: name, uuid: uuid, } } fn make_default_rfcomm_channel(flags: i32, name: String, uuid: Uuid) -> Self { BluetoothServerSocket { id: 0, sock_type: SocketType::Rfcomm, Loading Loading @@ -305,6 +322,18 @@ pub trait IBluetoothSocketManager { uuid: Uuid, ) -> SocketResult; /// Generic method for setting up an RFCOMM listening socket. Prefer to use one of the other /// RFCOMM listen methods when possible as they reflect the more preferred RFCOMM flows, but /// this method exposes all of the options that the stack supports. fn listen_using_rfcomm( &mut self, callback: CallbackId, channel: Option<i32>, application_uuid: Option<Uuid>, name: Option<String>, flags: Option<i32>, ) -> SocketResult; /// Create an insecure L2CAP connection. fn create_insecure_l2cap_channel( &mut self, Loading Loading @@ -1171,7 +1200,7 @@ impl IBluetoothSocketManager for BluetoothSocketManager { } let socket_info = BluetoothServerSocket::make_rfcomm_channel(socket::SOCK_FLAG_NONE, name, uuid); BluetoothServerSocket::make_default_rfcomm_channel(socket::SOCK_FLAG_NONE, name, uuid); self.socket_listen(socket_info, callback) } Loading @@ -1185,12 +1214,38 @@ impl IBluetoothSocketManager for BluetoothSocketManager { return SocketResult::new(BtStatus::NotReady, INVALID_SOCKET_ID); } let socket_info = BluetoothServerSocket::make_rfcomm_channel(socket::SOCK_META_FLAG_SECURE, name, uuid); let socket_info = BluetoothServerSocket::make_default_rfcomm_channel( socket::SOCK_META_FLAG_SECURE, name, uuid, ); self.socket_listen(socket_info, callback) } fn listen_using_rfcomm( &mut self, callback: CallbackId, channel: Option<i32>, application_uuid: Option<Uuid>, name: Option<String>, flags: Option<i32>, ) -> SocketResult { if self.callbacks.get_by_id(callback).is_none() { return SocketResult::new(BtStatus::NotReady, INVALID_SOCKET_ID); } let flags = match flags { Some(flags) => flags, None => socket::SOCK_FLAG_NONE, }; self.socket_listen( BluetoothServerSocket::make_rfcomm_channel(flags, name, channel, application_uuid), callback, ) } fn create_insecure_l2cap_channel( &mut self, callback: CallbackId, Loading Loading
system/gd/rust/linux/client/src/dbus_iface.rs +12 −0 Original line number Diff line number Diff line Loading @@ -1962,6 +1962,18 @@ impl IBluetoothSocketManager for BluetoothSocketManagerDBus { dbus_generated!() } #[dbus_method("ListenUsingRfcomm")] fn listen_using_rfcomm( &mut self, callback: CallbackId, channel: Option<i32>, application_uuid: Option<Uuid>, name: Option<String>, flags: Option<i32>, ) -> SocketResult { dbus_generated!() } #[dbus_method("CreateInsecureL2capChannel")] fn create_insecure_l2cap_channel( &mut self, Loading
system/gd/rust/linux/service/src/iface_bluetooth.rs +12 −0 Original line number Diff line number Diff line Loading @@ -750,6 +750,18 @@ impl IBluetoothSocketManager for IBluetoothSocketManagerDBus { dbus_generated!() } #[dbus_method("ListenUsingRfcomm")] fn listen_using_rfcomm( &mut self, callback: CallbackId, channel: Option<i32>, application_uuid: Option<Uuid>, name: Option<String>, flags: Option<i32>, ) -> SocketResult { dbus_generated!() } #[dbus_method("ListenUsingRfcommWithServiceRecord")] fn listen_using_rfcomm_with_service_record( &mut self, Loading
system/gd/rust/linux/stack/src/socket_manager.rs +59 −4 Original line number Diff line number Diff line Loading @@ -100,7 +100,24 @@ impl BluetoothServerSocket { } } fn make_rfcomm_channel(flags: i32, name: String, uuid: Uuid) -> Self { fn make_rfcomm_channel( flags: i32, name: Option<String>, channel: Option<i32>, uuid: Option<Uuid>, ) -> Self { BluetoothServerSocket { id: 0, sock_type: SocketType::Rfcomm, flags, psm: None, channel: channel, name: name, uuid: uuid, } } fn make_default_rfcomm_channel(flags: i32, name: String, uuid: Uuid) -> Self { BluetoothServerSocket { id: 0, sock_type: SocketType::Rfcomm, Loading Loading @@ -305,6 +322,18 @@ pub trait IBluetoothSocketManager { uuid: Uuid, ) -> SocketResult; /// Generic method for setting up an RFCOMM listening socket. Prefer to use one of the other /// RFCOMM listen methods when possible as they reflect the more preferred RFCOMM flows, but /// this method exposes all of the options that the stack supports. fn listen_using_rfcomm( &mut self, callback: CallbackId, channel: Option<i32>, application_uuid: Option<Uuid>, name: Option<String>, flags: Option<i32>, ) -> SocketResult; /// Create an insecure L2CAP connection. fn create_insecure_l2cap_channel( &mut self, Loading Loading @@ -1171,7 +1200,7 @@ impl IBluetoothSocketManager for BluetoothSocketManager { } let socket_info = BluetoothServerSocket::make_rfcomm_channel(socket::SOCK_FLAG_NONE, name, uuid); BluetoothServerSocket::make_default_rfcomm_channel(socket::SOCK_FLAG_NONE, name, uuid); self.socket_listen(socket_info, callback) } Loading @@ -1185,12 +1214,38 @@ impl IBluetoothSocketManager for BluetoothSocketManager { return SocketResult::new(BtStatus::NotReady, INVALID_SOCKET_ID); } let socket_info = BluetoothServerSocket::make_rfcomm_channel(socket::SOCK_META_FLAG_SECURE, name, uuid); let socket_info = BluetoothServerSocket::make_default_rfcomm_channel( socket::SOCK_META_FLAG_SECURE, name, uuid, ); self.socket_listen(socket_info, callback) } fn listen_using_rfcomm( &mut self, callback: CallbackId, channel: Option<i32>, application_uuid: Option<Uuid>, name: Option<String>, flags: Option<i32>, ) -> SocketResult { if self.callbacks.get_by_id(callback).is_none() { return SocketResult::new(BtStatus::NotReady, INVALID_SOCKET_ID); } let flags = match flags { Some(flags) => flags, None => socket::SOCK_FLAG_NONE, }; self.socket_listen( BluetoothServerSocket::make_rfcomm_channel(flags, name, channel, application_uuid), callback, ) } fn create_insecure_l2cap_channel( &mut self, callback: CallbackId, Loading