Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Igigog committed Oct 22, 2023
1 parent 13f2153 commit c749b87
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
2 changes: 1 addition & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use commands::SetConfiguration;
use commands::SetFilterConfiguration;
use commands::SetPcm3060Configuration;
use commands::SetPreprocessingConfiguration;
use commands::StructureTypes;
use model::Filter;
use model::Filters;
use model::StructureTypes;
use rusb::{Device, DeviceHandle, Direction, UsbContext};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
Expand Down
27 changes: 0 additions & 27 deletions src-tauri/src/model.rs
Original file line number Diff line number Diff line change
@@ -1,35 +1,8 @@
use log::error;
use std::io::{Read, Seek, SeekFrom};

use byteorder::{LittleEndian, ReadBytesExt};
use serde::{Deserialize, Serialize};

#[repr(u16)]
// #[allow(dead_code)]
pub enum StructureTypes {
// Commands/Responses, these are container TLVs. The Value will be a set of TLV structures.
OK = 0, // Standard response when a command was successful
NOK, // Standard error response
FlashHeader, // A special container for the config stored in flash. Hopefully there is some useful
// metadata in here to allow us to migrate an old config to a new version.
GetVersion, // Returns the current config version, and the minimum supported version so clients
// can decide if they can talk to us or not.
SetConfiguration, // Updates the active configuration with the supplied TLVs
GetActiveConfiguration, // Retrieves the current active configuration TLVs from RAM
GetStoredConfiguration, // Retrieves the current stored configuration TLVs from Flash
SaveConfiguration, // Writes the active configuration to Flash
FactoryReset, // Invalidates the flash memory

// Configuration structures, these are returned in the body of a command/response
PreProcessingConfiguration = 0x200,
FilterConfiguration,
Pcm3060Configuration,

// Status structures, these are returned in the body of a command/response but they are
// not persisted as part of the configuration
VersionStatus = 0x400,
}

trait ReadFilter: Sized {
fn from_reader(cur: impl Read) -> Self;
}
Expand Down

0 comments on commit c749b87

Please sign in to comment.