Skip to content

Commit

Permalink
Added missing LinuxCentral methods
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Jul 2, 2018
1 parent c9527cf commit 9f94eae
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Sources/GATT/Central.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public protocol CentralProtocol: class {

func connect(to peripheral: Peripheral, timeout: TimeInterval) throws

func disconnect(peripheral: Peripheral)

func disconnectAll()

func discoverServices(_ services: [BluetoothUUID],
for peripheral: Peripheral,
timeout: TimeInterval) throws -> [Service]
Expand Down
24 changes: 17 additions & 7 deletions Sources/GATT/LinuxCentral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,50 @@ public final class LinuxCentral: CentralProtocol {
fatalError()
}

public func scan(filterDuplicates: Bool, shouldContinueScanning: () -> (Bool), foundDevice: @escaping (ScanData) -> ()) throws {
public func scan(filterDuplicates: Bool = true, shouldContinueScanning: () -> (Bool), foundDevice: @escaping (ScanData) -> ()) throws {

fatalError()
}

public func connect(to peripheral: Peripheral, timeout: TimeInterval) throws {
public func connect(to peripheral: Peripheral, timeout: TimeInterval = 30) throws {

}

public func discoverServices(_ services: [BluetoothUUID], for peripheral: Peripheral, timeout: TimeInterval) throws -> [Service] {
public func discoverServices(_ services: [BluetoothUUID] = [], for peripheral: Peripheral, timeout: TimeInterval = 30) throws -> [Service] {

fatalError()
}

public func discoverCharacteristics(_ characteristics: [BluetoothUUID], for service: BluetoothUUID, peripheral: Peripheral, timeout: TimeInterval) throws -> [Characteristic] {
public func discoverCharacteristics(_ characteristics: [BluetoothUUID] = [], for service: BluetoothUUID, peripheral: Peripheral, timeout: TimeInterval = 30) throws -> [Characteristic] {


fatalError()
}

public func readValue(for characteristic: BluetoothUUID, service: BluetoothUUID, peripheral: Peripheral, timeout: TimeInterval) throws -> Data {
public func readValue(for characteristic: BluetoothUUID, service: BluetoothUUID, peripheral: Peripheral, timeout: TimeInterval = 30) throws -> Data {

fatalError()
}

public func writeValue(_ data: Data, for characteristic: BluetoothUUID, withResponse: Bool, service: BluetoothUUID, peripheral: Peripheral, timeout: TimeInterval) throws {
public func writeValue(_ data: Data, for characteristic: BluetoothUUID, withResponse: Bool = true, service: BluetoothUUID, peripheral: Peripheral, timeout: TimeInterval = 30) throws {

fatalError()
}

public func notify(_ notification: ((Data) -> ())?, for characteristic: BluetoothUUID, service: BluetoothUUID, peripheral: Peripheral, timeout: TimeInterval) throws {
public func notify(_ notification: ((Data) -> ())?, for characteristic: BluetoothUUID, service: BluetoothUUID, peripheral: Peripheral, timeout: TimeInterval = 30) throws {

fatalError()
}

public func disconnect(peripheral: Peripheral) {

fatalError()
}

public func disconnectAll() {

fatalError()
}
}

#endif
Expand Down

0 comments on commit 9f94eae

Please sign in to comment.