MillerTechnologyPeru / hcitool

Bluetooth Host Controller Interface Command Line Tool for for sending HCI commands on macOS and Linux
https://millertechnologyperu.github.io/hcitool/
MIT License
93 stars 11 forks source link

How do you install this? #45

Closed mm-ns closed 6 years ago

mm-ns commented 6 years ago

Any chance you could add info about how do you install hcitool on osx?

colemancda commented 6 years ago

Just swift build and copy it wherever you like. If you want it always on your command line environment add it to your path.

rootscript commented 6 years ago

@colemancda I have some warning & errors when running swift build. Using Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2) on MacOs 10.12.6 Any suggestions appreciated.

~/Downloads/hcitool/hcitool-1.1.0 ᐅ swift build
Fetching https://github.com/PureSwift/BluetoothDarwin.git
Fetching https://github.com/PureSwift/Bluetooth.git
Fetching https://github.com/MillerTechnologyPeru/Rainbow.git
Cloning https://github.com/PureSwift/BluetoothDarwin.git
Resolving https://github.com/PureSwift/BluetoothDarwin.git at 1.0.1
Cloning https://github.com/PureSwift/Bluetooth.git
Resolving https://github.com/PureSwift/Bluetooth.git at 1.8.3
Cloning https://github.com/MillerTechnologyPeru/Rainbow.git
Resolving https://github.com/MillerTechnologyPeru/Rainbow.git at 3.2.0
Compile CBluetoothDarwin dummy.c
Compile Swift Module 'Bluetooth' (79 sources)
Compile Swift Module 'BluetoothDarwin' (2 sources)
~/Downloads/hcitool/hcitool-1.1.0/.build/checkouts/BluetoothDarwin.git--1200803191445832098/Sources/BluetoothDarwin/HostController.swift:16:20: error: type 'HostController' does not conform to protocol 'BluetoothHostControllerInterface'
public final class HostController: NSObject, BluetoothHostControllerInterface {
                   ^
~/Downloads/hcitool/hcitool-1.1.0/.build/checkouts/BluetoothDarwin.git--1200803191445832098/Sources/BluetoothDarwin/HostController.swift:101:17: note: candidate has non-matching type '<CP, EP> (CP, EP.Type, timeout: HCICommandTimeout) throws -> EP'
    public func deviceRequest<CP, EP>(_ commandParameter: CP, _ eventParameterType: EP.Type, timeout: HCICommandTimeout = .default) throws -> EP where CP : HCICommandParameter, EP : HCIEventParameter {
                ^
~/Downloads/hcitool/hcitool-1.1.0/.build/checkouts/BluetoothDarwin.git--1200803191445832098/Sources/BluetoothDarwin/HostController.swift:122:17: note: candidate has non-matching type '<CP, Return> (CP, Return.Type, timeout: HCICommandTimeout) throws -> Return'
    public func deviceRequest<CP, Return>(_ commandParameter: CP, _ commandReturnType: Return.Type, timeout: HCICommandTimeout = .default) throws -> Return where CP : HCICommandParameter, Return : HCICommandReturnParameter {
                ^
Bluetooth.BluetoothHostControllerInterface:16:17: note: protocol requires function 'deviceRequest(_:_:timeout:)' with type '<C, EP> (C, EP.Type, timeout: HCICommandTimeout) throws -> EP'; do you want to add a stub?
    public func deviceRequest<C, EP>(_ command: C, _ eventParameterType: EP.Type, timeout: Bluetooth.HCICommandTimeout) throws -> EP where C : HCICommand, EP : HCIEventParameter
                ^
~/Downloads/hcitool/hcitool-1.1.0/.build/checkouts/BluetoothDarwin.git--1200803191445832098/Sources/BluetoothDarwin/HostController.swift:144:13: warning: variable 'error' was never mutated; consider changing to 'let' constant
        var error: Error?
        ~~~ ^
        let
~/Downloads/hcitool/hcitool-1.1.0/.build/checkouts/BluetoothDarwin.git--1200803191445832098/Sources/BluetoothDarwin/HostController.swift:184:13: warning: initialization of immutable value 'opcode' was never used; consider replacing with assignment to '_' or removing it
        let opcode = message.pointee.dataInfo.opcode
        ~~~~^~~~~~
        _
error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f ~/Downloads/hcitool/hcitool-1.1.0/.build/debug.yaml main