Skip to content

Commit

Permalink
Pull out constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
SirVer committed Dec 11, 2023
1 parent d91da2d commit 0b802d3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions zvt/src/feig/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pub mod constants;
pub mod packets;
pub mod sequences;
3 changes: 0 additions & 3 deletions zvt/src/feig/packets/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ pub struct CVendFunctions {
pub instr: u16,
}

pub const CVEND_FUNCTIONS_ENHANCED_SYSTEMS_INFO: u16 = 1;
pub const CVEND_FUNCTIONS_ENHANCED_FACTORY_RESET: u16 = 0x0255;

#[derive(Debug, PartialEq, Zvt)]
#[zvt_control_field(class = 0x80, instr = 0x00)]
pub struct WriteData {
Expand Down
4 changes: 2 additions & 2 deletions zvt_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async fn status(socket: &mut PacketTransport) -> Result<()> {
// Check the current version of the software
let request = feig::packets::CVendFunctions {
password: None,
instr: feig::packets::CVEND_FUNCTIONS_ENHANCED_SYSTEMS_INFO,
instr: feig::constants::CVendFunctions::SystemsInfo as u16,
};
let mut stream = feig::sequences::GetSystemInfo::into_stream(&request, socket);
while let Some(response) = stream.next().await {
Expand All @@ -237,7 +237,7 @@ async fn status(socket: &mut PacketTransport) -> Result<()> {
async fn factory_reset(socket: &mut PacketTransport, password: usize) -> Result<()> {
let request = feig::packets::CVendFunctions {
password: Some(password),
instr: feig::packets::CVEND_FUNCTIONS_ENHANCED_FACTORY_RESET,
instr: feig::constants::CVendFunctions::FactoryReset as u16,
};
let mut stream = feig::sequences::FactoryReset::into_stream(&request, socket);
while let Some(response) = stream.next().await {
Expand Down

0 comments on commit 0b802d3

Please sign in to comment.