Commit 9a3e8201 authored by Philip Brechler's avatar Philip Brechler

Change to .withResponse to work with iOS firmware branch

parent ab1719fa
......@@ -194,7 +194,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: .withoutResponse)
self.connectedPeripheral?.writeValue(time.data, for: characteristic, type: .withResponse)
}
public func setVibrate(milliseconds: UInt16) {
......@@ -206,7 +206,7 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
}
print("setVibrate \(milliseconds) ms on \(peripheral.identifier)")
self.connectedPeripheral?.writeValue(milliseconds.data, for: characteristic, type: .withoutResponse)
self.connectedPeripheral?.writeValue(milliseconds.data, for: characteristic, type: .withResponse)
}
public func illuminateRocketsWithBrightness(rocketOne: UInt8, rocketTwo: UInt8, rocketThree: UInt8) {
......@@ -218,7 +218,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: .withoutResponse)
self.connectedPeripheral?.writeValue(Data([rocketOne, rocketTwo, rocketThree]), for: characteristic, type: .withResponse)
}
public func setBackgroundLEDs (topLeft: RGBLED, topRight: RGBLED, bottomRight: RGBLED, bottomLeft: RGBLED) {
......@@ -240,10 +240,10 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
return
}
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)
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)
}
/// Set's the 11 RGB leds at the top. Parameters are from left to right.
......@@ -269,7 +269,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: .withoutResponse)
type: .withResponse)
}
private func mergeLedsAboveIntoData(a: RGBLED,
......
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