Skip to content

Commit

Permalink
move audio seed to end of config
Browse files Browse the repository at this point in the history
  • Loading branch information
gferraro committed Feb 10, 2025
1 parent 00d934b commit b20ae2d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/device_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,6 @@ impl DeviceConfig {
buf.write_u32::<LittleEndian>(device_id).unwrap();
let audio_mode: u8 = self.audio_info.audio_mode.clone().into();
buf.write_u8(audio_mode).unwrap();
buf.write_u32::<LittleEndian>(self.audio_info.audio_seed)
.unwrap();
let (latitude, longitude) = self.lat_lng();
buf.write_f32::<LittleEndian>(latitude).unwrap();
buf.write_f32::<LittleEndian>(longitude).unwrap();
Expand Down Expand Up @@ -921,11 +919,12 @@ impl DeviceConfig {
.unwrap();
buf.write_u8(if self.use_low_power_mode() { 1 } else { 0 })
.unwrap();

let device_name = self.device_name();
let device_name_length = device_name.len().min(63);
buf.write_u8(device_name_length as u8).unwrap();
buf.write(&device_name[0..device_name_length]).unwrap();
buf.write_u32::<LittleEndian>(self.audio_info.audio_seed)
.unwrap();
}
}

Expand Down

0 comments on commit b20ae2d

Please sign in to comment.