refactor: reorganize client constants

This commit is contained in:
2026-07-20 22:13:51 +02:00
parent 05cf7fc26c
commit 455585eeb6
3 changed files with 32 additions and 32 deletions
+3 -3
View File
@@ -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();