Skip to content

Commit

Permalink
Fix attribute naming (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
XdoctorwhoZ authored Dec 17, 2024
1 parent 551e72b commit 371469d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 9 additions & 3 deletions src/instance/attribute/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,22 @@ impl AttributeBuilder {
self
}

/// Set the Read Only mode to this attribute
///
pub fn with_ro(mut self) -> Self {
self.mode = Some(AttributeMode::AttOnly);
self.mode = Some(AttributeMode::ReadOnly);
self
}
/// Set the Write Only mode to this attribute
///
pub fn with_wo(mut self) -> Self {
self.mode = Some(AttributeMode::CmdOnly);
self.mode = Some(AttributeMode::WriteOnly);
self
}
/// Set the Write Read mode to this attribute
///
pub fn with_rw(mut self) -> Self {
self.mode = Some(AttributeMode::Bidir);
self.mode = Some(AttributeMode::ReadWrite);
self
}

Expand Down
6 changes: 3 additions & 3 deletions src/runtime/notification/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ use super::Notification;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum AttributeMode {
#[serde(rename = "RO")]
AttOnly,
ReadOnly,
#[serde(rename = "WO")]
CmdOnly,
WriteOnly,
#[serde(rename = "RW")]
Bidir,
ReadWrite,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down

0 comments on commit 371469d

Please sign in to comment.