From 9938f62d72031ac70bcfbf534fafc0e29455a4e3 Mon Sep 17 00:00:00 2001 From: Andelf Date: Wed, 15 Nov 2023 10:54:48 +0800 Subject: [PATCH] fix(ble): avoid use default mac address from sys flash --- src/ble/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ble/mod.rs b/src/ble/mod.rs index 4162c03..1a477c6 100644 --- a/src/ble/mod.rs +++ b/src/ble/mod.rs @@ -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 } } }