Browse Source

上传

weicu
liwei1dao 1 year ago
parent
commit
ce2b43c174
  1. 8
      local_plugins/classic_bluetooth/ios/classic_bluetooth/Sources/classic_bluetooth/ClassicBluetoothHelper.swift

8
local_plugins/classic_bluetooth/ios/classic_bluetooth/Sources/classic_bluetooth/ClassicBluetoothHelper.swift

@ -65,16 +65,16 @@ public class ClassicBluetoothHelper: NSObject, CBCentralManagerDelegate {
case .stateChanged: case .stateChanged:
if let state = data["state"] as? String { if let state = data["state"] as? String {
print("蓝牙状态变化: \(state)") print("蓝牙状态变化: \(state)")
configureAudioRouteBasedOnBluetoothState() // configureAudioRouteBasedOnBluetoothState()
} }
case .deviceConnected: case .deviceConnected:
print("蓝牙设备已连接") print("蓝牙设备已连接")
// 蓝牙设备连接时:末端在手机,输出端在耳机 // 蓝牙设备连接时:末端在手机,输出端在耳机
configureAudioForBluetoothConnected() // configureAudioForBluetoothConnected()
case .deviceDisconnected: case .deviceDisconnected:
print("蓝牙设备已断开") print("蓝牙设备已断开")
// 蓝牙设备断开时:末端和输出端都在手机 // 蓝牙设备断开时:末端和输出端都在手机
configureAudioForBluetoothDisconnected() /*configureAudioForBluetoothDisconnected*/()
} }
} }
@ -382,4 +382,4 @@ public class ClassicBluetoothHelper: NSObject, CBCentralManagerDelegate {
print("向Flutter端报告的蓝牙状态: \(state.rawValue)") print("向Flutter端报告的蓝牙状态: \(state.rawValue)")
stateCallback?(.stateChanged, ["state": state.rawValue]) stateCallback?(.stateChanged, ["state": state.rawValue])
} }
} }

Loading…
Cancel
Save