Struct rustable::gatt::server::Application [−][src]
pub struct Application { /* fields omitted */ }
Use to build an application containing local GATT services that can be used by remote devices.
Implementations
impl Application
[src]
impl Application
[src]pub fn new_with_conn(hci: &Adapter, base_path: &str, conn: Arc<RpcConn>) -> Self
[src]
Create new Application
that is assocated with the given adapter.
This app will use the given conn
to interact with Bluez to provide the services.
pub fn new(hci: &Adapter, base_path: &str) -> Self
[src]
Create new Application
that is assocated with the given adapter.
The connection used to interact with Bluez daemon is the same as the one used in hci
.
pub async fn set_dbus_name(&mut self, dest: Option<String>) -> Result<(), Error>
[src]
Requests a DBus name for the Application
using its DBus connection.
If the destination is in use this will fail and not place the connection in the name queue.
Notes
- When the application is dropped, the underlying connection will not drop the name.
pub fn get_dbus_dest(&self) -> Option<&str>
[src]
Get the DBus name currently in use for the Application
.
pub fn add_service(&mut self, service: Service)
[src]
Add a GATT service to the Application
.
pub fn remove_service(&mut self, uuid: UUID) -> Option<Service>
[src]
Remove a GATT service from the Application
.
pub fn set_filter(&mut self, filter: bool)
[src]
Set whether the Application
should filter out DBus messages coming from sources
other than the Bluez daemon.
true
(the default) will filter out messages while false
will allow all messages.
This can be useful debugging,
but users should be cautious
as this will give all users on the local device access to the application.
pub fn get_filter(&self) -> bool
[src]
Get whether the Application
is filtering out incoming DBus messages from sources
other than the Bluez daemon.
pub fn conn(&self) -> &Arc<RpcConn>
[src]
Get a reference to Arc<async_rustbus::RpcConn>
used to communicate with the Bluez daemon.
pub async fn register(self) -> Result<AppWorker, Error>
[src]
Register the application with Bluez daemon, and begin a worker thread to run the service.
Notes
- This makes the org.bluez.GattManager1.RegisterApplication DBus call, starting the application.