use crate::att::{Handle, Perms};
use crate::gatt::{Builder, Characteristic, Db, Service};
#[derive(Clone, Debug, Default)]
#[non_exhaustive]
pub struct BatteryService;
impl BatteryService {
#[inline(always)]
#[must_use]
pub const fn new() -> Self {
Self
}
pub fn define(self, db: &mut Builder<Db>, perms: impl Into<Perms>) -> Handle {
let p = perms.into();
let (hdl, _) = db.primary_service(Service::Battery, [], |db| {
use Characteristic::*;
db.ro_characteristic(BatteryLevel, p, [100], |_| {});
});
hdl
}
}