Merge pull request #47 from dstrub18/main
Removed Result return type from new function of attribute
This commit is contained in:
commit
9412ab6fe5
11 changed files with 59 additions and 65 deletions
|
@ -60,43 +60,43 @@ impl BasicInfoCluster {
|
||||||
AttrValue::Uint8(1),
|
AttrValue::Uint8(1),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::FIXED,
|
Quality::FIXED,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::VendorId as u16,
|
Attributes::VendorId as u16,
|
||||||
AttrValue::Uint16(cfg.vid),
|
AttrValue::Uint16(cfg.vid),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::FIXED,
|
Quality::FIXED,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::ProductId as u16,
|
Attributes::ProductId as u16,
|
||||||
AttrValue::Uint16(cfg.pid),
|
AttrValue::Uint16(cfg.pid),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::FIXED,
|
Quality::FIXED,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::HwVer as u16,
|
Attributes::HwVer as u16,
|
||||||
AttrValue::Uint16(cfg.hw_ver),
|
AttrValue::Uint16(cfg.hw_ver),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::FIXED,
|
Quality::FIXED,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::SwVer as u16,
|
Attributes::SwVer as u16,
|
||||||
AttrValue::Uint32(cfg.sw_ver),
|
AttrValue::Uint32(cfg.sw_ver),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::FIXED,
|
Quality::FIXED,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::SwVerString as u16,
|
Attributes::SwVerString as u16,
|
||||||
AttrValue::Utf8(cfg.sw_ver_str),
|
AttrValue::Utf8(cfg.sw_ver_str),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::FIXED,
|
Quality::FIXED,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::SerialNo as u16,
|
Attributes::SerialNo as u16,
|
||||||
AttrValue::Utf8(cfg.serial_no),
|
AttrValue::Utf8(cfg.serial_no),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::FIXED,
|
Quality::FIXED,
|
||||||
)?,
|
),
|
||||||
];
|
];
|
||||||
cluster.base.add_attributes(&attrs[..])?;
|
cluster.base.add_attributes(&attrs[..])?;
|
||||||
|
|
||||||
|
|
|
@ -136,46 +136,46 @@ impl MediaPlaybackCluster {
|
||||||
AttrValue::Uint8(PlaybackState::NotPlaying as u8),
|
AttrValue::Uint8(PlaybackState::NotPlaying as u8),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::PERSISTENT,
|
Quality::PERSISTENT,
|
||||||
)?,
|
),
|
||||||
// epoch-us
|
// epoch-us
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::StartTime as u16,
|
Attributes::StartTime as u16,
|
||||||
AttrValue::Uint64(0),
|
AttrValue::Uint64(0),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::PERSISTENT,
|
Quality::PERSISTENT,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::Duration as u16,
|
Attributes::Duration as u16,
|
||||||
AttrValue::Uint64(1),
|
AttrValue::Uint64(1),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::PERSISTENT,
|
Quality::PERSISTENT,
|
||||||
)?,
|
),
|
||||||
// Playback-Position
|
// Playback-Position
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::SampledPosition as u16,
|
Attributes::SampledPosition as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::PERSISTENT,
|
Quality::PERSISTENT,
|
||||||
)?,
|
),
|
||||||
// Float
|
// Float
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::PlaybackSpeed as u16,
|
Attributes::PlaybackSpeed as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::PERSISTENT,
|
Quality::PERSISTENT,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::SeekRangeEnd as u16,
|
Attributes::SeekRangeEnd as u16,
|
||||||
AttrValue::Uint64(0),
|
AttrValue::Uint64(0),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::PERSISTENT,
|
Quality::PERSISTENT,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::SeekRangeStart as u16,
|
Attributes::SeekRangeStart as u16,
|
||||||
AttrValue::Uint64(0),
|
AttrValue::Uint64(0),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::PERSISTENT,
|
Quality::PERSISTENT,
|
||||||
)?,
|
),
|
||||||
// Options - probably want a custom type here for mapping cluster options to TLV bitmask
|
// Options - probably want a custom type here for mapping cluster options to TLV bitmask
|
||||||
];
|
];
|
||||||
cluster.base.add_attributes(&attrs)?;
|
cluster.base.add_attributes(&attrs)?;
|
||||||
|
|
|
@ -37,7 +37,7 @@ pub enum Commands {
|
||||||
Toggle = 0x02,
|
Toggle = 0x02,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_on_off_new() -> Result<Attribute, Error> {
|
fn attr_on_off_new() -> Attribute {
|
||||||
// OnOff, Value: false
|
// OnOff, Value: false
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::OnOff as u16,
|
Attributes::OnOff as u16,
|
||||||
|
@ -56,7 +56,7 @@ impl OnOffCluster {
|
||||||
let mut cluster = Box::new(OnOffCluster {
|
let mut cluster = Box::new(OnOffCluster {
|
||||||
base: Cluster::new(ID)?,
|
base: Cluster::new(ID)?,
|
||||||
});
|
});
|
||||||
cluster.base.add_attribute(attr_on_off_new()?)?;
|
cluster.base.add_attribute(attr_on_off_new())?;
|
||||||
Ok(cluster)
|
Ok(cluster)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,18 +171,13 @@ impl Default for Attribute {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Attribute {
|
impl Attribute {
|
||||||
pub fn new(
|
pub fn new(id: u16, value: AttrValue, access: Access, quality: Quality) -> Self {
|
||||||
id: u16,
|
Attribute {
|
||||||
value: AttrValue,
|
|
||||||
access: Access,
|
|
||||||
quality: Quality,
|
|
||||||
) -> Result<Attribute, Error> {
|
|
||||||
Ok(Attribute {
|
|
||||||
id,
|
id,
|
||||||
value,
|
value,
|
||||||
access,
|
access,
|
||||||
quality,
|
quality,
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_value(&mut self, value: AttrValue) -> Result<(), Error> {
|
pub fn set_value(&mut self, value: AttrValue) -> Result<(), Error> {
|
||||||
|
|
|
@ -139,14 +139,14 @@ impl Cluster {
|
||||||
AttrValue::Uint32(0),
|
AttrValue::Uint32(0),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?)?;
|
))?;
|
||||||
|
|
||||||
self.add_attribute(Attribute::new(
|
self.add_attribute(Attribute::new(
|
||||||
GlobalElements::AttributeList as u16,
|
GlobalElements::AttributeList as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?)
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_attributes(&mut self, attrs: &[Attribute]) -> Result<(), Error> {
|
pub fn add_attributes(&mut self, attrs: &[Attribute]) -> Result<(), Error> {
|
||||||
|
|
|
@ -48,7 +48,7 @@ pub enum Commands {
|
||||||
RevokeComm = 0x02,
|
RevokeComm = 0x02,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_window_status_new() -> Result<Attribute, Error> {
|
fn attr_window_status_new() -> Attribute {
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::WindowStatus as u16,
|
Attributes::WindowStatus as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
|
@ -57,7 +57,7 @@ fn attr_window_status_new() -> Result<Attribute, Error> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_admin_fabid_new() -> Result<Attribute, Error> {
|
fn attr_admin_fabid_new() -> Attribute {
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::AdminFabricIndex as u16,
|
Attributes::AdminFabricIndex as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
|
@ -66,7 +66,7 @@ fn attr_admin_fabid_new() -> Result<Attribute, Error> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_admin_vid_new() -> Result<Attribute, Error> {
|
fn attr_admin_vid_new() -> Attribute {
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::AdminVendorId as u16,
|
Attributes::AdminVendorId as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
|
@ -129,9 +129,9 @@ impl AdminCommCluster {
|
||||||
pase_mgr,
|
pase_mgr,
|
||||||
base: Cluster::new(ID)?,
|
base: Cluster::new(ID)?,
|
||||||
});
|
});
|
||||||
c.base.add_attribute(attr_window_status_new()?)?;
|
c.base.add_attribute(attr_window_status_new())?;
|
||||||
c.base.add_attribute(attr_admin_fabid_new()?)?;
|
c.base.add_attribute(attr_admin_fabid_new())?;
|
||||||
c.base.add_attribute(attr_admin_vid_new()?)?;
|
c.base.add_attribute(attr_admin_vid_new())?;
|
||||||
Ok(c)
|
Ok(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ pub enum RegLocationType {
|
||||||
IndoorOutdoor = 2,
|
IndoorOutdoor = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_bread_crumb_new(bread_crumb: u64) -> Result<Attribute, Error> {
|
fn attr_bread_crumb_new(bread_crumb: u64) -> Attribute {
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::BreadCrumb as u16,
|
Attributes::BreadCrumb as u16,
|
||||||
AttrValue::Uint64(bread_crumb),
|
AttrValue::Uint64(bread_crumb),
|
||||||
|
@ -71,7 +71,7 @@ fn attr_bread_crumb_new(bread_crumb: u64) -> Result<Attribute, Error> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_reg_config_new(reg_config: RegLocationType) -> Result<Attribute, Error> {
|
fn attr_reg_config_new(reg_config: RegLocationType) -> Attribute {
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::RegConfig as u16,
|
Attributes::RegConfig as u16,
|
||||||
AttrValue::Uint8(reg_config as u8),
|
AttrValue::Uint8(reg_config as u8),
|
||||||
|
@ -80,7 +80,7 @@ fn attr_reg_config_new(reg_config: RegLocationType) -> Result<Attribute, Error>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_location_capability_new(reg_config: RegLocationType) -> Result<Attribute, Error> {
|
fn attr_location_capability_new(reg_config: RegLocationType) -> Attribute {
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::LocationCapability as u16,
|
Attributes::LocationCapability as u16,
|
||||||
AttrValue::Uint8(reg_config as u8),
|
AttrValue::Uint8(reg_config as u8),
|
||||||
|
@ -89,7 +89,7 @@ fn attr_location_capability_new(reg_config: RegLocationType) -> Result<Attribute
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_comm_info_new() -> Result<Attribute, Error> {
|
fn attr_comm_info_new() -> Attribute {
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::BasicCommissioningInfo as u16,
|
Attributes::BasicCommissioningInfo as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
|
@ -160,15 +160,14 @@ impl GenCommCluster {
|
||||||
failsafe,
|
failsafe,
|
||||||
base: Cluster::new(ID)?,
|
base: Cluster::new(ID)?,
|
||||||
});
|
});
|
||||||
c.base.add_attribute(attr_bread_crumb_new(0)?)?;
|
c.base.add_attribute(attr_bread_crumb_new(0))?;
|
||||||
// TODO: Arch-Specific
|
// TODO: Arch-Specific
|
||||||
c.base
|
c.base
|
||||||
.add_attribute(attr_reg_config_new(RegLocationType::IndoorOutdoor)?)?;
|
.add_attribute(attr_reg_config_new(RegLocationType::IndoorOutdoor))?;
|
||||||
// TODO: Arch-Specific
|
// TODO: Arch-Specific
|
||||||
c.base.add_attribute(attr_location_capability_new(
|
c.base
|
||||||
RegLocationType::IndoorOutdoor,
|
.add_attribute(attr_location_capability_new(RegLocationType::IndoorOutdoor))?;
|
||||||
)?)?;
|
c.base.add_attribute(attr_comm_info_new())?;
|
||||||
c.base.add_attribute(attr_comm_info_new()?)?;
|
|
||||||
|
|
||||||
Ok(c)
|
Ok(c)
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,25 +131,25 @@ impl NocCluster {
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::Fabrics as u16,
|
Attributes::Fabrics as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
Access::RV | Access::FAB_SCOPED,
|
Access::RV | Access::FAB_SCOPED,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::SupportedFabrics as u16,
|
Attributes::SupportedFabrics as u16,
|
||||||
AttrValue::Uint8(MAX_SUPPORTED_FABRICS as u8),
|
AttrValue::Uint8(MAX_SUPPORTED_FABRICS as u8),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::FIXED,
|
Quality::FIXED,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::CommissionedFabrics as u16,
|
Attributes::CommissionedFabrics as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?,
|
),
|
||||||
];
|
];
|
||||||
c.base.add_attributes(&attrs[..])?;
|
c.base.add_attributes(&attrs[..])?;
|
||||||
Ok(c)
|
Ok(c)
|
||||||
|
|
|
@ -49,11 +49,11 @@ impl AccessControlCluster {
|
||||||
base: Cluster::new(ID)?,
|
base: Cluster::new(ID)?,
|
||||||
acl_mgr,
|
acl_mgr,
|
||||||
});
|
});
|
||||||
c.base.add_attribute(attr_acl_new()?)?;
|
c.base.add_attribute(attr_acl_new())?;
|
||||||
c.base.add_attribute(attr_extension_new()?)?;
|
c.base.add_attribute(attr_extension_new())?;
|
||||||
c.base.add_attribute(attr_subjects_per_entry_new()?)?;
|
c.base.add_attribute(attr_subjects_per_entry_new())?;
|
||||||
c.base.add_attribute(attr_targets_per_entry_new()?)?;
|
c.base.add_attribute(attr_targets_per_entry_new())?;
|
||||||
c.base.add_attribute(attr_entries_per_fabric_new()?)?;
|
c.base.add_attribute(attr_entries_per_fabric_new())?;
|
||||||
Ok(c)
|
Ok(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ impl ClusterType for AccessControlCluster {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_acl_new() -> Result<Attribute, Error> {
|
fn attr_acl_new() -> Attribute {
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::Acl as u16,
|
Attributes::Acl as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
|
@ -152,7 +152,7 @@ fn attr_acl_new() -> Result<Attribute, Error> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_extension_new() -> Result<Attribute, Error> {
|
fn attr_extension_new() -> Attribute {
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::Extension as u16,
|
Attributes::Extension as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
|
@ -161,7 +161,7 @@ fn attr_extension_new() -> Result<Attribute, Error> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_subjects_per_entry_new() -> Result<Attribute, Error> {
|
fn attr_subjects_per_entry_new() -> Attribute {
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::SubjectsPerEntry as u16,
|
Attributes::SubjectsPerEntry as u16,
|
||||||
AttrValue::Uint16(acl::SUBJECTS_PER_ENTRY as u16),
|
AttrValue::Uint16(acl::SUBJECTS_PER_ENTRY as u16),
|
||||||
|
@ -170,7 +170,7 @@ fn attr_subjects_per_entry_new() -> Result<Attribute, Error> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_targets_per_entry_new() -> Result<Attribute, Error> {
|
fn attr_targets_per_entry_new() -> Attribute {
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::TargetsPerEntry as u16,
|
Attributes::TargetsPerEntry as u16,
|
||||||
AttrValue::Uint16(acl::TARGETS_PER_ENTRY as u16),
|
AttrValue::Uint16(acl::TARGETS_PER_ENTRY as u16),
|
||||||
|
@ -179,7 +179,7 @@ fn attr_targets_per_entry_new() -> Result<Attribute, Error> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attr_entries_per_fabric_new() -> Result<Attribute, Error> {
|
fn attr_entries_per_fabric_new() -> Attribute {
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::EntriesPerFabric as u16,
|
Attributes::EntriesPerFabric as u16,
|
||||||
AttrValue::Uint16(acl::ENTRIES_PER_FABRIC as u16),
|
AttrValue::Uint16(acl::ENTRIES_PER_FABRIC as u16),
|
||||||
|
|
|
@ -54,25 +54,25 @@ impl DescriptorCluster {
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::ServerList as u16,
|
Attributes::ServerList as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::PartsList as u16,
|
Attributes::PartsList as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?,
|
),
|
||||||
Attribute::new(
|
Attribute::new(
|
||||||
Attributes::ClientList as u16,
|
Attributes::ClientList as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?,
|
),
|
||||||
];
|
];
|
||||||
c.base.add_attributes(&attrs[..])?;
|
c.base.add_attributes(&attrs[..])?;
|
||||||
Ok(c)
|
Ok(c)
|
||||||
|
|
|
@ -176,31 +176,31 @@ impl EchoCluster {
|
||||||
AttrValue::Uint16(0x1234),
|
AttrValue::Uint16(0x1234),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?)?;
|
))?;
|
||||||
c.base.add_attribute(Attribute::new(
|
c.base.add_attribute(Attribute::new(
|
||||||
Attributes::Att2 as u16,
|
Attributes::Att2 as u16,
|
||||||
AttrValue::Uint16(0x5678),
|
AttrValue::Uint16(0x5678),
|
||||||
Access::RV,
|
Access::RV,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?)?;
|
))?;
|
||||||
c.base.add_attribute(Attribute::new(
|
c.base.add_attribute(Attribute::new(
|
||||||
Attributes::AttWrite as u16,
|
Attributes::AttWrite as u16,
|
||||||
AttrValue::Uint16(ATTR_WRITE_DEFAULT_VALUE),
|
AttrValue::Uint16(ATTR_WRITE_DEFAULT_VALUE),
|
||||||
Access::WRITE | Access::NEED_ADMIN,
|
Access::WRITE | Access::NEED_ADMIN,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?)?;
|
))?;
|
||||||
c.base.add_attribute(Attribute::new(
|
c.base.add_attribute(Attribute::new(
|
||||||
Attributes::AttCustom as u16,
|
Attributes::AttCustom as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
Access::READ | Access::NEED_VIEW,
|
Access::READ | Access::NEED_VIEW,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?)?;
|
))?;
|
||||||
c.base.add_attribute(Attribute::new(
|
c.base.add_attribute(Attribute::new(
|
||||||
Attributes::AttWriteList as u16,
|
Attributes::AttWriteList as u16,
|
||||||
AttrValue::Custom,
|
AttrValue::Custom,
|
||||||
Access::WRITE | Access::NEED_ADMIN,
|
Access::WRITE | Access::NEED_ADMIN,
|
||||||
Quality::NONE,
|
Quality::NONE,
|
||||||
)?)?;
|
))?;
|
||||||
Ok(c)
|
Ok(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue