Skip to content

Commit

Permalink
fix(ble): avoid use default mac address from sys flash
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Nov 15, 2023
1 parent eb046a2 commit 9938f62
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ble/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@ pub struct Config {
pub mac_addr: MacAddress,
}

impl Config {
pub fn use_factory_mac_address(&mut self) -> &mut Self {
self.mac_addr = MacAddress::from_raw(crate::isp::get_mac_address());
self
}
}

impl Default for Config {
fn default() -> Self {
let mac_addr = MacAddress::from_raw(crate::isp::get_mac_address());
let mac_addr = MacAddress::from_raw([0x11, 0x22, 0x33, 0x44, 0x55, 0x66]);
Config { mac_addr }
}
}
Expand Down

0 comments on commit 9938f62

Please sign in to comment.