Skip to content

Commit

Permalink
Improve Embedded Swift support
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Nov 14, 2024
1 parent 1984595 commit c4fe9e8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Sources/GATT/AdvertisementData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//

@_exported import Bluetooth
#if canImport(BluetoothGAP)
import BluetoothGAP
#endif

/// GATT Advertisement Data.
public protocol AdvertisementData: Hashable, Sendable {
Expand Down Expand Up @@ -34,7 +37,6 @@ public protocol AdvertisementData: Hashable, Sendable {
}

#if canImport(BluetoothGAP)
import BluetoothGAP

// MARK: - LowEnergyAdvertisingData

Expand Down
2 changes: 1 addition & 1 deletion Sources/GATT/AsyncStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public extension AsyncCentralScan {

public struct AsyncCentralNotifications <Central: CentralManager>: AsyncSequence {

public typealias Element = Data
public typealias Element = Central.Data

let stream: AsyncIndefiniteStream<Element>

Expand Down
2 changes: 2 additions & 0 deletions Sources/GATT/CentralError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
// Created by Alsey Coleman Miller on 7/14/18.
//

#if canImport(Foundation)
import Foundation
#endif
import Bluetooth

/// Errors for GATT Central Manager
Expand Down
7 changes: 3 additions & 4 deletions Sources/GATT/L2CAP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@
//

#if canImport(BluetoothHCI)
import Foundation
import Bluetooth
import BluetoothHCI

internal extension L2CAPSocket {
internal extension L2CAPConnection {

/// Creates a client socket for an L2CAP connection.
static func lowEnergyClient(
address localAddress: BluetoothAddress,
destination: HCILEAdvertisingReport.Report
) async throws -> Self {
try await lowEnergyClient(
) throws -> Self {
try lowEnergyClient(
address: localAddress,
destination: destination.address,
isRandom: destination.addressType == .random
Expand Down

0 comments on commit c4fe9e8

Please sign in to comment.