diff --git a/HDFwear/Tools/Bluetooth+Types.swift b/HDFwear/Tools/Bluetooth+Types.swift index 6565d06..9eac08d 100644 --- a/HDFwear/Tools/Bluetooth+Types.swift +++ b/HDFwear/Tools/Bluetooth+Types.swift @@ -28,6 +28,8 @@ public struct BLEConfig { static let ReadUUID = "0000FFF3-0000-1000-8000-00805F9B34FB" //读取数据特征值 static let WriteUUID = "0000FFF2-0000-1000-8000-00805F9B34FB" //写入数据特征值 + static let NotificationUUID = "0000FFD2-0000-1000-8000-00805F9B34FB" //写入数据特征值 + // 0000FFF4-0000-1000-8000-00805F9B34FB // 转换特征值 // 旧 diff --git a/HDFwear/Tools/BluetoothManager.swift b/HDFwear/Tools/BluetoothManager.swift index ecd9676..38afbce 100644 --- a/HDFwear/Tools/BluetoothManager.swift +++ b/HDFwear/Tools/BluetoothManager.swift @@ -1882,6 +1882,9 @@ extension BluetoothManager: CBPeripheralDelegate { delegate.didSetupServiceCharacteristics(peripheral) } } + if BLEConfig.NotificationUUID.contains(uuid) { + peripheral.setNotifyValue(true, for: char) + } } }