Skip to content

xprl-gjf/MetaWear-SDK-iOS-macOS-tvOS

 
 

Repository files navigation

MetaWear SDK for iOS/OS X/tvOS by MBIENTLAB

Platforms License Version

Build Status Codecov

alt tag

Overview

MetaWear is a complete development and production platform for wearable and connected device applications.

MetaWear features a number of sensors and peripherals all easily controllable over Bluetooth 4.0 Low Energy using this SDK, no firmware or hardware experience needed!

The MetaWear hardware comes pre-loaded with a wirelessly upgradeable firmware, so it keeps getting more powerful over time.

Requirements

REQUIREMENT NOTES
The iOS simulator doesn’t support Bluetooth 4.0, so test apps must be run on a real iOS device which requires a developer account. Bluetooth 4.0 available on iPhone 4S+, iPad 3rd generation+, or iPod Touch 5th generation.

License

See the License

Support

Reach out to the community if you encounter any problems, or just want to chat :)

Getting Started

Installation

MetaWear is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "MetaWear"

For first time CocoaPods users we have a detailed video guide.

Simple API Test

Here is a walkthrough to showcase a very basic connect and toggle LED operation.

First, import the framework header files like this:

import MetaWear

Then add the following code wherever appropriate to make the LED flash green:

MBLMetaWearManager.shared().startScanForMetaWears() { array in
    // Hooray! We found a MetaWear board, so stop scanning for more
    MBLMetaWearManager.shared().stopScan()
    // Connect to the board we found
    if let device = array.first {
        device.connectAsync().success() { _ in
            // Hooray! We connected to a MetaWear board, so flash its LED!
            device.led?.flashColorAsync(UIColor.green, withIntensity: 0.5)
        }.failure() { error in
            // Sorry we couldn't connect
            print(error)
        }
    }
}

Now run the app!

BLUETOOTH IS NOT SUPPORTED IN THE SIMULATOR but we do include a simulated MetaWear for use with basic testing, however, it does not have all the features of a real MetaWear.

Sample iOS App

We have a sample iOS App on the App Store and the source can be found on our GitHub Page.

The sample iOS App demonstrates the base functionality of the various MetaWear modules and serves as a good starting point for developers.

API Documentation

See the iOS Guide

About

MetaWear Obj-C / Swift SDK for iOS/macOS/tvOS by MBIENTLAB

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 95.7%
  • C 3.0%
  • Other 1.3%