pub struct Device { /* private fields */ }Implementations§
Source§impl Device
impl Device
pub fn set_empty_array(&mut self, endpoint: u16, cluster: u32, attribute: u32)
pub fn set_cluster_globals( &mut self, endpoint: u16, cluster: u32, revision: u16, feature_map: u32, attribute_ids: &[u32], accepted_cmds: &[u32], generated_cmds: &[u32], ) -> Result<()>
pub fn set_attribute_bool( &mut self, endpoint: u16, cluster: u32, attribute: u32, value: bool, )
pub fn set_attribute_u8( &mut self, endpoint: u16, cluster: u32, attribute: u32, value: u8, )
pub fn set_attribute_u16( &mut self, endpoint: u16, cluster: u32, attribute: u32, value: u16, )
pub fn set_attribute_u32( &mut self, endpoint: u16, cluster: u32, attribute: u32, value: u32, )
pub fn set_attribute_u64( &mut self, endpoint: u16, cluster: u32, attribute: u32, value: u64, )
pub fn set_attribute_string( &mut self, endpoint: u16, cluster: u32, attribute: u32, value: &str, )
pub fn set_attribute_raw( &mut self, endpoint: u16, cluster: u32, attribute: u32, value: &[u8], )
Source§impl Device
impl Device
Sourcepub fn add_endpoint(
&mut self,
endpoint: u16,
device_type_id: u32,
device_type_revision: u16,
) -> Result<()>
pub fn add_endpoint( &mut self, endpoint: u16, device_type_id: u32, device_type_revision: u16, ) -> Result<()>
Register a new application endpoint with a Descriptor cluster.
Sets up DeviceTypeList, ServerList (initially containing only Descriptor), empty ClientList and PartsList, and Descriptor globals. Then appends the endpoint to EP0’s PartsList.
Source§impl Device
impl Device
Sourcepub fn add_persisted_attribute(
&mut self,
endpoint: u16,
cluster: u32,
attribute: u32,
)
pub fn add_persisted_attribute( &mut self, endpoint: u16, cluster: u32, attribute: u32, )
Register an additional attribute key to include in persistence.
Sourcepub async fn from_persisted_state(
config: DeviceConfig,
mdns: Arc<MdnsService>,
state_dir: &str,
) -> Result<Self>
pub async fn from_persisted_state( config: DeviceConfig, mdns: Arc<MdnsService>, state_dir: &str, ) -> Result<Self>
Restore a previously commissioned device from {state_dir}/device_state.json.
On success the device is ready to accept CASE sessions - it will NOT re-advertise
the commissionable _matterc._udp service.
Source§impl Device
impl Device
pub async fn new(config: DeviceConfig, mdns: Arc<MdnsService>) -> Result<Self>
pub async fn run(&mut self, handler: &mut dyn AppHandler) -> Result<()>
Auto Trait Implementations§
impl !Freeze for Device
impl !RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl !UnwindSafe for Device
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