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]

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.

Auto Trait Implementations

impl !RefUnwindSafe for Application

impl Send for Application

impl Sync for Application

impl Unpin for Application

impl !UnwindSafe for Application

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.