Skip to content

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
JOikarinen committed Feb 11, 2021
1 parent d47e30a commit 34dd918
Showing 1 changed file with 39 additions and 45 deletions.
84 changes: 39 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This SDK uses ReactiveX. You can read more about ReactiveX from their website [r

By exploiting the SDK, you indicate your acceptance of [License](Polar_SDK_License.txt).

If you wish to collaborate with Polar commercially, [click here](http://polar.com/developers)
If you wish to collaborate with Polar commercially, [click here](https://polar.com/developers)

### Quick License Summary / Your rights to use the SDK
You may use, copy and modify the SDK as long as you
Expand All @@ -31,6 +31,19 @@ Most accurate Heart rate sensor in the markets. The H10 is used in the Getting s
* Start and stop of internal recording and request for internal recording status. Recording supports RR, HR with one second sampletime or HR with five second sampletime.
* List, read and remove for stored internal recording (sensor supports only one recording at the time).

### Polar Verity Sense Optical heart rate sensor
Optical heart rate sensor is a rechargeable device that measures user’s heart rate with LED technology.
[Store page](https://www.polar.com/en/products/accessories/polar-verity-sense)

#### Polar Verity Sense Optical heart rate sensor available data types
* From version 1.0.0 onwards.
* Heart rate as beats per minute.
* Photoplethysmograpy (PPG) values.
* PP interval (milliseconds) representing cardiac pulse-to-pulse interval extracted from PPG signal.
* Accelerometer data with sample rate of 52Hz and range of 8G. Axis specific acceleration data in mG.
* Gyroscope data with sample rate of 52Hz and ranges of 250dps, 500dps, 1000dps and 2000dps. Axis specific gyroscope data in dps.
* Magnetometer data with sample rates of 10Hz, 20Hz, 50HZ and 100Hz and range of +/-50 Gauss. Axis specific magnetometer data in Gauss.
* List, read and remove stored exercise. Recording of exercise requires that sensor is registered to Polar Flow account.

### OH1 Optical heart rate sensor
Optical heart rate sensor is a rechargeable device that measures user’s heart rate with LED technology.
Expand Down Expand Up @@ -116,34 +129,33 @@ This is not required if you are using automatic connection.

1. Import following packages.
```
import io.reactivex.CompletableObserver;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Action;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.Function;
import polar.com.sdk.api.PolarBleApi;
import polar.com.sdk.api.PolarBleApiCallback;
import polar.com.sdk.api.PolarBleApiDefaultImpl;
import polar.com.sdk.api.errors.PolarInvalidArgument;
import polar.com.sdk.api.model.PolarAccelerometerData;
import polar.com.sdk.api.model.PolarDeviceInfo;
import polar.com.sdk.api.model.PolarEcgData;
import polar.com.sdk.api.model.PolarExerciseData;
import polar.com.sdk.api.model.PolarExerciseEntry;
import polar.com.sdk.api.model.PolarHrBroadcastData;
import polar.com.sdk.api.model.PolarGyroData;
import polar.com.sdk.api.model.PolarHrData;
import polar.com.sdk.api.model.PolarOhrPPGData;
import polar.com.sdk.api.model.PolarMagnetometerData;
import polar.com.sdk.api.model.PolarOhrData;
import polar.com.sdk.api.model.PolarOhrPPIData;
import polar.com.sdk.api.model.PolarSensorSetting;
```

2. Load the default api implementation and add callback.
```
// NOTICE only FEATURE_HR is enabled, to enable more features like battery info
// NOTICE all features are enabled, if only interested on particular feature(s) like info Heart rate and Battery info then
// e.g. PolarBleApiDefaultImpl.defaultImplementation(this, PolarBleApi.FEATURE_HR |
// PolarBleApi.FEATURE_BATTERY_INFO);
// batteryLevelReceived callback is invoked after connection
PolarBleApi api = PolarBleApiDefaultImpl.defaultImplementation(this, PolarBleApi.FEATURE_HR);
PolarBleApi api = PolarBleApiDefaultImpl.defaultImplementation(this, PolarBleApi.ALL_FEATURES);
api.setApiCallback(new PolarBleApiCallback() {
@Override
Expand All @@ -152,47 +164,35 @@ api.setApiCallback(new PolarBleApiCallback() {
}
@Override
public void polarDeviceConnected(PolarDeviceInfo polarDeviceInfo) {
public void deviceConnected(PolarDeviceInfo polarDeviceInfo) {
Log.d("MyApp","CONNECTED: " + polarDeviceInfo.deviceId);
}
@Override
public void polarDeviceConnecting(PolarDeviceInfo polarDeviceInfo) {
public void deviceConnecting(PolarDeviceInfo polarDeviceInfo) {
Log.d("MyApp","CONNECTING: " + polarDeviceInfo.deviceId);
}
@Override
public void polarDeviceDisconnected(PolarDeviceInfo polarDeviceInfo) {
public void deviceDisconnected(PolarDeviceInfo polarDeviceInfo) {
Log.d("MyApp","DISCONNECTED: " + polarDeviceInfo.deviceId);
}
@Override
public void ecgFeatureReady(String identifier) {
}
@Override
public void accelerometerFeatureReady(String identifier) {
}
@Override
public void ppgFeatureReady(String identifier) {
}
@Override
public void ppiFeatureReady(String identifier) {
}
@Override
public void biozFeatureReady(String identifier) {
}
public void streamingFeaturesReady(@NonNull final String identifier,
@NonNull final Set<PolarBleApi.DeviceStreamingFeature> features) {
for(PolarBleApi.DeviceStreamingFeature feature : features) {
Log.d("MyApp", "Streaming feature " + feature.toString() + " is ready");
}
}
@Override
public void hrFeatureReady(String identifier) {
Log.d("MyApp","HR READY: " + identifier);
}
@Override
public void fwInformationReceived(String identifier, String fwVersion) {
public void disInformationReceived(String identifier, UUID uuid, String value) {
}
@Override
Expand Down Expand Up @@ -317,13 +317,10 @@ class MyController: UIViewController,
print("HR READY")
}
func ecgFeatureReady(_ identifier: String) {
}
func accFeatureReady(_ identifier: String) {
}
func ohrPPGFeatureReady(_ identifier: String) {
func streamingFeaturesReady(_ identifier: String, streamingFeatures: Set<DeviceStreamingFeature>) {
for feature in streamingFeatures {
print("Feature \(feature) is ready.")
}
}
func blePowerOn() {
Expand All @@ -333,10 +330,7 @@ class MyController: UIViewController,
func blePowerOff() {
print("BLE OFF")
}
func ohrPPIFeatureReady(_ identifier: String) {
}
func ftpFeatureReady(_ identifier: String) {
}
}
Expand Down

0 comments on commit 34dd918

Please sign in to comment.