pub struct DeviceManager { /* private fields */ }Implementations§
Source§impl DeviceManager
impl DeviceManager
Sourcepub async fn create(base_path: &str, config: ManagerConfig) -> Result<Self>
pub async fn create(base_path: &str, config: ManagerConfig) -> Result<Self>
First-time setup: creates directory structure, bootstraps CA, creates controller user, and saves config.
Sourcepub async fn load(base_path: &str) -> Result<Self>
pub async fn load(base_path: &str) -> Result<Self>
Load an existing device manager from a previously created base directory.
Sourcepub async fn commission(
&self,
address: &str,
pin: u32,
node_id: u64,
name: &str,
) -> Result<Connection>
pub async fn commission( &self, address: &str, pin: u32, node_id: u64, name: &str, ) -> Result<Connection>
Commission a device and save it to the registry. Returns an authenticated connection ready for commands.
Sourcepub async fn connect(&self, node_id: u64) -> Result<Connection>
pub async fn connect(&self, node_id: u64) -> Result<Connection>
Connect to a previously commissioned device by node ID.
Sourcepub async fn connect_by_name(&self, name: &str) -> Result<Connection>
pub async fn connect_by_name(&self, name: &str) -> Result<Connection>
Connect to a previously commissioned device by friendly name.
Sourcepub fn list_devices(&self) -> Result<Vec<Device>>
pub fn list_devices(&self) -> Result<Vec<Device>>
List all registered devices.
Sourcepub fn get_device_by_name(&self, name: &str) -> Result<Option<Device>>
pub fn get_device_by_name(&self, name: &str) -> Result<Option<Device>>
Get a device by friendly name.
Sourcepub fn remove_device(&self, node_id: u64) -> Result<()>
pub fn remove_device(&self, node_id: u64) -> Result<()>
Remove a device from the registry.
Sourcepub fn rename_device(&self, node_id: u64, name: &str) -> Result<()>
pub fn rename_device(&self, node_id: u64, name: &str) -> Result<()>
Rename a device in the registry.
Sourcepub fn update_device_address(&self, node_id: u64, address: &str) -> Result<()>
pub fn update_device_address(&self, node_id: u64, address: &str) -> Result<()>
Update the stored address for a device.
Sourcepub fn controller(&self) -> &Arc<Controller>
pub fn controller(&self) -> &Arc<Controller>
Get a reference to the underlying controller.
Sourcepub fn certmanager(&self) -> &Arc<dyn CertManager>
pub fn certmanager(&self) -> &Arc<dyn CertManager>
Get a reference to the certificate manager.
Sourcepub fn config(&self) -> &ManagerConfig
pub fn config(&self) -> &ManagerConfig
Get the config.
Auto Trait Implementations§
impl !Freeze for DeviceManager
impl !RefUnwindSafe for DeviceManager
impl Send for DeviceManager
impl Sync for DeviceManager
impl Unpin for DeviceManager
impl !UnwindSafe for DeviceManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more