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 | 1253 | if platform == ._828 { |
1254 | 1254 | if data.count <= 20 { |
1255 | 1255 | print("发送: \([UInt8](data))") |
1256 | - peripheral?.writeValue(data, for: char, type: .withResponse) | |
1256 | + peripheral?.writeValue(data, for: char, type: .withoutResponse) | |
1257 | 1257 | } else { |
1258 | 1258 | print("发送 拼: \([UInt8](data))") |
1259 | 1259 | let n = data.count/20 + (data.count%20 == 0 ? 0 : 1) |
1260 | 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 | 1264 | } else { | ... | ... |