Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Fix #35: catalina compat
Browse files Browse the repository at this point in the history
  • Loading branch information
jariz committed Nov 17, 2019
1 parent 0bcda7d commit c7c2550
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion AkkuHelper/Bluetooth/Driver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ class Driver: NSObject {
public func open () throws {
// get driver
let port = kIOMasterPortDefault;
let service = IOServiceGetMatchingService(port, IOServiceMatching("IOBluetoothHCIController"))

var serviceName = "IOBluetoothHCIController";

if #available(OSX 10.15, *) {
serviceName = "IOBluetoothPacketLogger";
}

let service = IOServiceGetMatchingService(port, IOServiceMatching(serviceName))

if (service == 0) {
throw BluetoothHCIError.driverNotFound
Expand Down

0 comments on commit c7c2550

Please sign in to comment.