refactor: reorganize client constants
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::dsp408::client::constants::{METERS_HIGH_STEP, METERS_LOW_STEP, METERS_SPLIT, METERS_SPLIT_LEVEL};
|
||||
use crate::dsp408::client::constants::{METERS_HIGH_STEP, METERS_LOW_STEP, METERS_SPLIT, METERS_SPLIT_LEVEL_DB};
|
||||
use crate::dsp408::client::types::{
|
||||
Acknowledgement, AuthenticationResult, ConfigChunk, CurrentPreset, DeviceFlags, DeviceInfo,
|
||||
DeviceResponseType, HandshakeAck, Meters, ModifiedPreset, NotImplemented, PresetName,
|
||||
@@ -173,9 +173,9 @@ pub fn map_response(frame: &Frame) -> Result<DeviceResponseType, ProtocolError>
|
||||
.into_iter()
|
||||
.map(|f| {
|
||||
if f < METERS_SPLIT {
|
||||
METERS_SPLIT_LEVEL + (f - METERS_SPLIT) / METERS_LOW_STEP
|
||||
METERS_SPLIT_LEVEL_DB + (f - METERS_SPLIT) / METERS_LOW_STEP
|
||||
} else {
|
||||
METERS_SPLIT_LEVEL + (f - METERS_SPLIT) / METERS_HIGH_STEP
|
||||
METERS_SPLIT_LEVEL_DB + (f - METERS_SPLIT) / METERS_HIGH_STEP
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
Reference in New Issue
Block a user