Skip to content

Commit

Permalink
Added HCIDeviceOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed May 15, 2019
1 parent 37e4356 commit f716d7f
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Sources/BluetoothLinux/HCI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public struct HCIDeviceInformation {
public let address: BluetoothAddress = .zero

/// uint32_t flags;
public let flags: UInt32 = 0
public let flags = HCIDeviceOptions(rawValue: 0)

/// uint8_t type;
public let type: UInt8 = 0
Expand Down Expand Up @@ -316,7 +316,7 @@ public struct HCIDeviceInformation {
internal init() { }
}

public struct HCIDeviceStatistics {
public struct HCIDeviceStatistics: Equatable, Hashable {

/// uint32_t err_rx;
public let errorRX: UInt32 = 0
Expand Down Expand Up @@ -351,6 +351,22 @@ public struct HCIDeviceStatistics {
internal init() { }
}

public struct HCIDeviceOptions: RawRepresentable, Equatable, Hashable {

public let rawValue: UInt32

public init(rawValue: UInt32) {
self.rawValue = rawValue
}
}

public extension HCIDeviceOptions {

func contains(_ flag: HCIDeviceFlag) -> Bool {
return HCITestBit(flag, rawValue)
}
}

internal struct HCIFilter {

internal struct Bits {
Expand Down

0 comments on commit f716d7f

Please sign in to comment.