Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

...

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.0(May 2022)

  1. Support query local DB.

  2. Bug fixes and performance improvements.

 

v1.9.0(April 2022)

  1. Added support for ASUSVivoWatchSP, ASUSVivoWatch5.

  2. 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.

...

Please see docs for more information.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

...

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)

...