feat: merge subscriptions crate into cosmic-settings repo
This commit is contained in:
parent
a2f53f2239
commit
600720b7d1
47 changed files with 8399 additions and 63 deletions
41
subscriptions/bluetooth/src/lib.rs
Normal file
41
subscriptions/bluetooth/src/lib.rs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
// Copyright 2024 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use zbus::zvariant::OwnedObjectPath;
|
||||
|
||||
mod adapter;
|
||||
pub mod agent;
|
||||
mod device;
|
||||
pub mod subscription;
|
||||
|
||||
pub use adapter::*;
|
||||
pub use device::*;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum Event {
|
||||
AddedAdapter(OwnedObjectPath, Adapter),
|
||||
AddedDevice(OwnedObjectPath, Device),
|
||||
Agent(Arc<bluez_zbus::agent1::Message>),
|
||||
DBusError(zbus::Error),
|
||||
DBusServiceUnknown,
|
||||
DeviceFailed(OwnedObjectPath),
|
||||
Ok,
|
||||
NameHasNoOwner,
|
||||
RemovedAdapter(OwnedObjectPath),
|
||||
RemovedDevice(OwnedObjectPath),
|
||||
SetAdapters(HashMap<OwnedObjectPath, Adapter>),
|
||||
SetDevices(HashMap<OwnedObjectPath, Device>),
|
||||
UpdatedAdapter(OwnedObjectPath, Vec<AdapterUpdate>),
|
||||
UpdatedDevice(OwnedObjectPath, Vec<DeviceUpdate>),
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, Copy, Eq, PartialEq)]
|
||||
pub enum Active {
|
||||
#[default]
|
||||
Disabled,
|
||||
Disabling,
|
||||
Enabling,
|
||||
Enabled,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue