From 371469d8592a36a9fd8c27d1c5ec418f693139cc Mon Sep 17 00:00:00 2001 From: Xavier RODRIGUEZ Date: Tue, 17 Dec 2024 13:45:04 +0100 Subject: [PATCH] Fix attribute naming (#27) --- src/instance/attribute/builder.rs | 12 +++++++++--- src/runtime/notification/attribute.rs | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/instance/attribute/builder.rs b/src/instance/attribute/builder.rs index 7a677ad..1cef878 100644 --- a/src/instance/attribute/builder.rs +++ b/src/instance/attribute/builder.rs @@ -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 } diff --git a/src/runtime/notification/attribute.rs b/src/runtime/notification/attribute.rs index a0ef4f1..59bb9f8 100644 --- a/src/runtime/notification/attribute.rs +++ b/src/runtime/notification/attribute.rs @@ -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)]