-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed Bluetooth LE not advertising after disconnect
also added Beacon support
- Loading branch information
1 parent
e58f7ac
commit 94503eb
Showing
9 changed files
with
139 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
github "PureSwift/JSON-C" "e8e38025563d43e425536200002ad13c3f35a98b" | ||
github "PureSwift/SwiftFoundation" "aca70ddca59f69455775295ed8e9399d062de8de" | ||
github "PureSwift/Bluetooth" "5f4aa3c090ff7f7e6b05241d582ef1071199a80c" | ||
github "PureSwift/BluetoothLinux" "38e3d54686d29e831a8e9ddb261d55457fb1ea2a" | ||
github "PureSwift/SwiftFoundation" "2490130e2a72183f5fe209df82b0fc012f41f532" | ||
github "PureSwift/Bluetooth" "39e77da8f45b4a781e790257f7f8c5db76986431" | ||
github "PureSwift/BluetoothLinux" "88eb1f0d646a460efd143c88f4f9adba50416ad4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// Beacon.swift | ||
// GATT | ||
// | ||
// Created by Alsey Coleman Miller on 4/29/16. | ||
// Copyright © 2016 PureSwift. All rights reserved. | ||
// | ||
|
||
import SwiftFoundation | ||
|
||
/// Describes an iBeacon to be advertised. | ||
public struct Beacon { | ||
|
||
/// The unique ID of the beacons being targeted. | ||
public var UUID: SwiftFoundation.UUID | ||
|
||
/// The value identifying a group of beacons. | ||
public var major: UInt16 | ||
|
||
/// The value identifying a specific beacon within a group. | ||
public var minor: UInt16 | ||
|
||
/// The received signal strength indicator (RSSI) value (measured in decibels) for the device. | ||
public var RSSI: Int8 | ||
|
||
#if os(Linux) || XcodeLinux | ||
/// The advertising interval. | ||
public var interval: UInt16 = 200 | ||
#endif | ||
|
||
public init(UUID: SwiftFoundation.UUID, major: UInt16, minor: UInt16, RSSI: Int8) { | ||
|
||
self.UUID = UUID | ||
self.major = major | ||
self.minor = minor | ||
self.RSSI = RSSI | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters