From e5ce441af46be7108adb48f1e08994589c3b839b Mon Sep 17 00:00:00 2001 From: Alsey Coleman Miller Date: Thu, 13 Sep 2018 23:29:30 -0500 Subject: [PATCH] Working on Central --- Sources/DarwinGATT/DarwinCentral.swift | 3 +++ Sources/GATT/GATTCentral.swift | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/Sources/DarwinGATT/DarwinCentral.swift b/Sources/DarwinGATT/DarwinCentral.swift index 2bebda4..3300553 100644 --- a/Sources/DarwinGATT/DarwinCentral.swift +++ b/Sources/DarwinGATT/DarwinCentral.swift @@ -325,6 +325,9 @@ public final class DarwinCentral: NSObject, CentralProtocol, CBCentralManagerDel // write request corePeripheral.writeValue(data, for: coreCharacteristic, type: writeType) + guard coreCharacteristic.properties.contains(.writeWithoutResponse) == false + else { return } + // calls `peripheral:didWriteValueForCharacteristic:error:` only // if you specified the write type as `.withResponse`. diff --git a/Sources/GATT/GATTCentral.swift b/Sources/GATT/GATTCentral.swift index fd9bdbb..fa844d9 100644 --- a/Sources/GATT/GATTCentral.swift +++ b/Sources/GATT/GATTCentral.swift @@ -149,11 +149,16 @@ public final class GATTCentral