diff --git a/HDFwear/Home/HomeViewController.swift b/HDFwear/Home/HomeViewController.swift index ea0186d..1f69acd 100644 --- a/HDFwear/Home/HomeViewController.swift +++ b/HDFwear/Home/HomeViewController.swift @@ -495,7 +495,7 @@ extension HomeViewController: BluetoothManagerDelegate { } } - func didConnect(_ peripheral: CBPeripheral) { + func didConnect(_ peripheral: CBPeripheral, _ mac: String) { if GCDTimer.shared.isExistTimer(WithTimerName: "Reconnect") { GCDTimer.shared.cancleTimer(WithTimerName: "Reconnect") } diff --git a/HDFwear/Setting/SettingViewController.swift b/HDFwear/Setting/SettingViewController.swift index 5472544..7a63d1b 100644 --- a/HDFwear/Setting/SettingViewController.swift +++ b/HDFwear/Setting/SettingViewController.swift @@ -541,7 +541,7 @@ extension SettingViewController: BluetoothManagerDelegate { } - func didConnect(_ peripheral: CBPeripheral) { + func didConnect(_ peripheral: CBPeripheral, _ mac: String) { print("已经连接") switch CurDevice.platform { default: diff --git a/HDFwear/Tools/BluetoothManager.swift b/HDFwear/Tools/BluetoothManager.swift index d739dc7..1ca6c86 100644 --- a/HDFwear/Tools/BluetoothManager.swift +++ b/HDFwear/Tools/BluetoothManager.swift @@ -16,7 +16,7 @@ import Alamofire protocol BluetoothManagerDelegate: NSObjectProtocol { func didDiscover(devices: [ScanDevice]) - func didConnect(_ peripheral: CBPeripheral) + func didConnect(_ peripheral: CBPeripheral, _ mac: String) func centralManagerDidUpdateState(_ state: Int) func didDisconnected() } @@ -1408,7 +1408,7 @@ extension BluetoothManager: ClientProfileDelegate { DeviceIsConnected = true // MusicManager.shared.controlMusic() for delegate in delegateList { - delegate.didConnect(peripheral) + delegate.didConnect(peripheral, CurDevice.mac) } // GCDTimer.shared.scheduledDispatchTimerNotNow(WithTimerName: "FirstSync", timeInterval: 5+delayTime, queue: .main, repeats: false) {