Commit 2db9fbc3fc8afc43d256e2578a7ec7374595372a
1 parent
920e260e
feat:write type
Showing
1 changed file
with
2 additions
and
2 deletions
HDFwear/Tools/BluetoothManager.swift
@@ -1253,12 +1253,12 @@ class BluetoothManager: NSObject { | @@ -1253,12 +1253,12 @@ class BluetoothManager: NSObject { | ||
1253 | if platform == ._828 { | 1253 | if platform == ._828 { |
1254 | if data.count <= 20 { | 1254 | if data.count <= 20 { |
1255 | print("发送: \([UInt8](data))") | 1255 | print("发送: \([UInt8](data))") |
1256 | - peripheral?.writeValue(data, for: char, type: .withResponse) | 1256 | + peripheral?.writeValue(data, for: char, type: .withoutResponse) |
1257 | } else { | 1257 | } else { |
1258 | print("发送 拼: \([UInt8](data))") | 1258 | print("发送 拼: \([UInt8](data))") |
1259 | let n = data.count/20 + (data.count%20 == 0 ? 0 : 1) | 1259 | let n = data.count/20 + (data.count%20 == 0 ? 0 : 1) |
1260 | for i in 0..<n { | 1260 | for i in 0..<n { |
1261 | - peripheral?.writeValue(data[i*20..<min(i*20+20, data.count)], for: char, type: .withResponse) | 1261 | + peripheral?.writeValue(data[i*20..<min(i*20+20, data.count)], for: char, type: .withoutResponse) |
1262 | } | 1262 | } |
1263 | } | 1263 | } |
1264 | } else { | 1264 | } else { |