Commit 62fa6907 authored by Thomas Mellenthin's avatar Thomas Mellenthin

Switch back to withoutResponse, as FW changed this

parent 2004c498
......@@ -186,7 +186,7 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
let time = UInt64(bigEndian: badgeTimeInMilliseconds)
print("setTimeOnPeripheral \(peripheral.identifier) to \(currentDate) (\(badgeTimeInMilliseconds))")
self.connectedPeripheral?.writeValue(time.data, for: characteristic, type: .withResponse)
self.connectedPeripheral?.writeValue(time.data, for: characteristic, type: .withoutResponse)
}
public func setVibrate(milliseconds: UInt16) {
......@@ -198,7 +198,7 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
}
print("setVibrate \(milliseconds) ms on \(peripheral.identifier)")
self.connectedPeripheral?.writeValue(milliseconds.data, for: characteristic, type: .withResponse)
self.connectedPeripheral?.writeValue(milliseconds.data, for: characteristic, type: .withoutResponse)
}
public func illuminateRocketsWithBrightness(rocketOne: UInt8, rocketTwo: UInt8, rocketThree: UInt8) {
......@@ -210,7 +210,7 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
}
print("set rockets to \(rocketOne), \(rocketTwo), \(rocketThree) on \(peripheral.identifier)")
self.connectedPeripheral?.writeValue(Data([rocketOne, rocketTwo, rocketThree]), for: characteristic, type: .withResponse)
self.connectedPeripheral?.writeValue(Data([rocketOne, rocketTwo, rocketThree]), for: characteristic, type: .withoutResponse)
}
public func setBackgroundLEDs (topLeft: RGBLED, topRight: RGBLED, bottomRight: RGBLED, bottomLeft: RGBLED) {
......@@ -232,10 +232,10 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
return
}
self.connectedPeripheral?.writeValue(topLeft.data, for: tlCharacteristic, type: .withResponse)
self.connectedPeripheral?.writeValue(topRight.data, for: trCharacteristic, type: .withResponse)
self.connectedPeripheral?.writeValue(bottomRight.data, for: brCharacteristic, type: .withResponse)
self.connectedPeripheral?.writeValue(bottomLeft.data, for: blCharacteristic, type: .withResponse)
self.connectedPeripheral?.writeValue(topLeft.data, for: tlCharacteristic, type: .withoutResponse)
self.connectedPeripheral?.writeValue(topRight.data, for: trCharacteristic, type: .withoutResponse)
self.connectedPeripheral?.writeValue(bottomRight.data, for: brCharacteristic, type: .withoutResponse)
self.connectedPeripheral?.writeValue(bottomLeft.data, for: blCharacteristic, type: .withoutResponse)
}
/// Set's the 11 RGB leds at the top. Parameters are from left to right.
......@@ -261,7 +261,7 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
self.connectedPeripheral?.writeValue(mergeLedsAboveIntoData(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k),
for: aboveCharacteristic,
type: .withResponse)
type: .withoutResponse)
}
private func mergeLedsAboveIntoData(a: RGBLED,
......@@ -344,7 +344,7 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
// I failed to scan for the CBUUD 42230100-2342-2342-2342-234223422342 :-/
guard let name = peripheral.name, name.hasPrefix("card10") else { return }
print("did discover: \(name) \(peripheral.identifier)), \(advertisementData[CBAdvertisementDataLocalNameKey])")
print("did discover: \(name) \(peripheral.identifier)), CBAdvertisementDataLocalNameKey: \(String(describing: advertisementData[CBAdvertisementDataLocalNameKey]))")
// sort & unique foundPeripherals
foundPeripheral.append(peripheral)
......@@ -431,7 +431,7 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
guard let characteristic = self.findCharacteristic(on: peripheral, forServiceUUID: card10RxTxServiceUUID, forCharacteristicUUID: card10TXWriteCharacteristicUUID) else { return }
self.connectedPeripheral?.writeValue(package, for: characteristic, type: .withoutResponse)
self.connectedPeripheral?.writeValue(package, for: characteristic, type: .withResponse)
}
func didUpdateState(_ state: TransferState) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment