Skip to content

Commit

Permalink
fixed disconnect error
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Jun 10, 2016
1 parent 3265b56 commit 307fd16
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Sources/GATT/LinuxPeripheral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// MARK: - Properties

public var log: (String -> ())?
public var log: ((String) -> ())?

public let maximumTransmissionUnit: Int

Expand Down Expand Up @@ -117,7 +117,7 @@

peripheral.database = server.database

try server.write()
let _ = try server.write()

if let didWrite = didWrite {

Expand All @@ -128,7 +128,9 @@
catch {

/// Turn on LE advertising after disconnect (Linux turns if off for some reason)
if let disconnectError = error as? POSIXError where disconnectError.rawValue == 104 {
if let disconnectError = error as? POSIXError
where disconnectError.rawValue == 104
|| disconnectError.rawValue == 110 {

peripheral.log?("Central \(newSocket.address) disconnected")

Expand Down

0 comments on commit 307fd16

Please sign in to comment.