OmniCare SDK (For iOS)
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 the supported devices, 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: 13+
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:
Select your project Target and go to the General tab
In the Embedded Binaries section, click + and then Add Other. Locate and select the following frameworks:
OmniCareSDK.framework
companion.framework
SQLite.framework
SQLCipher.framework
And then, add them with the 'Copy item if needed' and 'Create groups' options.
Additionally, make these changes:
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. Add a call to AsusLifeOmniCare.initialize() in the didFinishLaunchingWithOptions method of the AppDelegate class or some other entry points of ViewControllers. (If you gonna build with Garmin devices, please be sure to pass the license key to the init method)
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.10.1(Aug 2022)
Bug fixes.
V1.10.0(May 2022)
Support query local DB.
Bug fixes and performance improvements.
v1.9.0(April 2022)
Added support for ASUSVivoWatchSP, ASUSVivoWatch5.
Support for XCFrameworks.
V1.6.0(August 2020)
1.In order to ensure the stability of data retrieval, we have established a local database. When the server is abnormal, the data will be returned from the local database.
V1.5.0(July 2020)
1.Added support for VivoSmart 4.
V1.4.1(May 2020)
1.Updated SSL Pinning.
V1.4.0(March 2020)
1.Modified GetTokenResponse model(removed sguri).
2.Modified OmniCareECGData model.
3.Added OmniCarePPGData model.
4.Exporting ECG, PPG data from ASUS VivoWatch BP.
V1.3.0(January 2020)
1.Revised the sleep data format.(ASUS VivoWatch BP)
2.Added the location data model and ASUS VivoWatch BP exercise mode data paring.
V1.2.0(December 2019)
1.New feature
Added notification setting options to VivoWatch BP
V1.1.0(December 2019)
1.New feature
FW update
Pill reminder
Frequency of checks setting
V1.0.2(November 2019)
1.Support for Xcode 11.2 and Swift 5.1.2
V1.0.1(October 2019)
1.Support for Xcode 11 and Swift 5.1
2.Bitcode enabled
3.Fine-tuned pairing flow
4.Removed x86_64 architecture
V1.0.0(July 2019)
1.New release.