Apple Watch BLE support

Now that the Apple Watch properly supports connecting to BLE peripherals, would it be possible to get a version of the framework with Watch OS support? This probably involves updating the dependencies and creating a Watch OS target in the podspec.

Thanks,

--Alex

Comments

  • Now that the Apple Watch properly supports connecting to BLE peripherals, would it be possible to get a version of the framework with Watch OS support? This probably involves updating the dependencies and creating a Watch OS target in the podspec.

    Thanks,

    --Alex

  • You can try using the new Swift SDK which contains the watchOS target. It isn't in the CocoaPods trunk yet, so you need to use the following to pull directly from our GitHub:

    pod 'MetaWear-Swift', :subspecs => ['UI', 'AsyncUtils', 'Mocks'], :git => 'https://github.com/mbientlab/MetaWear-SDK-Swift.git', :submodules => true, :commit => '5ee3818'
    pod 'Bolts-Swift', :git => 'https://github.com/BoltsFramework/Bolts-Swift.git', :commit => 'e9baa72'
    
  • Thanks very much for the quick reply. I'm getting the following error:
    import MetaWearCpp No such module MetawearCPP

    I can see the folder and tried adding it as a group, but still no luck. Any suggestions?

    Thanks.

  • edited April 26

    Bump. Hoping to get some help on this. Just tested and the standard MetaWear-Swift project on Git has exactly the same problem!

  • After running pod install, I get the following error: No such module 'MetaWearCpp'

  • Edit. Xcode Version 9.2.

  • The new Swift SDK is a wrapper around the C++ API, in the same manner as the JavaScript and Python APIs.

    Can your env compile the C++ code?

  • I'm not sure what you mean. The project doesn't properly build the MetaWearCpp module. I checked out the MetaWearCpp project separately and attempted to compile the module and got a bunch of errors. This is all very easy to reproduce by simply using the Podfile that Stephen described above.

  • Just to reiterate. Neither the standard MetaWear-Swift project, nor the one with updated pods as described above will build. Both report MetaWearCpp "no such module." This is the current state of affairs for developers. It would be nice to see these project templates repaired so that they actually build.

  • edited April 30

    Post the errors you are receiving with the C++ code.

    If you can't compile the C++ separately, then your env is most likely not using an appropriate C++ compiler.

  • edited April 30

    All the errors so far are related to "cmath". But a simple question, can you create a new project, install the Pods as Stephen described, and get the project to build?

  • edited April 30

    Errors below. Sample project can be downloaded here:
    https://www.dropbox.com/s/1zlwq5l28vv2458/Metawear-CPP-FU.zip?dl=0

    Again, simply following Stephen's instructions above in a new project will easily reproduce the no module found issue.

    Showing All Errors Only
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:314:9: No member named 'fpclassify' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:315:9: No member named 'isfinite' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:316:9: No member named 'isinf' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:317:9: No member named 'isnan' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:318:9: No member named 'isnormal' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:319:9: No member named 'isgreater' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:320:9: No member named 'isgreaterequal' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:321:9: No member named 'isless' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:322:9: No member named 'islessequal' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:323:9: No member named 'islessgreater' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:324:9: No member named 'isunordered' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:325:9: No member named 'isunordered' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:327:9: No member named 'float_t' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:328:9: No member named 'double_t' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:334:9: No member named 'acos' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:335:9: No member named 'acosf' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:336:9: No member named 'asin' in the global namespace

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:337:9: No member named 'asinf' in the global namespace

    Too many errors emitted, stopping now

  • edited May 2

    A quick search on Google shows those cmath errors have been prevalent on OSX for quite some time. Maybe one of the solutions from Stack Overflow or the Apple developer forums can point you in the right direction.
    https://forums.developer.apple.com/thread/87814

    We do not have any issues using the Swift SDK with our internal apps granted we have only developed iOS apps. It's possible the Swift SDK is not properly configured for watchOS builds, or may not even work due to its dependency on native code.

  • Ok, well, it seems that for now the library is incompatible with the Apple Watch. I can confirm that CoreBluetooth code in general works on Apple Watch 3 and I've connected to two different BLE peripherals. It will be nice if there is a compatible MetaWear library at some point. Thanks.

  • Just an update, I was able to edit and rebuild the Metawear API to be compatible with the Apple Watch. CoreBluetooth is identical between iOS and Watch OS, so it's the other compatibility issues that are the real problem. It would be nice to get an official release at some point from MetaWear.

Sign In or Register to comment.