已比較的版本

索引鍵

  • 此行已新增。
  • 此行已移除。
  • 格式已變更。

Introduction

We build up the medical IoT platform called OmniCare, collecting different kinds of vital signs data from our partners’ devices, in order to be more convenient for third party integration with their application we have developed the OmniCare SDK.

...

It can easy to communicate with ASUS VivoWatch BP, such as create a connection channel, connect device, upload device vital signs data to OmniCare and retrieve the vital signs data back from OmniCare.

System Requirements

Xcode version: 11.3.1+

Target OS: iOS 11.0+

How it works

See the sequence diagram below, it shows how does OmniCare SDK work.

...


Getting Started

Adding the OmniCare SDK to an Xcode Project

The OmniCare SDK is distributed as framework. To add it to your project, please follow the steps below:

...

  1. On the Capabilities tab, in the Background Modes section, click the switch to turn it on. Enable Bluetooth LE accessories option.


How to use the OmniCare SDK

Before using the OmniCare SDK, you need to initialize it first. AsusLifeOmniCare.initialize()must be added to all entry point Controllers.

AsusLifeOmniCare.initialize(account, password, completionHandler: { error in


if let error = error{

// The initializing fails.

return

}

// The initializing process completes successfully.


...

})

Device Communication

Finding OmniCare Devices

The first step is finding a OmniCare device to communicate with. To do this use the DeviceManager to set the delegate and initiate scanning as shown in the code snippet below. The same device can be reported more than once.

extension ScannedDeviceViewController: AsusLifeDeviceScanDelegate{



func onScanStarted() {

// Called when Bluetooth Low Energy start to scan.

}

func onScanFailed(error: Error) {

// Called when Bluetooth Low Energy scan failed.

}

func onScanFinished() {

// Called when Bluetooth Low Energy scan finished.

}

func onScannedDevice(device: ScannedDevice) {

// Called when a OmniCare Device advertisement has been found.

}

...

}



let deviceMgr = AsusLifeOmniCare.getDeviceManager()

deviceMgr?.addScanDelegate(self)

deviceMgr?.startScan()


...


Pairing a Device

Attempt to pair a scanned device returned from BLE scanning in the SDK.

extension ScannedDeviceViewController: PairingDelegate{



func pairingFailed(error: Error) {

// Called if pairing fails.

}

func pairingSucceeded(device: Device) {

// Called when the pairing process completes successfully.

}

...

}


...


let deviceMgr = AsusLifeOmniCare.getDeviceManager()

deviceMgr?.addPairingDelegate(self)

deviceMgr?.requestDevicePair(scannedDevice)


...


Syncing & Uploading Data

As the device has been paired, using the method below to sync the vital signs data from device and upload the data to OmniCare.

extension PairedDeviceViewController: SyncingDelegate{



func onSyncComplete(device: Device) {

// Called when the syncing process completes successfully.

}

func onSyncFailed(device: Device, error: Error) {

// Called if syncing fails.

}

func onSyncStarted(device: Device) {

// Called if syncing starts.

}

...

}


...


let deviceMgr = AsusLifeOmniCare.getDeviceManager()

deviceMgr?.addSyncingDelegate(self)

deviceMgr?.requestDeviceSync(device)


...


Vital Signs Data Integration

Through OmniCare Platform

After the device syncing is successful, using method below to request vital signs data from OmniCare.

OmniCareAPI.getDataByDevcie(device, time, endTime, completionHandler: { syncResult, error in


if let error = error{

// The data requesting fails.

return

}

// The data requesting process completes successfully.

...

}


Release Notes

V1.4.0(March 2020)

1.Modified GetTokenResponse model(removed sguri).

...

V1.0.0(July 2019)

1.New release.

Reference

Please see docs for more information.

...