Struct rustable::gatt::server::Service [−][src]
pub struct Service { /* fields omitted */ }
A GATT service that is to be added to an Application
.
Implementations
impl Service
[src]
impl Service
[src]pub fn new(uuid: UUID, primary: bool) -> Self
[src]
Create new Service
.
A non-primary
services indicates that it is intended to be included by another service.
pub fn set_handle(&mut self, handle: Option<NonZeroU16>)
[src]
Set the handle to requested by the service.
If this is not set then one will be requested from Bluez.
Setting this can be useful because some remote devices (like Android devices) do not
handle changing handles very well.
When Application
is finally registered, if the requested handles are not unique
or they are already in use Bluez will reject the Application
registration.
pub fn add_char(&mut self, character: Characteristic)
[src]
pub fn includes(&self) -> &[UUID]
[src]
pub fn characteristics(&self) -> &[Characteristic]
[src]
pub fn add_includes(&mut self, service: UUID)
[src]
pub fn remove_includes(&mut self, service: UUID)
[src]
pub fn remove_char(&mut self, uuid: UUID) -> Option<Characteristic>
[src]
pub fn uuid(&self) -> UUID
[src]
Get the UUID
of Service
.
pub fn drain_chrcs(&mut self) -> Drain<'_, Characteristic>
[src]
Removes all of the Characteristic
s in the service and returns then in an iterator.
Even if not all of the Characteristic
s are not consumed, they are still removed.