Timeular / noble-mac

Noble MacOS bindings using the official CoreBluetooth API
MIT License
94 stars 34 forks source link

CBManagerState for macOS pre 10.13 #2

Closed paulvarache closed 6 years ago

paulvarache commented 6 years ago

The symbol CBManagerState was named CBCentralManagerState pre 10.13. To get it to compile on 10.12 and less, the symbol must be renamed.

Is there a way to have that added in the sources with macros?

I am unaware of everything Objective C related so please excuse my obvious ignorance

geovie commented 6 years ago

Hi, I actually added a macro guard around the functions which take CBManagerState/CBCentralManagerState https://github.com/Timeular/noble-mac/blob/560945db453798d1e641a8f64dffed7bf007944a/src/objc_cpp.h#L11-L18

Maybe I got the #if wrong 🤔 What is the error you're facing? Which macOS version/xcode version are you using?

paulvarache commented 6 years ago

I am using macOS 10.11.6 with XCode 7.2. I'm avoiding updates with my hardware to make sure I can still test older versions of macOS

geovie commented 6 years ago

Ok, thanks. I will set up travis today in #1, then the build can be tested with the following macOS/xcode versions: https://docs.travis-ci.com/user/reference/osx/#os-x-version

paulvarache commented 6 years ago

Perfect thanks. If you need any help to progress, or test with real hardware, I am available to do so

geovie commented 6 years ago

@paulvarache Could you try #3? I tested it on OS X 10.11 with xcode 7.3

paulvarache commented 6 years ago

No more error on CBManagerState, still can't build but I think it's due to my outdated version of XCode. It errors on futures

geovie commented 6 years ago

Yes unfortunately we need some 'newer' c++ features. I'm working on setting up node-pre-gyp for this repository. I guess it should work if you can download the pre-build native module.

I'll close this. I can ping you if you're interested in testing it with once node-pre-gyp is setup!?

paulvarache commented 6 years ago

Ping whenever this need to be tested