From 3364e9724da1a478cbdfa3086defbb31cad2e2a2 Mon Sep 17 00:00:00 2001 From: Erkki Silvola Date: Mon, 30 Sep 2019 12:20:44 +0300 Subject: [PATCH] updated ios, watchOs and android sdk --- README.md | 4 +- .../polar/com/androidblesdk/MainActivity.java | 2 +- .../polarBleSdkTestApp/ViewController.swift | 3 +- .../docs/html/BDBleApiImpl_8java_source.html | 143 ++--- .../docs/html/PolarBiozData_8java_source.html | 5 +- .../PolarBleApiCallbackProvider_8java.html | 97 ++++ ...arBleApiCallbackProvider_8java_source.html | 103 ++++ .../PolarBleApiCallback_8java_source.html | 3 +- .../PolarBleApiDefaultImpl_8java_source.html | 2 +- .../docs/html/PolarBleApi_8java_source.html | 8 +- .../html/PolarOhrPPGData_8java_source.html | 8 +- polar-sdk-android/docs/html/annotated.html | 7 +- polar-sdk-android/docs/html/classes.html | 18 +- ...r_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html | 12 +- ...lar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.js | 2 +- ..._1_1sdk_1_1api_1_1PolarBleApiCallback.html | 37 ++ ...m_1_1sdk_1_1api_1_1PolarBleApiCallback.png | Bin 0 -> 1053 bytes ...1sdk_1_1api_1_1model_1_1PolarBiozData.html | 36 +- ...1_1sdk_1_1api_1_1model_1_1PolarBiozData.js | 3 +- ..._1_1api_1_1model_1_1PolarExerciseData.html | 2 +- ...dk_1_1api_1_1model_1_1PolarOhrPPGData.html | 8 +- ...1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html | 132 ++--- ...r_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.js | 4 +- .../dir_b936df1acb3136008a04b697d550213c.html | 2 + polar-sdk-android/docs/html/files.html | 35 +- polar-sdk-android/docs/html/files_dup.js | 3 + polar-sdk-android/docs/html/functions.html | 25 +- .../docs/html/functions_func.html | 20 +- .../docs/html/functions_vars.html | 5 +- polar-sdk-android/docs/html/hierarchy.html | 31 +- polar-sdk-android/docs/html/hierarchy.js | 4 +- ...1_1api_1_1PolarBleApiCallbackProvider.html | 537 ++++++++++++++++++ ...k_1_1api_1_1PolarBleApiCallbackProvider.js | 17 + ..._1_1api_1_1PolarBleApiCallbackProvider.png | Bin 0 -> 1052 bytes .../namespacepolar_1_1com_1_1sdk_1_1api.html | 2 + .../namespacepolar_1_1com_1_1sdk_1_1api.js | 1 + polar-sdk-android/docs/html/navtreedata.js | 2 +- polar-sdk-android/docs/html/navtreeindex0.js | 110 ++-- polar-sdk-android/docs/html/navtreeindex1.js | 18 + 39 files changed, 1167 insertions(+), 284 deletions(-) create mode 100644 polar-sdk-android/docs/html/PolarBleApiCallbackProvider_8java.html create mode 100644 polar-sdk-android/docs/html/PolarBleApiCallbackProvider_8java_source.html create mode 100644 polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.png create mode 100644 polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html create mode 100644 polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.js create mode 100644 polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.png diff --git a/README.md b/README.md index aec89a30..5fc9c3b5 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Most accurate Heart rate sensor in the markets. The H10 is used in the Getting s [Store page](https://www.polar.com/en/products/accessories/H10_heart_rate_sensor) #### H10 heart rate sensor available data types -* From version 3.0.35 onwards. Available later. +* From version 3.0.35 onwards. * Heart rate as beats per minute. RR Interval in ms and 1/1024 format. * Electrocardiography (ECG) data in µV. Default epoch for timestamp is 1.1.2000 * Accelerometer data with samplerates of 25Hz, 50Hz, 100Hz and 200Hz and range of 2G, 4G and 8G. Axis specific acceleration data in mG. Default epoch for timestamp is 1.1.2000 @@ -37,7 +37,7 @@ Optical heart rate sensor is a rechargeable device that measures user’s heart [Store page](https://www.polar.com/us-en/products/accessories/oh1-optical-heart-rate-sensor) #### OH1 Optical heart rate sensor available data types -* From version 2.0.8 onwards. Available later. +* From version 2.0.8 onwards. * Heart rate as beats per minute. * Photoplethysmograpy (PPG) values. * PP interval (milliseconds) representing cardiac pulse-to-pulse interval extracted from PPG signal. diff --git a/examples/example-android/androidBleSdkTestApp/app/src/main/java/polar/com/androidblesdk/MainActivity.java b/examples/example-android/androidBleSdkTestApp/app/src/main/java/polar/com/androidblesdk/MainActivity.java index f3c4afbf..3f7cc5db 100644 --- a/examples/example-android/androidBleSdkTestApp/app/src/main/java/polar/com/androidblesdk/MainActivity.java +++ b/examples/example-android/androidBleSdkTestApp/app/src/main/java/polar/com/androidblesdk/MainActivity.java @@ -511,7 +511,7 @@ public void run() throws Exception { @SuppressLint("CheckResult") @Override public void onClick(View view) { - api.startRecording(DEVICE_ID,"TEST_APP_ID", PolarBleApi.RecordingInterval.INTERVAL_1S, PolarBleApi.SampleType.HR).subscribe( + api.startRecording(DEVICE_ID,"TEST_APP_ID", PolarBleApi.RecordingInterval.INTERVAL_1S, PolarBleApi.SampleType.RR).subscribe( new Action() { @Override public void run() throws Exception { diff --git a/examples/example-ios/polarBleSdkTestApp/ViewController.swift b/examples/example-ios/polarBleSdkTestApp/ViewController.swift index aa8b46b0..853f180f 100644 --- a/examples/example-ios/polarBleSdkTestApp/ViewController.swift +++ b/examples/example-ios/polarBleSdkTestApp/ViewController.swift @@ -33,6 +33,7 @@ class ViewController: UIViewController, api.powerStateObserver = self api.deviceFeaturesObserver = self api.logger = self + api.cccWriteObserver = self api.polarFilter(false) NSLog("\(PolarBleApiDefaultImpl.versionInfo())") } @@ -241,7 +242,7 @@ class ViewController: UIViewController, } @IBAction func startH10Recording(_ sender: Any) { - _ = api.startRecording(deviceId, exerciseId: "TEST_APP_ID", interval: .interval_1s, sampleType: .hr).observeOn(MainScheduler.instance).subscribe{ e in + _ = api.startRecording(deviceId, exerciseId: "TEST_APP_ID", interval: .interval_1s, sampleType: .rr).observeOn(MainScheduler.instance).subscribe{ e in switch e { case .completed: NSLog("recording started") diff --git a/polar-sdk-android/docs/html/BDBleApiImpl_8java_source.html b/polar-sdk-android/docs/html/BDBleApiImpl_8java_source.html index 12ddb36a..0fdfd9b7 100644 --- a/polar-sdk-android/docs/html/BDBleApiImpl_8java_source.html +++ b/polar-sdk-android/docs/html/BDBleApiImpl_8java_source.html @@ -66,116 +66,117 @@
BDBleApiImpl.java
-Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.impl;
3 
4 import android.annotation.SuppressLint;
5 import android.bluetooth.le.ScanFilter;
6 import android.content.Context;
7 import android.os.Build;
8 import android.os.ParcelUuid;
9 import android.support.annotation.Nullable;
10 import android.util.Log;
11 import android.util.Pair;
12 
13 import com.androidcommunications.polar.api.ble.BleDeviceListener;
14 import com.androidcommunications.polar.api.ble.BleLogger;
15 import com.androidcommunications.polar.api.ble.exceptions.BleDisconnected;
16 import com.androidcommunications.polar.api.ble.model.BleDeviceSession;
17 import com.androidcommunications.polar.api.ble.model.advertisement.BleAdvertisementContent;
18 import com.androidcommunications.polar.api.ble.model.advertisement.BlePolarHrAdvertisement;
19 import com.androidcommunications.polar.api.ble.model.gatt.BleGattBase;
20 import com.androidcommunications.polar.api.ble.model.gatt.client.BleBattClient;
21 import com.androidcommunications.polar.api.ble.model.gatt.client.BleDisClient;
22 import com.androidcommunications.polar.api.ble.model.gatt.client.BleHrClient;
23 import com.androidcommunications.polar.api.ble.model.gatt.client.BlePMDClient;
24 import com.androidcommunications.polar.api.ble.model.gatt.client.psftp.BlePsFtpClient;
25 import com.androidcommunications.polar.api.ble.model.gatt.client.psftp.BlePsFtpUtils;
26 import com.androidcommunications.polar.common.ble.BleUtils;
27 import com.androidcommunications.polar.enpoints.ble.bluedroid.host.BDDeviceListenerImpl;
28 
29 import org.reactivestreams.Publisher;
30 
31 import java.io.ByteArrayOutputStream;
32 import java.text.SimpleDateFormat;
33 import java.util.ArrayList;
34 import java.util.Calendar;
35 import java.util.Collections;
36 import java.util.Comparator;
37 import java.util.Date;
38 import java.util.HashMap;
39 import java.util.HashSet;
40 import java.util.List;
41 import java.util.Locale;
42 import java.util.Map;
43 import java.util.Set;
44 import java.util.UUID;
45 import java.util.concurrent.TimeUnit;
46 import java.util.concurrent.atomic.AtomicInteger;
47 
48 import fi.polar.remote.representation.protobuf.ExerciseSamples;
49 import fi.polar.remote.representation.protobuf.Types;
50 import io.reactivex.Completable;
51 import io.reactivex.CompletableEmitter;
52 import io.reactivex.CompletableOnSubscribe;
53 import io.reactivex.CompletableSource;
54 import io.reactivex.Flowable;
55 import io.reactivex.Scheduler;
56 import io.reactivex.Single;
57 import io.reactivex.SingleSource;
58 import io.reactivex.android.schedulers.AndroidSchedulers;
59 import io.reactivex.disposables.Disposable;
60 import io.reactivex.functions.Action;
61 import io.reactivex.functions.BiFunction;
62 import io.reactivex.functions.Consumer;
63 import io.reactivex.functions.Function;
64 import io.reactivex.functions.Predicate;
65 import io.reactivex.schedulers.Timed;
66 import polar.com.sdk.api.PolarBleApi;
85 import protocol.PftpNotification;
86 import protocol.PftpRequest;
87 import protocol.PftpResponse;
88 
92 public class BDBleApiImpl extends PolarBleApi {
93  protected final static String TAG = BDBleApiImpl.class.getSimpleName();
94  protected BleDeviceListener listener;
95  protected Map<String,Disposable> connectSubscriptions = new HashMap<>();
96  protected Scheduler scheduler;
99  protected static final int ANDROID_VERSION_O = 26;
100  BleDeviceListener.BleSearchPreFilter filter = new BleDeviceListener.BleSearchPreFilter() {
101  @Override
102  public boolean process(BleAdvertisementContent content) {
103  return content.getPolarDeviceId().length() != 0 && !content.getPolarDeviceType().equals("mobile");
104  }
105  };
106 
107  @SuppressLint({"NewApi", "CheckResult"})
108  public BDBleApiImpl(final Context context, int features) {
109  super(features);
110  Set<Class<? extends BleGattBase>> clients = new HashSet<>();
111  if((this.features & PolarBleApi.FEATURE_HR)!=0){
112  clients.add(BleHrClient.class);
113  }
114  if((this.features & PolarBleApi.FEATURE_DEVICE_INFO)!=0){
115  clients.add(BleDisClient.class);
116  }
117  if((this.features & PolarBleApi.FEATURE_BATTERY_INFO)!=0){
118  clients.add(BleBattClient.class);
119  }
120  if((this.features & PolarBleApi.FEATURE_POLAR_SENSOR_STREAMING)!=0){
121  clients.add(BlePMDClient.class);
122  }
123  if((this.features & PolarBleApi.FEATURE_POLAR_FILE_TRANSFER)!=0){
124  clients.add(BlePsFtpClient.class);
125  }
126  listener = new BDDeviceListenerImpl(context, clients);
127  listener.setScanPreFilter(filter);
128  scheduler = AndroidSchedulers.from(context.getMainLooper());
129  listener.monitorDeviceSessionState(null).observeOn(scheduler).subscribe(
130  new Consumer<Pair<BleDeviceSession, BleDeviceSession.DeviceSessionState>>() {
131  @Override
132  public void accept(Pair<BleDeviceSession, BleDeviceSession.DeviceSessionState> pair) throws Exception {
133  PolarDeviceInfo info = new PolarDeviceInfo(
134  pair.first.getPolarDeviceId().length() != 0 ?
135  pair.first.getPolarDeviceId() : pair.first.getAddress(),
136  pair.first.getAddress(),
137  pair.first.getRssi(),pair.first.getName(),true);
138  switch (pair.second){
139  case SESSION_OPEN:
140  if(callback!=null){
142  }
143  setupDevice(pair.first);
144  break;
145  case SESSION_CLOSED:
146  if( callback != null ) {
147  if (pair.first.getPreviousState() == BleDeviceSession.DeviceSessionState.SESSION_OPEN ||
148  pair.first.getPreviousState() == BleDeviceSession.DeviceSessionState.SESSION_CLOSING){
150  }
151  }
152  break;
153  case SESSION_OPENING:
154  if(callback != null){
156  }
157  break;
158  }
159  }
160  },
161  new Consumer<Throwable>() {
162  @Override
163  public void accept(Throwable throwable) throws Exception {
164  logError(throwable.getMessage());
165  }
166  },
167  new Action() {
168  @Override
169  public void run() throws Exception {
170 
171  }
172  }
173  );
174  listener.monitorBleState().observeOn(scheduler).subscribe(
175  new Consumer<Boolean>() {
176  @Override
177  public void accept(Boolean aBoolean) throws Exception {
178  if(callback != null){
179  callback.blePowerStateChanged(aBoolean);
180  }
181  }
182  },
183  new Consumer<Throwable>() {
184  @Override
185  public void accept(Throwable throwable) throws Exception {
186  logError(throwable.getMessage());
187  }
188  },
189  new Action() {
190  @Override
191  public void run() throws Exception {
192 
193  }
194  }
195  );
196  BleLogger.setLoggerInterface(new BleLogger.BleLoggerInterface() {
197  @Override
198  public void d(String tag, String msg) {
199  log(tag+"/"+msg);
200  }
201 
202  @Override
203  public void e(String tag, String msg) {
204  logError(tag+"/"+msg);
205  }
206 
207  @Override
208  public void w(String tag, String msg) {
209  }
210 
211  @Override
212  public void i(String tag, String msg) {
213  }
214  });
215  }
216 
217  @SuppressLint("NewApi")
218  protected void enableAndroidScanFilter() {
219  if (Build.VERSION.SDK_INT >= ANDROID_VERSION_O) {
220  List<ScanFilter> filter = new ArrayList<>();
221  filter.add(new ScanFilter.Builder().setServiceUuid(
222  ParcelUuid.fromString(BleHrClient.HR_SERVICE.toString())).build());
223  filter.add(new ScanFilter.Builder().setServiceUuid(
224  ParcelUuid.fromString(BlePsFtpUtils.RFC77_PFTP_SERVICE.toString())).build());
225  listener.setScanFilters(filter);
226  }
227  }
228 
229  @Override
230  public void shutDown() {
231  listener.shutDown();
232  }
233 
234  @Override
235  public void cleanup() {
236  listener.removeAllSessions();
237  }
238 
239  @Override
240  public void setPolarFilter(boolean enable) {
241  if(!enable) {
242  listener.setScanPreFilter(null);
243  } else {
244  listener.setScanPreFilter(filter);
245  }
246  }
247 
248  @Override
249  public boolean isFeatureReady(final String deviceId, int feature) {
250  try {
251  switch (feature) {
253  return sessionPsFtpClientReady(deviceId) != null;
255  return sessionPmdClientReady(deviceId) != null;
256  }
257  } catch (Throwable ignored) {
258  }
259  return false;
260  }
261 
262  @Override
264  this.callback = callback;
266  }
267 
268  @Override
269  public void setApiLogger(@Nullable PolarBleApiLogger logger) {
270  this.logger = logger;
271  }
272 
273  @Override
274  public void setAutomaticReconnection(boolean disable) {
275  listener.setAutomaticReconnection(disable);
276  }
277 
278  @Override
279  public Completable setLocalTime(String identifier, Calendar cal) {
280  try {
281  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
282  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
283  PftpRequest.PbPFtpSetLocalTimeParams.Builder builder = PftpRequest.PbPFtpSetLocalTimeParams.newBuilder();
284  Types.PbDate date = Types.PbDate.newBuilder()
285  .setYear(cal.get(Calendar.YEAR))
286  .setMonth(cal.get(Calendar.MONTH) + 1)
287  .setDay(cal.get(Calendar.DAY_OF_MONTH)).build();
288  Types.PbTime time = Types.PbTime.newBuilder()
289  .setHour(cal.get(Calendar.HOUR_OF_DAY))
290  .setMinute(cal.get(Calendar.MINUTE))
291  .setSeconds(cal.get(Calendar.SECOND))
292  .setMillis(cal.get(Calendar.MILLISECOND)).build();
293  builder.setDate(date).setTime(time).setTzOffset((int) TimeUnit.MINUTES.convert(cal.get(Calendar.ZONE_OFFSET), TimeUnit.MILLISECONDS));
294  return client.query(PftpRequest.PbPFtpQuery.SET_LOCAL_TIME_VALUE,builder.build().toByteArray()).toObservable().ignoreElements();
295  } catch (Throwable error){
296  return Completable.error(error);
297  }
298  }
299 
300  @Override
301  public Single<PolarSensorSetting> requestAccSettings(String identifier) {
302  return querySettings(identifier,BlePMDClient.PmdMeasurementType.ACC);
303  }
304 
305  @Override
306  public Single<PolarSensorSetting> requestEcgSettings(String identifier) {
307  return querySettings(identifier,BlePMDClient.PmdMeasurementType.ECG);
308  }
309 
310  @Override
311  public Single<PolarSensorSetting> requestPpgSettings(String identifier) {
312  return querySettings(identifier,BlePMDClient.PmdMeasurementType.PPG);
313  }
314 
315  @Override
316  public Single<PolarSensorSetting> requestBiozSettings(final String identifier){
317  return querySettings(identifier,BlePMDClient.PmdMeasurementType.BIOZ);
318  }
319 
320  protected Single<PolarSensorSetting> querySettings(final String identifier, final BlePMDClient.PmdMeasurementType type) {
321  try {
322  final BleDeviceSession session = sessionPmdClientReady(identifier);
323  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
324  return client.querySettings(type).map(new Function<BlePMDClient.PmdSetting, PolarSensorSetting>() {
325  @Override
326  public PolarSensorSetting apply(BlePMDClient.PmdSetting setting) throws Exception {
327  return new PolarSensorSetting(setting.settings, type);
328  }
329  });
330  } catch (Throwable e){
331  return Single.error(e);
332  }
333  }
334 
335  @Override
336  public void backgroundEntered() {
338  }
339 
340  @Override
341  public void foregroundEntered() {
342  listener.setScanFilters(null);
343  }
344 
345  @Override
346  public Completable autoConnectToDevice(final int rssiLimit, final String service, final int timeout, final TimeUnit unit, final String polarDeviceType) {
347  final long[] start = {0};
348  return Completable.create(new CompletableOnSubscribe() {
349  @Override
350  public void subscribe(CompletableEmitter emitter) throws Exception {
351  if( service == null || service.matches("([0-9a-fA-F]{4})") ) {
352  emitter.onComplete();
353  } else {
354  emitter.tryOnError(new PolarInvalidArgument("Invalid service string format"));
355  }
356  }
357  }).andThen(listener.search(false).filter(new Predicate<BleDeviceSession>() {
358  @Override
359  public boolean test(BleDeviceSession bleDeviceSession) throws Exception {
360  if( bleDeviceSession.getMedianRssi() >= rssiLimit &&
361  bleDeviceSession.isConnectableAdvertisement() &&
362  (polarDeviceType == null || polarDeviceType.equals(bleDeviceSession.getPolarDeviceType())) &&
363  (service == null || bleDeviceSession.getAdvertisementContent().containsService(service)) ) {
364  if(start[0] == 0){
365  start[0] = System.currentTimeMillis();
366  }
367  return true;
368  }
369  return false;
370  }
371  }).timestamp().takeUntil(new Predicate<Timed<BleDeviceSession>>() {
372  @Override
373  public boolean test(Timed<BleDeviceSession> bleDeviceSessionTimed) throws Exception {
374  long diff = bleDeviceSessionTimed.time(TimeUnit.MILLISECONDS) - start[0];
375  return (diff >= unit.toMillis(timeout));
376  }
377  }).reduce(new HashSet<BleDeviceSession>(), new BiFunction<Set<BleDeviceSession>, Timed<BleDeviceSession>, Set<BleDeviceSession>>() {
378  @Override
379  public Set<BleDeviceSession> apply(Set<BleDeviceSession> objects, Timed<BleDeviceSession> bleDeviceSessionTimed) throws Exception {
380  objects.add(bleDeviceSessionTimed.value());
381  return objects;
382  }
383  }).doOnSuccess(new Consumer<Set<BleDeviceSession>>() {
384  @Override
385  public void accept(Set<BleDeviceSession> set) throws Exception {
386  List<BleDeviceSession> list = new ArrayList<>(set);
387  Collections.sort(list, new Comparator<BleDeviceSession>() {
388  @Override
389  public int compare(BleDeviceSession o1, BleDeviceSession o2) {
390  return o1.getRssi() > o2.getRssi() ? -1 : 1;
391  }
392  });
393  listener.openSessionDirect(list.get(0));
394  log("auto connect search complete");
395  }
396  }).toObservable().ignoreElements());
397  }
398 
399  @Override
400  public Completable autoConnectToDevice(final int rssiLimit, final String service, final String polarDeviceType) {
401  return autoConnectToDevice(rssiLimit, service, 2, TimeUnit.SECONDS, polarDeviceType);
402  }
403 
404  @Override
405  public void connectToDevice(final String identifier) throws PolarInvalidArgument {
406  BleDeviceSession session = fetchSession(identifier);
407  if( session == null || session.getSessionState() == BleDeviceSession.DeviceSessionState.SESSION_CLOSED ){
408  if( connectSubscriptions.containsKey(identifier) ){
409  connectSubscriptions.get(identifier).dispose();
410  connectSubscriptions.remove(identifier);
411  }
412  if( session != null ){
413  listener.openSessionDirect(session);
414  } else {
415  connectSubscriptions.put(identifier, listener.search(false).filter(new Predicate<BleDeviceSession>() {
416  @Override
417  public boolean test(BleDeviceSession bleDeviceSession) throws Exception {
418  return identifier.contains(":") ?
419  bleDeviceSession.getAddress().equals(identifier) :
420  bleDeviceSession.getPolarDeviceId().equals(identifier);
421  }
422  }).take(1).observeOn(scheduler).subscribe(
423  new Consumer<BleDeviceSession>() {
424  @Override
425  public void accept(BleDeviceSession bleDeviceSession) throws Exception {
426  listener.openSessionDirect(bleDeviceSession);
427  }
428  },
429  new Consumer<Throwable>() {
430  @Override
431  public void accept(Throwable throwable) throws Exception {
432  logError(throwable.getMessage());
433  }
434  },
435  new Action() {
436  @Override
437  public void run() throws Exception {
438  log("connect search complete");
439  }
440  }
441  ));
442  }
443  }
444  }
445 
446  @Override
447  public void disconnectFromDevice(String identifier) throws PolarInvalidArgument {
448  BleDeviceSession session = fetchSession(identifier);
449  if( session != null ){
450  if( session.getSessionState() == BleDeviceSession.DeviceSessionState.SESSION_OPEN ||
451  session.getSessionState() == BleDeviceSession.DeviceSessionState.SESSION_OPENING ||
452  session.getSessionState() == BleDeviceSession.DeviceSessionState.SESSION_OPEN_PARK ) {
453  listener.closeSessionDirect(session);
454  }
455  }
456  if (connectSubscriptions.containsKey(identifier)){
457  connectSubscriptions.get(identifier).dispose();
458  connectSubscriptions.remove(identifier);
459  }
460  }
461 
462  @Override
463  public Completable startRecording(String identifier, String exerciseId, RecordingInterval interval, SampleType type) {
464  try {
465  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
466  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
467  if(session.getPolarDeviceType().equals("H10")) {
468  Types.PbSampleType t = type == SampleType.HR ?
469  Types.PbSampleType.SAMPLE_TYPE_HEART_RATE :
470  Types.PbSampleType.SAMPLE_TYPE_RR_INTERVAL;
471  Types.PbDuration duration = Types.PbDuration.newBuilder().setSeconds(interval.getValue()).build();
472  PftpRequest.PbPFtpRequestStartRecordingParams params = PftpRequest.PbPFtpRequestStartRecordingParams.newBuilder().
473  setSampleDataIdentifier(exerciseId).setSampleType(t).setRecordingInterval(duration).build();
474  return client.query(PftpRequest.PbPFtpQuery.REQUEST_START_RECORDING_VALUE, params.toByteArray()).toObservable().ignoreElements().onErrorResumeNext(new Function<Throwable, CompletableSource>() {
475  @Override
476  public CompletableSource apply(Throwable throwable) throws Exception {
477  return Completable.error(throwable);
478  }
479  });
480  }
481  return Completable.error(new PolarOperationNotSupported());
482  } catch (Throwable error){
483  return Completable.error(error);
484  }
485  }
486 
487  @Override
488  public Completable stopRecording(String identifier) {
489  try {
490  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
491  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
492  if(session.getPolarDeviceType().equals("H10")) {
493  return client.query(PftpRequest.PbPFtpQuery.REQUEST_STOP_RECORDING_VALUE, null).toObservable().ignoreElements().onErrorResumeNext(new Function<Throwable, CompletableSource>() {
494  @Override
495  public CompletableSource apply(Throwable throwable) throws Exception {
496  return Completable.error(handleError(throwable));
497  }
498  });
499  }
500  return Completable.error(new PolarOperationNotSupported());
501  } catch (Throwable error){
502  return Completable.error(error);
503  }
504  }
505 
506  @Override
507  public Single<Pair<Boolean,String>> requestRecordingStatus(String identifier) {
508  try {
509  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
510  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
511  if(session.getPolarDeviceType().equals("H10")) {
512  return client.query(PftpRequest.PbPFtpQuery.REQUEST_RECORDING_STATUS_VALUE, null).map(new Function<ByteArrayOutputStream, Pair<Boolean,String>>() {
513  @Override
514  public Pair<Boolean,String> apply(ByteArrayOutputStream byteArrayOutputStream) throws Exception {
515  PftpResponse.PbRequestRecordingStatusResult result = PftpResponse.PbRequestRecordingStatusResult.parseFrom(byteArrayOutputStream.toByteArray());
516  return new Pair<>(result.getRecordingOn(),result.hasSampleDataIdentifier() ? result.getSampleDataIdentifier() : "");
517  }
518  }).onErrorResumeNext(new Function<Throwable, SingleSource<? extends Pair<Boolean, String>>>() {
519  @Override
520  public SingleSource<? extends Pair<Boolean, String>> apply(Throwable throwable) throws Exception {
521  return Single.error(handleError(throwable));
522  }
523  });
524  }
525  return Single.error(new PolarOperationNotSupported());
526  } catch (Throwable error){
527  return Single.error(error);
528  }
529  }
530 
531  @Override
532  public Flowable<PolarExerciseEntry> listExercises(String identifier) {
533  try{
534  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
535  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
536  switch (session.getPolarDeviceType()) {
537  case "OH1":
538  return fetchRecursively(client, "/U/0/", new FetchRecursiveCondition() {
539  @Override
540  public boolean include(String entry) {
541  return entry.matches("^([0-9]{8})(\\/)") ||
542  entry.matches("^([0-9]{6})(\\/)") ||
543  entry.equals("E/") ||
544  entry.equals("SAMPLES.BPB") ||
545  entry.equals("00/");
546  }
547  }).map(new Function<String, PolarExerciseEntry>() {
548  @Override
549  public PolarExerciseEntry apply(String p) throws Exception {
550  String components[] = p.split("/");
551  SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd HHmmss", Locale.getDefault());
552  Date date = format.parse(components[3] + " " + components[5]);
553  return new PolarExerciseEntry(p, date, components[3] + components[5]);
554  }
555  }).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarExerciseEntry>>() {
556  @Override
557  public Publisher<? extends PolarExerciseEntry> apply(Throwable throwable) throws Exception {
558  return Flowable.error(handleError(throwable));
559  }
560  });
561  case "H10":
562  return fetchRecursively(client, "/", new FetchRecursiveCondition() {
563  @Override
564  public boolean include(String entry) {
565  return entry.endsWith("/") || entry.equals("SAMPLES.BPB");
566  }
567  }).map(new Function<String, PolarExerciseEntry>() {
568  @Override
569  public PolarExerciseEntry apply(String p) throws Exception {
570  String components[] = p.split("/");
571  return new PolarExerciseEntry(p, new Date(), components[1]);
572  }
573  }).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarExerciseEntry>>() {
574  @Override
575  public Publisher<? extends PolarExerciseEntry> apply(Throwable throwable) throws Exception {
576  return Flowable.error(handleError(throwable));
577  }
578  });
579  default:
580  return Flowable.error(new PolarOperationNotSupported());
581  }
582  } catch (Throwable error){
583  return Flowable.error(error);
584  }
585  }
586 
587  @Override
588  public Single<PolarExerciseData> fetchExercise(String identifier, PolarExerciseEntry entry) {
589  try{
590  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
591  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
592  protocol.PftpRequest.PbPFtpOperation.Builder builder = protocol.PftpRequest.PbPFtpOperation.newBuilder();
593  builder.setCommand(PftpRequest.PbPFtpOperation.Command.GET);
594  builder.setPath(entry.path);
595  if(session.getPolarDeviceType().equals("OH1") || session.getPolarDeviceType().equals("H10")) {
596  return client.request(builder.build().toByteArray()).map(new Function<ByteArrayOutputStream, PolarExerciseData>() {
597  @Override
598  public PolarExerciseData apply(ByteArrayOutputStream byteArrayOutputStream) throws Exception {
599  ExerciseSamples.PbExerciseSamples samples = ExerciseSamples.PbExerciseSamples.parseFrom(byteArrayOutputStream.toByteArray());
600  return new PolarExerciseData(samples.getRecordingInterval().getSeconds(), samples.getHeartRateSamplesList());
601  }
602  }).onErrorResumeNext(new Function<Throwable, SingleSource<? extends PolarExerciseData>>() {
603  @Override
604  public SingleSource<? extends PolarExerciseData> apply(Throwable throwable) throws Exception {
605  return Single.error(handleError(throwable));
606  }
607  });
608  }
609  return Single.error(new PolarOperationNotSupported());
610  } catch (Throwable error){
611  return Single.error(error);
612  }
613  }
614 
615  @Override
616  public Completable removeExercise(String identifier, PolarExerciseEntry entry) {
617  try{
618  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
619  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
620  if(session.getPolarDeviceType().equals("OH1")){
621  protocol.PftpRequest.PbPFtpOperation.Builder builder = protocol.PftpRequest.PbPFtpOperation.newBuilder();
622  builder.setCommand(PftpRequest.PbPFtpOperation.Command.GET);
623  final String components[] = entry.path.split("/");
624  final String exerciseParent = "/U/0/" + components[3] + "/E/";
625  builder.setPath(exerciseParent);
626  return client.request(builder.build().toByteArray()).flatMap(new Function<ByteArrayOutputStream, SingleSource<?>>() {
627  @Override
628  public SingleSource<?> apply(ByteArrayOutputStream byteArrayOutputStream) throws Exception {
629  PftpResponse.PbPFtpDirectory directory = PftpResponse.PbPFtpDirectory.parseFrom(byteArrayOutputStream.toByteArray());
630  protocol.PftpRequest.PbPFtpOperation.Builder removeBuilder = protocol.PftpRequest.PbPFtpOperation.newBuilder();
631  removeBuilder.setCommand(PftpRequest.PbPFtpOperation.Command.REMOVE);
632  if( directory.getEntriesCount() <= 1 ){
633  // remove entire directory
634  removeBuilder.setPath("/U/0/" + components[3] + "/");
635  } else {
636  // remove only exercise
637  removeBuilder.setPath("/U/0/" + components[3] + "/E/" + components[5] + "/");
638  }
639  return client.request(removeBuilder.build().toByteArray());
640  }
641  }).toObservable().ignoreElements().onErrorResumeNext(new Function<Throwable, CompletableSource>() {
642  @Override
643  public CompletableSource apply(Throwable throwable) throws Exception {
644  return Completable.error(handleError(throwable));
645  }
646  });
647  } else if(session.getPolarDeviceType().equals("H10")){
648  protocol.PftpRequest.PbPFtpOperation.Builder builder = protocol.PftpRequest.PbPFtpOperation.newBuilder();
649  builder.setCommand(PftpRequest.PbPFtpOperation.Command.REMOVE);
650  builder.setPath(entry.path);
651  return client.request(builder.build().toByteArray()).toObservable().ignoreElements().onErrorResumeNext(new Function<Throwable, CompletableSource>() {
652  @Override
653  public CompletableSource apply(Throwable throwable) throws Exception {
654  return Completable.error(handleError(throwable));
655  }
656  });
657  }
658  return Completable.error(new PolarOperationNotSupported());
659  } catch (Throwable error){
660  return Completable.error(error);
661  }
662  }
663 
664  @Override
665  public Flowable<PolarDeviceInfo> searchForDevice() {
666  return listener.search(false).distinct().map(new Function<BleDeviceSession, PolarDeviceInfo>() {
667  @Override
668  public PolarDeviceInfo apply(BleDeviceSession bleDeviceSession) throws Exception {
669  return new PolarDeviceInfo(bleDeviceSession.getPolarDeviceId(),
670  bleDeviceSession.getAddress(),
671  bleDeviceSession.getRssi(),
672  bleDeviceSession.getName(),
673  bleDeviceSession.isConnectableAdvertisement());
674  }
675  });
676  }
677 
678  @Override
679  public Flowable<PolarHrBroadcastData> startListenForPolarHrBroadcasts(final Set<String> deviceIds) {
680  // set filter to null, NOTE this disables reconnection in background
681  return listener.search(false).filter(new Predicate<BleDeviceSession>() {
682  @Override
683  public boolean test(BleDeviceSession bleDeviceSession) throws Exception {
684  return (deviceIds == null || deviceIds.contains(bleDeviceSession.getPolarDeviceId())) &&
685  bleDeviceSession.getAdvertisementContent().getPolarHrAdvertisement().isPresent();
686  }
687  }).map(new Function<BleDeviceSession, PolarHrBroadcastData>() {
688  @Override
689  public PolarHrBroadcastData apply(BleDeviceSession bleDeviceSession) throws Exception {
690  BlePolarHrAdvertisement advertisement = bleDeviceSession.getBlePolarHrAdvertisement();
691  return new PolarHrBroadcastData( new PolarDeviceInfo(bleDeviceSession.getPolarDeviceId(),
692  bleDeviceSession.getAddress(),
693  bleDeviceSession.getRssi(),
694  bleDeviceSession.getName(),
695  bleDeviceSession.isConnectableAdvertisement()),
696  advertisement.getHrForDisplay(),
697  advertisement.getBatteryStatus() != 0);
698  }
699  });
700  }
701 
702  @Override
703  public Flowable<PolarEcgData> startEcgStreaming(String identifier,
704  PolarSensorSetting setting) {
705  try {
706  final BleDeviceSession session = sessionPmdClientReady(identifier);
707  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
708  return client.startMeasurement(BlePMDClient.PmdMeasurementType.ECG, setting.map2PmdSettings()).andThen(
709  client.monitorEcgNotifications(true).map(new Function<BlePMDClient.EcgData, PolarEcgData>() {
710  @Override
711  public PolarEcgData apply(BlePMDClient.EcgData ecgData) throws Exception {
712  List<Integer> samples = new ArrayList<>();
713  for( BlePMDClient.EcgData.EcgSample s : ecgData.ecgSamples ){
714  samples.add(s.microVolts);
715  }
716  return new PolarEcgData(samples,ecgData.timeStamp);
717  }
718  }).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarEcgData>>() {
719  @Override
720  public Publisher<? extends PolarEcgData> apply(Throwable throwable) throws Exception {
721  return Flowable.error(handleError(throwable));
722  }
723  }).doFinally(new Action() {
724  @Override
725  public void run() throws Exception {
726  stopPmdStreaming(session,client, BlePMDClient.PmdMeasurementType.ECG);
727  }
728  }));
729  } catch (Throwable t){
730  return Flowable.error(t);
731  }
732  }
733 
734  @Override
735  public Flowable<PolarAccelerometerData> startAccStreaming(String identifier,
736  PolarSensorSetting setting) {
737  try {
738  final BleDeviceSession session = sessionPmdClientReady(identifier);
739  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
740  return client.startMeasurement(BlePMDClient.PmdMeasurementType.ACC, setting.map2PmdSettings()).andThen(
741  client.monitorAccNotifications(true).map(new Function<BlePMDClient.AccData, PolarAccelerometerData>() {
742  @Override
743  public PolarAccelerometerData apply(BlePMDClient.AccData accData) throws Exception {
744  List<PolarAccelerometerData.PolarAccelerometerSample> samples = new ArrayList<>();
745  for( BlePMDClient.AccData.AccSample s : accData.accSamples ){
746  samples.add(new PolarAccelerometerData.PolarAccelerometerSample(s.x,s.y,s.z));
747  }
748  return new PolarAccelerometerData(samples,accData.timeStamp);
749  }
750  }).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarAccelerometerData>>() {
751  @Override
752  public Publisher<? extends PolarAccelerometerData> apply(Throwable throwable) throws Exception {
753  return Flowable.error(handleError(throwable));
754  }
755  }).doFinally(new Action() {
756  @Override
757  public void run() throws Exception {
758  stopPmdStreaming(session,client, BlePMDClient.PmdMeasurementType.ACC);
759  }
760  }));
761  } catch (Throwable t){
762  return Flowable.error(t);
763  }
764  }
765 
766  @Override
767  public Flowable<PolarOhrPPGData> startOhrPPGStreaming(String identifier,
768  PolarSensorSetting setting) {
769  try {
770  final BleDeviceSession session = sessionPmdClientReady(identifier);
771  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
772  return client.startMeasurement(BlePMDClient.PmdMeasurementType.PPG, setting.map2PmdSettings()).andThen(
773  client.monitorPpgNotifications(true).map(new Function<BlePMDClient.PpgData, PolarOhrPPGData>() {
774  @Override
775  public PolarOhrPPGData apply(BlePMDClient.PpgData ppgData) throws Exception {
776  List<PolarOhrPPGData.PolarOhrPPGSample> samples = new ArrayList<>();
777  for( BlePMDClient.PpgData.PpgSample s : ppgData.ppgSamples ){
778  samples.add(new PolarOhrPPGData.PolarOhrPPGSample(s.ppg0,s.ppg1,s.ppg2,s.ambient));
779  }
780  return new PolarOhrPPGData(samples,ppgData.timeStamp);
781  }
782  }).doFinally(new Action() {
783  @Override
784  public void run() throws Exception {
785  stopPmdStreaming(session,client, BlePMDClient.PmdMeasurementType.PPG);
786  }
787  })).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarOhrPPGData>>() {
788  @Override
789  public Publisher<? extends PolarOhrPPGData> apply(Throwable throwable) throws Exception {
790  return Flowable.error(handleError(throwable));
791  }
792  });
793  } catch (Throwable t){
794  return Flowable.error(t);
795  }
796  }
797 
798  @Override
799  public Flowable<PolarOhrPPIData> startOhrPPIStreaming(String identifier) {
800  try {
801  final BleDeviceSession session = sessionPmdClientReady(identifier);
802  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
803  return client.startMeasurement(BlePMDClient.PmdMeasurementType.PPI, new BlePMDClient.PmdSetting(new HashMap<BlePMDClient.PmdSetting.PmdSettingType, Integer>())).andThen(
804  client.monitorPpiNotifications(true).map(new Function<BlePMDClient.PpiData, PolarOhrPPIData>() {
805  @Override
806  public PolarOhrPPIData apply(BlePMDClient.PpiData ppiData) throws Exception {
807  List<PolarOhrPPIData.PolarOhrPPISample> samples = new ArrayList<>();
808  for(BlePMDClient.PpiData.PPSample ppSample : ppiData.ppSamples){
809  samples.add(new PolarOhrPPIData.PolarOhrPPISample(ppSample.ppInMs,
810  ppSample.ppErrorEstimate,
811  ppSample.hr,
812  ppSample.blockerBit != 0,
813  ppSample.skinContactStatus != 0,
814  ppSample.skinContactSupported != 0));
815  }
816  return new PolarOhrPPIData(ppiData.timestamp,samples);
817  }
818  }).doFinally(new Action() {
819  @Override
820  public void run() throws Exception {
821  stopPmdStreaming(session,client, BlePMDClient.PmdMeasurementType.PPI);
822  }
823  })).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarOhrPPIData>>() {
824  @Override
825  public Publisher<? extends PolarOhrPPIData> apply(Throwable throwable) throws Exception {
826  return Flowable.error(handleError(throwable));
827  }
828  });
829  } catch (Throwable t){
830  return Flowable.error(t);
831  }
832  }
833 
834  @Override
835  public Flowable<PolarBiozData> startBiozStreaming(final String identifier, PolarSensorSetting setting){
836  try {
837  final BleDeviceSession session = sessionPmdClientReady(identifier);
838  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
839  return client.startMeasurement(BlePMDClient.PmdMeasurementType.BIOZ, setting.map2PmdSettings()).andThen(
840  client.monitorBiozNotifications(true).map(new Function<BlePMDClient.BiozData, PolarBiozData>() {
841  @Override
842  public PolarBiozData apply(BlePMDClient.BiozData biozData) throws Exception {
843  return new PolarBiozData(biozData.timeStamp,biozData.samples);
844  }
845  }).doFinally(new Action() {
846  @Override
847  public void run() throws Exception {
848  stopPmdStreaming(session,client, BlePMDClient.PmdMeasurementType.PPG);
849  }
850  })).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarBiozData>>() {
851  @Override
852  public Publisher<? extends PolarBiozData> apply(Throwable throwable) throws Exception {
853  return Flowable.error(handleError(throwable));
854  }
855  });
856  } catch (Throwable t){
857  return Flowable.error(t);
858  }
859  }
860 
861  protected BleDeviceSession fetchSession(final String identifier) throws PolarInvalidArgument {
862  if(identifier.matches("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$")){
863  return sessionByAddress(identifier);
864  } else if(identifier.matches("([0-9a-fA-F]){6,8}")) {
865  return sessionByDeviceId(identifier);
866  }
867  throw new PolarInvalidArgument();
868  }
869 
870  protected BleDeviceSession sessionByAddress(final String address) throws PolarInvalidArgument {
871  for ( BleDeviceSession session : listener.deviceSessions() ){
872  if( session.getAddress().equals(address) ){
873  return session;
874  }
875  }
876  return null;
877  }
878 
879  protected BleDeviceSession sessionByDeviceId(final String deviceId) throws PolarInvalidArgument {
880  for ( BleDeviceSession session : listener.deviceSessions() ){
881  if( session.getAdvertisementContent().getPolarDeviceId().equals(deviceId) ){
882  return session;
883  }
884  }
885  return null;
886  }
887 
888  protected BleDeviceSession sessionServiceReady(final String identifier, UUID service) throws Throwable {
889  BleDeviceSession session = fetchSession(identifier);
890  if(session != null){
891  if(session.getSessionState() == BleDeviceSession.DeviceSessionState.SESSION_OPEN) {
892  BleGattBase client = session.fetchClient(service);
893  if (client.isServiceDiscovered()) {
894  return session;
895  }
896  throw new PolarServiceNotAvailable();
897  }
898  throw new PolarDeviceDisconnected();
899  }
900  throw new PolarDeviceNotFound();
901  }
902 
903  public BleDeviceSession sessionPmdClientReady(final String identifier) throws Throwable {
904  BleDeviceSession session = sessionServiceReady(identifier, BlePMDClient.PMD_SERVICE);
905  BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
906  final AtomicInteger pair = client.getNotificationAtomicInteger(BlePMDClient.PMD_CP);
907  final AtomicInteger pairData = client.getNotificationAtomicInteger(BlePMDClient.PMD_DATA);
908  if (pair != null && pairData != null &&
909  pair.get() == BleGattBase.ATT_SUCCESS &&
910  pairData.get() == BleGattBase.ATT_SUCCESS) {
911  return session;
912  }
913  throw new PolarNotificationNotEnabled();
914  }
915 
916  protected BleDeviceSession sessionPsFtpClientReady(final String identifier) throws Throwable {
917  BleDeviceSession session = sessionServiceReady(identifier, BlePsFtpUtils.RFC77_PFTP_SERVICE);
918  BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
919  final AtomicInteger pair = client.getNotificationAtomicInteger(BlePsFtpUtils.RFC77_PFTP_MTU_CHARACTERISTIC);
920  if (pair != null && pair.get() == BleGattBase.ATT_SUCCESS ) {
921  return session;
922  }
923  throw new PolarNotificationNotEnabled();
924  }
925 
926  @SuppressLint("CheckResult")
927  protected void stopPmdStreaming(BleDeviceSession session, BlePMDClient client, BlePMDClient.PmdMeasurementType type) {
928  if( session.getSessionState() == BleDeviceSession.DeviceSessionState.SESSION_OPEN ){
929  // stop streaming
930  client.stopMeasurement(type).subscribe(
931  new Action() {
932  @Override
933  public void run() throws Exception {
934 
935  }
936  },
937  new Consumer<Throwable>() {
938  @Override
939  public void accept(Throwable throwable) throws Exception {
940  logError("failed to stop pmd stream: " + throwable.getLocalizedMessage());
941  }
942  }
943  );
944  }
945  }
946 
947  @SuppressLint("CheckResult")
948  protected void setupDevice(final BleDeviceSession session){
949  final String deviceId = session.getPolarDeviceId().length() != 0 ? session.getPolarDeviceId() : session.getAddress();
950  session.monitorServicesDiscovered(true).observeOn(scheduler).toFlowable().flatMapIterable(
951  new Function<List<UUID>, Iterable<UUID>>() {
952  @Override
953  public Iterable<UUID> apply(List<UUID> uuids) throws Exception {
954  return uuids;
955  }
956  }
957  ).flatMap(new Function<UUID, Publisher<?>>() {
958  @Override
959  public Publisher<?> apply(UUID uuid) throws Exception {
960  if(session.fetchClient(uuid) != null) {
961  if (uuid.equals(BleHrClient.HR_SERVICE)) {
962  if (callback != null) {
963  callback.hrFeatureReady(deviceId);
964  }
965  final BleHrClient client = (BleHrClient) session.fetchClient(BleHrClient.HR_SERVICE);
966  client.observeHrNotifications(true).observeOn(scheduler).subscribe(
967  new Consumer<BleHrClient.HrNotificationData>() {
968  @Override
969  public void accept(BleHrClient.HrNotificationData hrNotificationData) throws Exception {
970  if (callback != null) {
972  new PolarHrData(hrNotificationData.hrValue,
973  hrNotificationData.rrs,
974  hrNotificationData.sensorContact,
975  hrNotificationData.sensorContactSupported,
976  hrNotificationData.rrPresent));
977  }
978  }
979  },
980  new Consumer<Throwable>() {
981  @Override
982  public void accept(Throwable throwable) throws Exception {
983  logError(throwable.getMessage());
984  }
985  },
986  new Action() {
987  @Override
988  public void run() throws Exception {
989 
990  }
991  }
992  );
993  } else if (uuid.equals(BleBattClient.BATTERY_SERVICE)) {
994  BleBattClient client = (BleBattClient) session.fetchClient(BleBattClient.BATTERY_SERVICE);
995  return client.waitBatteryLevelUpdate(true).observeOn(scheduler).doOnSuccess(new Consumer<Integer>() {
996  @Override
997  public void accept(Integer integer) throws Exception {
998  if (callback != null) {
999  callback.batteryLevelReceived(deviceId, integer);
1000  }
1001  }
1002  }).toFlowable();
1003  } else if (uuid.equals(BlePMDClient.PMD_SERVICE)) {
1004  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
1005  return client.waitNotificationEnabled(BlePMDClient.PMD_CP, true).
1006  concatWith(client.waitNotificationEnabled(BlePMDClient.PMD_DATA, true)).andThen(client.readFeature(true).doOnSuccess(new Consumer<BlePMDClient.PmdFeature>() {
1007  @Override
1008  public void accept(BlePMDClient.PmdFeature pmdFeature) {
1009  if (callback != null) {
1010  if (pmdFeature.ecgSupported) {
1011  callback.ecgFeatureReady(deviceId);
1012  }
1013  if (pmdFeature.accSupported) {
1015  }
1016  if (pmdFeature.ppgSupported) {
1017  callback.ppgFeatureReady(deviceId);
1018  }
1019  if (pmdFeature.ppiSupported) {
1020  callback.ppiFeatureReady(deviceId);
1021  }
1022  if (pmdFeature.bioZSupported) {
1023  callback.biozFeatureReady(deviceId);
1024  }
1025  }
1026  }
1027  })).toFlowable();
1028  } else if (uuid.equals(BleDisClient.DIS_SERVICE)) {
1029  BleDisClient client = (BleDisClient) session.fetchClient(BleDisClient.DIS_SERVICE);
1030  return client.observeDisInfo(true).observeOn(scheduler).doOnNext(new Consumer<Pair<UUID, String>>() {
1031  @Override
1032  public void accept(Pair<UUID, String> pair) {
1033  if (callback != null) {
1034  callback.disInformationReceived(deviceId, pair.first , pair.second);
1035  }
1036  }
1037  });
1038  } else if (uuid.equals(BlePsFtpUtils.RFC77_PFTP_SERVICE)) {
1039  BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
1040  return client.waitPsFtpClientReady(true).observeOn(scheduler).doOnComplete(new Action() {
1041  @Override
1042  public void run() throws Exception {
1043  if (callback != null &&
1044  (session.getPolarDeviceType().equals("OH1") || session.getPolarDeviceType().equals("H10"))) {
1045  callback.polarFtpFeatureReady(deviceId);
1046  }
1047  }
1048  }).toFlowable();
1049  }
1050  }
1051  return Flowable.empty();
1052  }
1053  }).subscribe(
1054  new Consumer<Object>() {
1055  @Override
1056  public void accept(Object o) throws Exception {
1057 
1058  }
1059  },
1060  new Consumer<Throwable>() {
1061  @Override
1062  public void accept(Throwable throwable) throws Exception {
1063  logError(throwable.getMessage());
1064  }
1065  },
1066  new Action() {
1067  @Override
1068  public void run() throws Exception {
1069  log("complete");
1070  }
1071  });
1072  }
1073 
1074  protected Exception handleError(Throwable throwable) {
1075  if( throwable instanceof BleDisconnected ){
1076  return new PolarDeviceDisconnected();
1077  } else {
1078  return new Exception("Unknown Error: " + throwable.getLocalizedMessage());
1079  }
1080  }
1081 
1082  interface FetchRecursiveCondition {
1083  boolean include(String entry);
1084  }
1085 
1086  protected Flowable<String> fetchRecursively(final BlePsFtpClient client, final String path, final FetchRecursiveCondition condition) {
1087  protocol.PftpRequest.PbPFtpOperation.Builder builder = protocol.PftpRequest.PbPFtpOperation.newBuilder();
1088  builder.setCommand(PftpRequest.PbPFtpOperation.Command.GET);
1089  builder.setPath(path);
1090  return client.request(builder.build().toByteArray()).toFlowable().flatMap(new Function<ByteArrayOutputStream, Publisher<String>>() {
1091  @Override
1092  public Publisher<String> apply(ByteArrayOutputStream byteArrayOutputStream) throws Exception {
1093  PftpResponse.PbPFtpDirectory dir = PftpResponse.PbPFtpDirectory.parseFrom(byteArrayOutputStream.toByteArray());
1094  Set<String> entrys = new HashSet<>();
1095  for( int i=0; i < dir.getEntriesCount(); ++i ){
1096  PftpResponse.PbPFtpEntry entry = dir.getEntries(i);
1097  if( condition.include(entry.getName()) ){
1098  BleUtils.validate(entrys.add(path + entry.getName()),"duplicate entry");
1099  }
1100  }
1101  if(entrys.size()!=0) {
1102  return Flowable.fromIterable(entrys).flatMap(new Function<String, Publisher<String>>() {
1103  @Override
1104  public Publisher<String> apply(String s) {
1105  if (s.endsWith("/")) {
1106  return fetchRecursively(client, s, condition);
1107  } else {
1108  return Flowable.just(s);
1109  }
1110  }
1111  });
1112  }
1113  return Flowable.empty();
1114  }
1115  });
1116  }
1117 
1118  protected void log(final String message) {
1119  if(logger != null){
1120  logger.message("" + message);
1121  }
1122  }
1123 
1124  protected void logError(final String message) {
1125  if(logger != null){
1126  logger.message("Error: "+message);
1127  }
1128  }
1129 }
-
void log(final String message)
- -
void blePowerStateChanged(final boolean powered)
-
static final int ANDROID_VERSION_O
-
Single< PolarExerciseData > fetchExercise(String identifier, PolarExerciseEntry entry)
- -
Completable startRecording(String identifier, String exerciseId, RecordingInterval interval, SampleType type)
-
Completable autoConnectToDevice(final int rssiLimit, final String service, final int timeout, final TimeUnit unit, final String polarDeviceType)
+Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.impl;
3 
4 import android.annotation.SuppressLint;
5 import android.bluetooth.le.ScanFilter;
6 import android.content.Context;
7 import android.os.Build;
8 import android.os.ParcelUuid;
9 import android.support.annotation.Nullable;
10 import android.util.Log;
11 import android.util.Pair;
12 
13 import com.androidcommunications.polar.api.ble.BleDeviceListener;
14 import com.androidcommunications.polar.api.ble.BleLogger;
15 import com.androidcommunications.polar.api.ble.exceptions.BleDisconnected;
16 import com.androidcommunications.polar.api.ble.model.BleDeviceSession;
17 import com.androidcommunications.polar.api.ble.model.advertisement.BleAdvertisementContent;
18 import com.androidcommunications.polar.api.ble.model.advertisement.BlePolarHrAdvertisement;
19 import com.androidcommunications.polar.api.ble.model.gatt.BleGattBase;
20 import com.androidcommunications.polar.api.ble.model.gatt.client.BleBattClient;
21 import com.androidcommunications.polar.api.ble.model.gatt.client.BleDisClient;
22 import com.androidcommunications.polar.api.ble.model.gatt.client.BleHrClient;
23 import com.androidcommunications.polar.api.ble.model.gatt.client.BlePMDClient;
24 import com.androidcommunications.polar.api.ble.model.gatt.client.psftp.BlePsFtpClient;
25 import com.androidcommunications.polar.api.ble.model.gatt.client.psftp.BlePsFtpUtils;
26 import com.androidcommunications.polar.common.ble.BleUtils;
27 import com.androidcommunications.polar.enpoints.ble.bluedroid.host.BDDeviceListenerImpl;
28 
29 import org.reactivestreams.Publisher;
30 
31 import java.io.ByteArrayOutputStream;
32 import java.text.SimpleDateFormat;
33 import java.util.ArrayList;
34 import java.util.Calendar;
35 import java.util.Collections;
36 import java.util.Comparator;
37 import java.util.Date;
38 import java.util.HashMap;
39 import java.util.HashSet;
40 import java.util.List;
41 import java.util.Locale;
42 import java.util.Map;
43 import java.util.Set;
44 import java.util.UUID;
45 import java.util.concurrent.TimeUnit;
46 import java.util.concurrent.atomic.AtomicInteger;
47 
48 import fi.polar.remote.representation.protobuf.ExerciseSamples;
49 import fi.polar.remote.representation.protobuf.Types;
50 import io.reactivex.Completable;
51 import io.reactivex.CompletableEmitter;
52 import io.reactivex.CompletableOnSubscribe;
53 import io.reactivex.CompletableSource;
54 import io.reactivex.Flowable;
55 import io.reactivex.Scheduler;
56 import io.reactivex.Single;
57 import io.reactivex.SingleSource;
58 import io.reactivex.android.schedulers.AndroidSchedulers;
59 import io.reactivex.disposables.Disposable;
60 import io.reactivex.functions.Action;
61 import io.reactivex.functions.BiFunction;
62 import io.reactivex.functions.Consumer;
63 import io.reactivex.functions.Function;
64 import io.reactivex.functions.Predicate;
65 import io.reactivex.schedulers.Timed;
66 import polar.com.sdk.api.PolarBleApi;
86 import protocol.PftpNotification;
87 import protocol.PftpRequest;
88 import protocol.PftpResponse;
89 
93 public class BDBleApiImpl extends PolarBleApi {
94  protected final static String TAG = BDBleApiImpl.class.getSimpleName();
95  protected BleDeviceListener listener;
96  protected Map<String,Disposable> connectSubscriptions = new HashMap<>();
97  protected Scheduler scheduler;
100  protected static final int ANDROID_VERSION_O = 26;
101  BleDeviceListener.BleSearchPreFilter filter = new BleDeviceListener.BleSearchPreFilter() {
102  @Override
103  public boolean process(BleAdvertisementContent content) {
104  return content.getPolarDeviceId().length() != 0 && !content.getPolarDeviceType().equals("mobile");
105  }
106  };
107 
108  @SuppressLint({"NewApi", "CheckResult"})
109  public BDBleApiImpl(final Context context, int features) {
110  super(features);
111  Set<Class<? extends BleGattBase>> clients = new HashSet<>();
112  if((this.features & PolarBleApi.FEATURE_HR)!=0){
113  clients.add(BleHrClient.class);
114  }
115  if((this.features & PolarBleApi.FEATURE_DEVICE_INFO)!=0){
116  clients.add(BleDisClient.class);
117  }
118  if((this.features & PolarBleApi.FEATURE_BATTERY_INFO)!=0){
119  clients.add(BleBattClient.class);
120  }
121  if((this.features & PolarBleApi.FEATURE_POLAR_SENSOR_STREAMING)!=0){
122  clients.add(BlePMDClient.class);
123  }
124  if((this.features & PolarBleApi.FEATURE_POLAR_FILE_TRANSFER)!=0){
125  clients.add(BlePsFtpClient.class);
126  }
127  listener = new BDDeviceListenerImpl(context, clients);
128  listener.setScanPreFilter(filter);
129  scheduler = AndroidSchedulers.from(context.getMainLooper());
130  listener.monitorDeviceSessionState(null).observeOn(scheduler).subscribe(
131  new Consumer<Pair<BleDeviceSession, BleDeviceSession.DeviceSessionState>>() {
132  @Override
133  public void accept(Pair<BleDeviceSession, BleDeviceSession.DeviceSessionState> pair) throws Exception {
134  PolarDeviceInfo info = new PolarDeviceInfo(
135  pair.first.getPolarDeviceId().length() != 0 ?
136  pair.first.getPolarDeviceId() : pair.first.getAddress(),
137  pair.first.getAddress(),
138  pair.first.getRssi(),pair.first.getName(),true);
139  switch (pair.second){
140  case SESSION_OPEN:
141  if(callback!=null){
143  }
144  setupDevice(pair.first);
145  break;
146  case SESSION_CLOSED:
147  if( callback != null ) {
148  if (pair.first.getPreviousState() == BleDeviceSession.DeviceSessionState.SESSION_OPEN ||
149  pair.first.getPreviousState() == BleDeviceSession.DeviceSessionState.SESSION_CLOSING){
151  }
152  }
153  break;
154  case SESSION_OPENING:
155  if(callback != null){
157  }
158  break;
159  }
160  }
161  },
162  new Consumer<Throwable>() {
163  @Override
164  public void accept(Throwable throwable) throws Exception {
165  logError(throwable.getMessage());
166  }
167  },
168  new Action() {
169  @Override
170  public void run() throws Exception {
171 
172  }
173  }
174  );
175  listener.monitorBleState().observeOn(scheduler).subscribe(
176  new Consumer<Boolean>() {
177  @Override
178  public void accept(Boolean aBoolean) throws Exception {
179  if(callback != null){
180  callback.blePowerStateChanged(aBoolean);
181  }
182  }
183  },
184  new Consumer<Throwable>() {
185  @Override
186  public void accept(Throwable throwable) throws Exception {
187  logError(throwable.getMessage());
188  }
189  },
190  new Action() {
191  @Override
192  public void run() throws Exception {
193 
194  }
195  }
196  );
197  BleLogger.setLoggerInterface(new BleLogger.BleLoggerInterface() {
198  @Override
199  public void d(String tag, String msg) {
200  log(tag+"/"+msg);
201  }
202 
203  @Override
204  public void e(String tag, String msg) {
205  logError(tag+"/"+msg);
206  }
207 
208  @Override
209  public void w(String tag, String msg) {
210  }
211 
212  @Override
213  public void i(String tag, String msg) {
214  }
215  });
216  }
217 
218  @SuppressLint("NewApi")
219  protected void enableAndroidScanFilter() {
220  if (Build.VERSION.SDK_INT >= ANDROID_VERSION_O) {
221  List<ScanFilter> filter = new ArrayList<>();
222  filter.add(new ScanFilter.Builder().setServiceUuid(
223  ParcelUuid.fromString(BleHrClient.HR_SERVICE.toString())).build());
224  filter.add(new ScanFilter.Builder().setServiceUuid(
225  ParcelUuid.fromString(BlePsFtpUtils.RFC77_PFTP_SERVICE.toString())).build());
226  listener.setScanFilters(filter);
227  }
228  }
229 
230  @Override
231  public void shutDown() {
232  listener.shutDown();
233  }
234 
235  @Override
236  public void cleanup() {
237  listener.removeAllSessions();
238  }
239 
240  @Override
241  public void setPolarFilter(boolean enable) {
242  if(!enable) {
243  listener.setScanPreFilter(null);
244  } else {
245  listener.setScanPreFilter(filter);
246  }
247  }
248 
249  @Override
250  public boolean isFeatureReady(final String deviceId, int feature) {
251  try {
252  switch (feature) {
254  return sessionPsFtpClientReady(deviceId) != null;
256  return sessionPmdClientReady(deviceId) != null;
257  }
258  } catch (Throwable ignored) {
259  }
260  return false;
261  }
262 
263  @Override
265  this.callback = callback;
267  }
268 
269  @Override
270  public void setApiLogger(@Nullable PolarBleApiLogger logger) {
271  this.logger = logger;
272  }
273 
274  @Override
275  public void setAutomaticReconnection(boolean disable) {
276  listener.setAutomaticReconnection(disable);
277  }
278 
279  @Override
280  public Completable setLocalTime(String identifier, Calendar cal) {
281  try {
282  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
283  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
284  PftpRequest.PbPFtpSetLocalTimeParams.Builder builder = PftpRequest.PbPFtpSetLocalTimeParams.newBuilder();
285  Types.PbDate date = Types.PbDate.newBuilder()
286  .setYear(cal.get(Calendar.YEAR))
287  .setMonth(cal.get(Calendar.MONTH) + 1)
288  .setDay(cal.get(Calendar.DAY_OF_MONTH)).build();
289  Types.PbTime time = Types.PbTime.newBuilder()
290  .setHour(cal.get(Calendar.HOUR_OF_DAY))
291  .setMinute(cal.get(Calendar.MINUTE))
292  .setSeconds(cal.get(Calendar.SECOND))
293  .setMillis(cal.get(Calendar.MILLISECOND)).build();
294  builder.setDate(date).setTime(time).setTzOffset((int) TimeUnit.MINUTES.convert(cal.get(Calendar.ZONE_OFFSET), TimeUnit.MILLISECONDS));
295  return client.query(PftpRequest.PbPFtpQuery.SET_LOCAL_TIME_VALUE,builder.build().toByteArray()).toObservable().ignoreElements();
296  } catch (Throwable error){
297  return Completable.error(error);
298  }
299  }
300 
301  @Override
302  public Single<PolarSensorSetting> requestAccSettings(String identifier) {
303  return querySettings(identifier,BlePMDClient.PmdMeasurementType.ACC);
304  }
305 
306  @Override
307  public Single<PolarSensorSetting> requestEcgSettings(String identifier) {
308  return querySettings(identifier,BlePMDClient.PmdMeasurementType.ECG);
309  }
310 
311  @Override
312  public Single<PolarSensorSetting> requestPpgSettings(String identifier) {
313  return querySettings(identifier,BlePMDClient.PmdMeasurementType.PPG);
314  }
315 
316  @Override
317  public Single<PolarSensorSetting> requestBiozSettings(final String identifier){
318  return querySettings(identifier,BlePMDClient.PmdMeasurementType.BIOZ);
319  }
320 
321  protected Single<PolarSensorSetting> querySettings(final String identifier, final BlePMDClient.PmdMeasurementType type) {
322  try {
323  final BleDeviceSession session = sessionPmdClientReady(identifier);
324  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
325  return client.querySettings(type).map(new Function<BlePMDClient.PmdSetting, PolarSensorSetting>() {
326  @Override
327  public PolarSensorSetting apply(BlePMDClient.PmdSetting setting) throws Exception {
328  return new PolarSensorSetting(setting.settings, type);
329  }
330  });
331  } catch (Throwable e){
332  return Single.error(e);
333  }
334  }
335 
336  @Override
337  public void backgroundEntered() {
339  }
340 
341  @Override
342  public void foregroundEntered() {
343  listener.setScanFilters(null);
344  }
345 
346  @Override
347  public Completable autoConnectToDevice(final int rssiLimit, final String service, final int timeout, final TimeUnit unit, final String polarDeviceType) {
348  final long[] start = {0};
349  return Completable.create(new CompletableOnSubscribe() {
350  @Override
351  public void subscribe(CompletableEmitter emitter) throws Exception {
352  if( service == null || service.matches("([0-9a-fA-F]{4})") ) {
353  emitter.onComplete();
354  } else {
355  emitter.tryOnError(new PolarInvalidArgument("Invalid service string format"));
356  }
357  }
358  }).andThen(listener.search(false).filter(new Predicate<BleDeviceSession>() {
359  @Override
360  public boolean test(BleDeviceSession bleDeviceSession) throws Exception {
361  if( bleDeviceSession.getMedianRssi() >= rssiLimit &&
362  bleDeviceSession.isConnectableAdvertisement() &&
363  (polarDeviceType == null || polarDeviceType.equals(bleDeviceSession.getPolarDeviceType())) &&
364  (service == null || bleDeviceSession.getAdvertisementContent().containsService(service)) ) {
365  if(start[0] == 0){
366  start[0] = System.currentTimeMillis();
367  }
368  return true;
369  }
370  return false;
371  }
372  }).timestamp().takeUntil(new Predicate<Timed<BleDeviceSession>>() {
373  @Override
374  public boolean test(Timed<BleDeviceSession> bleDeviceSessionTimed) throws Exception {
375  long diff = bleDeviceSessionTimed.time(TimeUnit.MILLISECONDS) - start[0];
376  return (diff >= unit.toMillis(timeout));
377  }
378  }).reduce(new HashSet<BleDeviceSession>(), new BiFunction<Set<BleDeviceSession>, Timed<BleDeviceSession>, Set<BleDeviceSession>>() {
379  @Override
380  public Set<BleDeviceSession> apply(Set<BleDeviceSession> objects, Timed<BleDeviceSession> bleDeviceSessionTimed) throws Exception {
381  objects.add(bleDeviceSessionTimed.value());
382  return objects;
383  }
384  }).doOnSuccess(new Consumer<Set<BleDeviceSession>>() {
385  @Override
386  public void accept(Set<BleDeviceSession> set) throws Exception {
387  List<BleDeviceSession> list = new ArrayList<>(set);
388  Collections.sort(list, new Comparator<BleDeviceSession>() {
389  @Override
390  public int compare(BleDeviceSession o1, BleDeviceSession o2) {
391  return o1.getRssi() > o2.getRssi() ? -1 : 1;
392  }
393  });
394  listener.openSessionDirect(list.get(0));
395  log("auto connect search complete");
396  }
397  }).toObservable().ignoreElements());
398  }
399 
400  @Override
401  public Completable autoConnectToDevice(final int rssiLimit, final String service, final String polarDeviceType) {
402  return autoConnectToDevice(rssiLimit, service, 2, TimeUnit.SECONDS, polarDeviceType);
403  }
404 
405  @Override
406  public void connectToDevice(final String identifier) throws PolarInvalidArgument {
407  BleDeviceSession session = fetchSession(identifier);
408  if( session == null || session.getSessionState() == BleDeviceSession.DeviceSessionState.SESSION_CLOSED ){
409  if( connectSubscriptions.containsKey(identifier) ){
410  connectSubscriptions.get(identifier).dispose();
411  connectSubscriptions.remove(identifier);
412  }
413  if( session != null ){
414  listener.openSessionDirect(session);
415  } else {
416  connectSubscriptions.put(identifier, listener.search(false).filter(new Predicate<BleDeviceSession>() {
417  @Override
418  public boolean test(BleDeviceSession bleDeviceSession) throws Exception {
419  return identifier.contains(":") ?
420  bleDeviceSession.getAddress().equals(identifier) :
421  bleDeviceSession.getPolarDeviceId().equals(identifier);
422  }
423  }).take(1).observeOn(scheduler).subscribe(
424  new Consumer<BleDeviceSession>() {
425  @Override
426  public void accept(BleDeviceSession bleDeviceSession) throws Exception {
427  listener.openSessionDirect(bleDeviceSession);
428  }
429  },
430  new Consumer<Throwable>() {
431  @Override
432  public void accept(Throwable throwable) throws Exception {
433  logError(throwable.getMessage());
434  }
435  },
436  new Action() {
437  @Override
438  public void run() throws Exception {
439  log("connect search complete");
440  }
441  }
442  ));
443  }
444  }
445  }
446 
447  @Override
448  public void disconnectFromDevice(String identifier) throws PolarInvalidArgument {
449  BleDeviceSession session = fetchSession(identifier);
450  if( session != null ){
451  if( session.getSessionState() == BleDeviceSession.DeviceSessionState.SESSION_OPEN ||
452  session.getSessionState() == BleDeviceSession.DeviceSessionState.SESSION_OPENING ||
453  session.getSessionState() == BleDeviceSession.DeviceSessionState.SESSION_OPEN_PARK ) {
454  listener.closeSessionDirect(session);
455  }
456  }
457  if (connectSubscriptions.containsKey(identifier)){
458  connectSubscriptions.get(identifier).dispose();
459  connectSubscriptions.remove(identifier);
460  }
461  }
462 
463  @Override
464  public Completable startRecording(String identifier, String exerciseId, RecordingInterval interval, SampleType type) {
465  try {
466  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
467  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
468  if(session.getPolarDeviceType().equals("H10")) {
469  Types.PbSampleType t = type == SampleType.HR ?
470  Types.PbSampleType.SAMPLE_TYPE_HEART_RATE :
471  Types.PbSampleType.SAMPLE_TYPE_RR_INTERVAL;
472  Types.PbDuration duration = Types.PbDuration.newBuilder().setSeconds(interval.getValue()).build();
473  PftpRequest.PbPFtpRequestStartRecordingParams params = PftpRequest.PbPFtpRequestStartRecordingParams.newBuilder().
474  setSampleDataIdentifier(exerciseId).setSampleType(t).setRecordingInterval(duration).build();
475  return client.query(PftpRequest.PbPFtpQuery.REQUEST_START_RECORDING_VALUE, params.toByteArray()).toObservable().ignoreElements().onErrorResumeNext(new Function<Throwable, CompletableSource>() {
476  @Override
477  public CompletableSource apply(Throwable throwable) throws Exception {
478  return Completable.error(throwable);
479  }
480  });
481  }
482  return Completable.error(new PolarOperationNotSupported());
483  } catch (Throwable error){
484  return Completable.error(error);
485  }
486  }
487 
488  @Override
489  public Completable stopRecording(String identifier) {
490  try {
491  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
492  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
493  if(session.getPolarDeviceType().equals("H10")) {
494  return client.query(PftpRequest.PbPFtpQuery.REQUEST_STOP_RECORDING_VALUE, null).toObservable().ignoreElements().onErrorResumeNext(new Function<Throwable, CompletableSource>() {
495  @Override
496  public CompletableSource apply(Throwable throwable) throws Exception {
497  return Completable.error(handleError(throwable));
498  }
499  });
500  }
501  return Completable.error(new PolarOperationNotSupported());
502  } catch (Throwable error){
503  return Completable.error(error);
504  }
505  }
506 
507  @Override
508  public Single<Pair<Boolean,String>> requestRecordingStatus(String identifier) {
509  try {
510  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
511  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
512  if(session.getPolarDeviceType().equals("H10")) {
513  return client.query(PftpRequest.PbPFtpQuery.REQUEST_RECORDING_STATUS_VALUE, null).map(new Function<ByteArrayOutputStream, Pair<Boolean,String>>() {
514  @Override
515  public Pair<Boolean,String> apply(ByteArrayOutputStream byteArrayOutputStream) throws Exception {
516  PftpResponse.PbRequestRecordingStatusResult result = PftpResponse.PbRequestRecordingStatusResult.parseFrom(byteArrayOutputStream.toByteArray());
517  return new Pair<>(result.getRecordingOn(),result.hasSampleDataIdentifier() ? result.getSampleDataIdentifier() : "");
518  }
519  }).onErrorResumeNext(new Function<Throwable, SingleSource<? extends Pair<Boolean, String>>>() {
520  @Override
521  public SingleSource<? extends Pair<Boolean, String>> apply(Throwable throwable) throws Exception {
522  return Single.error(handleError(throwable));
523  }
524  });
525  }
526  return Single.error(new PolarOperationNotSupported());
527  } catch (Throwable error){
528  return Single.error(error);
529  }
530  }
531 
532  @Override
533  public Flowable<PolarExerciseEntry> listExercises(String identifier) {
534  try{
535  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
536  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
537  switch (session.getPolarDeviceType()) {
538  case "OH1":
539  return fetchRecursively(client, "/U/0/", new FetchRecursiveCondition() {
540  @Override
541  public boolean include(String entry) {
542  return entry.matches("^([0-9]{8})(\\/)") ||
543  entry.matches("^([0-9]{6})(\\/)") ||
544  entry.equals("E/") ||
545  entry.equals("SAMPLES.BPB") ||
546  entry.equals("00/");
547  }
548  }).map(new Function<String, PolarExerciseEntry>() {
549  @Override
550  public PolarExerciseEntry apply(String p) throws Exception {
551  String components[] = p.split("/");
552  SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd HHmmss", Locale.getDefault());
553  Date date = format.parse(components[3] + " " + components[5]);
554  return new PolarExerciseEntry(p, date, components[3] + components[5]);
555  }
556  }).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarExerciseEntry>>() {
557  @Override
558  public Publisher<? extends PolarExerciseEntry> apply(Throwable throwable) throws Exception {
559  return Flowable.error(handleError(throwable));
560  }
561  });
562  case "H10":
563  return fetchRecursively(client, "/", new FetchRecursiveCondition() {
564  @Override
565  public boolean include(String entry) {
566  return entry.endsWith("/") || entry.equals("SAMPLES.BPB");
567  }
568  }).map(new Function<String, PolarExerciseEntry>() {
569  @Override
570  public PolarExerciseEntry apply(String p) throws Exception {
571  String components[] = p.split("/");
572  return new PolarExerciseEntry(p, new Date(), components[1]);
573  }
574  }).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarExerciseEntry>>() {
575  @Override
576  public Publisher<? extends PolarExerciseEntry> apply(Throwable throwable) throws Exception {
577  return Flowable.error(handleError(throwable));
578  }
579  });
580  default:
581  return Flowable.error(new PolarOperationNotSupported());
582  }
583  } catch (Throwable error){
584  return Flowable.error(error);
585  }
586  }
587 
588  @Override
589  public Single<PolarExerciseData> fetchExercise(String identifier, PolarExerciseEntry entry) {
590  try{
591  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
592  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
593  protocol.PftpRequest.PbPFtpOperation.Builder builder = protocol.PftpRequest.PbPFtpOperation.newBuilder();
594  builder.setCommand(PftpRequest.PbPFtpOperation.Command.GET);
595  builder.setPath(entry.path);
596  if(session.getPolarDeviceType().equals("OH1") || session.getPolarDeviceType().equals("H10")) {
597  return client.request(builder.build().toByteArray()).map(new Function<ByteArrayOutputStream, PolarExerciseData>() {
598  @Override
599  public PolarExerciseData apply(ByteArrayOutputStream byteArrayOutputStream) throws Exception {
600  ExerciseSamples.PbExerciseSamples samples = ExerciseSamples.PbExerciseSamples.parseFrom(byteArrayOutputStream.toByteArray());
601  if(samples.hasRrSamples()){
602  return new PolarExerciseData(samples.getRecordingInterval().getSeconds(), samples.getRrSamples().getRrIntervalsList());
603  } else {
604  return new PolarExerciseData(samples.getRecordingInterval().getSeconds(), samples.getHeartRateSamplesList());
605  }
606  }
607  }).onErrorResumeNext(new Function<Throwable, SingleSource<? extends PolarExerciseData>>() {
608  @Override
609  public SingleSource<? extends PolarExerciseData> apply(Throwable throwable) throws Exception {
610  return Single.error(handleError(throwable));
611  }
612  });
613  }
614  return Single.error(new PolarOperationNotSupported());
615  } catch (Throwable error){
616  return Single.error(error);
617  }
618  }
619 
620  @Override
621  public Completable removeExercise(String identifier, PolarExerciseEntry entry) {
622  try{
623  final BleDeviceSession session = sessionPsFtpClientReady(identifier);
624  final BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
625  if(session.getPolarDeviceType().equals("OH1")){
626  protocol.PftpRequest.PbPFtpOperation.Builder builder = protocol.PftpRequest.PbPFtpOperation.newBuilder();
627  builder.setCommand(PftpRequest.PbPFtpOperation.Command.GET);
628  final String components[] = entry.path.split("/");
629  final String exerciseParent = "/U/0/" + components[3] + "/E/";
630  builder.setPath(exerciseParent);
631  return client.request(builder.build().toByteArray()).flatMap(new Function<ByteArrayOutputStream, SingleSource<?>>() {
632  @Override
633  public SingleSource<?> apply(ByteArrayOutputStream byteArrayOutputStream) throws Exception {
634  PftpResponse.PbPFtpDirectory directory = PftpResponse.PbPFtpDirectory.parseFrom(byteArrayOutputStream.toByteArray());
635  protocol.PftpRequest.PbPFtpOperation.Builder removeBuilder = protocol.PftpRequest.PbPFtpOperation.newBuilder();
636  removeBuilder.setCommand(PftpRequest.PbPFtpOperation.Command.REMOVE);
637  if( directory.getEntriesCount() <= 1 ){
638  // remove entire directory
639  removeBuilder.setPath("/U/0/" + components[3] + "/");
640  } else {
641  // remove only exercise
642  removeBuilder.setPath("/U/0/" + components[3] + "/E/" + components[5] + "/");
643  }
644  return client.request(removeBuilder.build().toByteArray());
645  }
646  }).toObservable().ignoreElements().onErrorResumeNext(new Function<Throwable, CompletableSource>() {
647  @Override
648  public CompletableSource apply(Throwable throwable) throws Exception {
649  return Completable.error(handleError(throwable));
650  }
651  });
652  } else if(session.getPolarDeviceType().equals("H10")){
653  protocol.PftpRequest.PbPFtpOperation.Builder builder = protocol.PftpRequest.PbPFtpOperation.newBuilder();
654  builder.setCommand(PftpRequest.PbPFtpOperation.Command.REMOVE);
655  builder.setPath(entry.path);
656  return client.request(builder.build().toByteArray()).toObservable().ignoreElements().onErrorResumeNext(new Function<Throwable, CompletableSource>() {
657  @Override
658  public CompletableSource apply(Throwable throwable) throws Exception {
659  return Completable.error(handleError(throwable));
660  }
661  });
662  }
663  return Completable.error(new PolarOperationNotSupported());
664  } catch (Throwable error){
665  return Completable.error(error);
666  }
667  }
668 
669  @Override
670  public Flowable<PolarDeviceInfo> searchForDevice() {
671  return listener.search(false).distinct().map(new Function<BleDeviceSession, PolarDeviceInfo>() {
672  @Override
673  public PolarDeviceInfo apply(BleDeviceSession bleDeviceSession) throws Exception {
674  return new PolarDeviceInfo(bleDeviceSession.getPolarDeviceId(),
675  bleDeviceSession.getAddress(),
676  bleDeviceSession.getRssi(),
677  bleDeviceSession.getName(),
678  bleDeviceSession.isConnectableAdvertisement());
679  }
680  });
681  }
682 
683  @Override
684  public Flowable<PolarHrBroadcastData> startListenForPolarHrBroadcasts(final Set<String> deviceIds) {
685  // set filter to null, NOTE this disables reconnection in background
686  return listener.search(false).filter(new Predicate<BleDeviceSession>() {
687  @Override
688  public boolean test(BleDeviceSession bleDeviceSession) throws Exception {
689  return (deviceIds == null || deviceIds.contains(bleDeviceSession.getPolarDeviceId())) &&
690  bleDeviceSession.getAdvertisementContent().getPolarHrAdvertisement().isPresent();
691  }
692  }).map(new Function<BleDeviceSession, PolarHrBroadcastData>() {
693  @Override
694  public PolarHrBroadcastData apply(BleDeviceSession bleDeviceSession) throws Exception {
695  BlePolarHrAdvertisement advertisement = bleDeviceSession.getBlePolarHrAdvertisement();
696  return new PolarHrBroadcastData( new PolarDeviceInfo(bleDeviceSession.getPolarDeviceId(),
697  bleDeviceSession.getAddress(),
698  bleDeviceSession.getRssi(),
699  bleDeviceSession.getName(),
700  bleDeviceSession.isConnectableAdvertisement()),
701  advertisement.getHrForDisplay(),
702  advertisement.getBatteryStatus() != 0);
703  }
704  });
705  }
706 
707  @Override
708  public Flowable<PolarEcgData> startEcgStreaming(String identifier,
709  PolarSensorSetting setting) {
710  try {
711  final BleDeviceSession session = sessionPmdClientReady(identifier);
712  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
713  return client.startMeasurement(BlePMDClient.PmdMeasurementType.ECG, setting.map2PmdSettings()).andThen(
714  client.monitorEcgNotifications(true).map(new Function<BlePMDClient.EcgData, PolarEcgData>() {
715  @Override
716  public PolarEcgData apply(BlePMDClient.EcgData ecgData) throws Exception {
717  List<Integer> samples = new ArrayList<>();
718  for( BlePMDClient.EcgData.EcgSample s : ecgData.ecgSamples ){
719  samples.add(s.microVolts);
720  }
721  return new PolarEcgData(samples,ecgData.timeStamp);
722  }
723  }).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarEcgData>>() {
724  @Override
725  public Publisher<? extends PolarEcgData> apply(Throwable throwable) throws Exception {
726  return Flowable.error(handleError(throwable));
727  }
728  }).doFinally(new Action() {
729  @Override
730  public void run() throws Exception {
731  stopPmdStreaming(session,client, BlePMDClient.PmdMeasurementType.ECG);
732  }
733  }));
734  } catch (Throwable t){
735  return Flowable.error(t);
736  }
737  }
738 
739  @Override
740  public Flowable<PolarAccelerometerData> startAccStreaming(String identifier,
741  PolarSensorSetting setting) {
742  try {
743  final BleDeviceSession session = sessionPmdClientReady(identifier);
744  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
745  return client.startMeasurement(BlePMDClient.PmdMeasurementType.ACC, setting.map2PmdSettings()).andThen(
746  client.monitorAccNotifications(true).map(new Function<BlePMDClient.AccData, PolarAccelerometerData>() {
747  @Override
748  public PolarAccelerometerData apply(BlePMDClient.AccData accData) throws Exception {
749  List<PolarAccelerometerData.PolarAccelerometerSample> samples = new ArrayList<>();
750  for( BlePMDClient.AccData.AccSample s : accData.accSamples ){
751  samples.add(new PolarAccelerometerData.PolarAccelerometerSample(s.x,s.y,s.z));
752  }
753  return new PolarAccelerometerData(samples,accData.timeStamp);
754  }
755  }).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarAccelerometerData>>() {
756  @Override
757  public Publisher<? extends PolarAccelerometerData> apply(Throwable throwable) throws Exception {
758  return Flowable.error(handleError(throwable));
759  }
760  }).doFinally(new Action() {
761  @Override
762  public void run() throws Exception {
763  stopPmdStreaming(session,client, BlePMDClient.PmdMeasurementType.ACC);
764  }
765  }));
766  } catch (Throwable t){
767  return Flowable.error(t);
768  }
769  }
770 
771  @Override
772  public Flowable<PolarOhrPPGData> startOhrPPGStreaming(String identifier,
773  PolarSensorSetting setting) {
774  try {
775  final BleDeviceSession session = sessionPmdClientReady(identifier);
776  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
777  return client.startMeasurement(BlePMDClient.PmdMeasurementType.PPG, setting.map2PmdSettings()).andThen(
778  client.monitorPpgNotifications(true).map(new Function<BlePMDClient.PpgData, PolarOhrPPGData>() {
779  @Override
780  public PolarOhrPPGData apply(BlePMDClient.PpgData ppgData) throws Exception {
781  List<PolarOhrPPGData.PolarOhrPPGSample> samples = new ArrayList<>();
782  for( BlePMDClient.PpgData.PpgSample s : ppgData.ppgSamples ){
783  samples.add(new PolarOhrPPGData.PolarOhrPPGSample(s.ppg0,s.ppg1,s.ppg2,s.ambient,s.ppgDataSamples,s.ambient1,s.status));
784  }
785  return new PolarOhrPPGData(samples,ppgData.timeStamp);
786  }
787  }).doFinally(new Action() {
788  @Override
789  public void run() throws Exception {
790  stopPmdStreaming(session,client, BlePMDClient.PmdMeasurementType.PPG);
791  }
792  })).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarOhrPPGData>>() {
793  @Override
794  public Publisher<? extends PolarOhrPPGData> apply(Throwable throwable) throws Exception {
795  return Flowable.error(handleError(throwable));
796  }
797  });
798  } catch (Throwable t){
799  return Flowable.error(t);
800  }
801  }
802 
803  @Override
804  public Flowable<PolarOhrPPIData> startOhrPPIStreaming(String identifier) {
805  try {
806  final BleDeviceSession session = sessionPmdClientReady(identifier);
807  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
808  return client.startMeasurement(BlePMDClient.PmdMeasurementType.PPI, new BlePMDClient.PmdSetting(new HashMap<BlePMDClient.PmdSetting.PmdSettingType, Integer>())).andThen(
809  client.monitorPpiNotifications(true).map(new Function<BlePMDClient.PpiData, PolarOhrPPIData>() {
810  @Override
811  public PolarOhrPPIData apply(BlePMDClient.PpiData ppiData) throws Exception {
812  List<PolarOhrPPIData.PolarOhrPPISample> samples = new ArrayList<>();
813  for(BlePMDClient.PpiData.PPSample ppSample : ppiData.ppSamples){
814  samples.add(new PolarOhrPPIData.PolarOhrPPISample(ppSample.ppInMs,
815  ppSample.ppErrorEstimate,
816  ppSample.hr,
817  ppSample.blockerBit != 0,
818  ppSample.skinContactStatus != 0,
819  ppSample.skinContactSupported != 0));
820  }
821  return new PolarOhrPPIData(ppiData.timestamp,samples);
822  }
823  }).doFinally(new Action() {
824  @Override
825  public void run() throws Exception {
826  stopPmdStreaming(session,client, BlePMDClient.PmdMeasurementType.PPI);
827  }
828  })).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarOhrPPIData>>() {
829  @Override
830  public Publisher<? extends PolarOhrPPIData> apply(Throwable throwable) throws Exception {
831  return Flowable.error(handleError(throwable));
832  }
833  });
834  } catch (Throwable t){
835  return Flowable.error(t);
836  }
837  }
838 
839  @Override
840  public Flowable<PolarBiozData> startBiozStreaming(final String identifier, PolarSensorSetting setting){
841  try {
842  final BleDeviceSession session = sessionPmdClientReady(identifier);
843  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
844  return client.startMeasurement(BlePMDClient.PmdMeasurementType.BIOZ, setting.map2PmdSettings()).andThen(
845  client.monitorBiozNotifications(true).map(new Function<BlePMDClient.BiozData, PolarBiozData>() {
846  @Override
847  public PolarBiozData apply(BlePMDClient.BiozData biozData) throws Exception {
848  return new PolarBiozData(biozData.timeStamp,biozData.samples,biozData.status);
849  }
850  }).doFinally(new Action() {
851  @Override
852  public void run() throws Exception {
853  stopPmdStreaming(session,client, BlePMDClient.PmdMeasurementType.PPG);
854  }
855  })).onErrorResumeNext(new Function<Throwable, Publisher<? extends PolarBiozData>>() {
856  @Override
857  public Publisher<? extends PolarBiozData> apply(Throwable throwable) throws Exception {
858  return Flowable.error(handleError(throwable));
859  }
860  });
861  } catch (Throwable t){
862  return Flowable.error(t);
863  }
864  }
865 
866  protected BleDeviceSession fetchSession(final String identifier) throws PolarInvalidArgument {
867  if(identifier.matches("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$")){
868  return sessionByAddress(identifier);
869  } else if(identifier.matches("([0-9a-fA-F]){6,8}")) {
870  return sessionByDeviceId(identifier);
871  }
872  throw new PolarInvalidArgument();
873  }
874 
875  protected BleDeviceSession sessionByAddress(final String address) throws PolarInvalidArgument {
876  for ( BleDeviceSession session : listener.deviceSessions() ){
877  if( session.getAddress().equals(address) ){
878  return session;
879  }
880  }
881  return null;
882  }
883 
884  protected BleDeviceSession sessionByDeviceId(final String deviceId) throws PolarInvalidArgument {
885  for ( BleDeviceSession session : listener.deviceSessions() ){
886  if( session.getAdvertisementContent().getPolarDeviceId().equals(deviceId) ){
887  return session;
888  }
889  }
890  return null;
891  }
892 
893  protected BleDeviceSession sessionServiceReady(final String identifier, UUID service) throws Throwable {
894  BleDeviceSession session = fetchSession(identifier);
895  if(session != null){
896  if(session.getSessionState() == BleDeviceSession.DeviceSessionState.SESSION_OPEN) {
897  BleGattBase client = session.fetchClient(service);
898  if (client.isServiceDiscovered()) {
899  return session;
900  }
901  throw new PolarServiceNotAvailable();
902  }
903  throw new PolarDeviceDisconnected();
904  }
905  throw new PolarDeviceNotFound();
906  }
907 
908  public BleDeviceSession sessionPmdClientReady(final String identifier) throws Throwable {
909  BleDeviceSession session = sessionServiceReady(identifier, BlePMDClient.PMD_SERVICE);
910  BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
911  final AtomicInteger pair = client.getNotificationAtomicInteger(BlePMDClient.PMD_CP);
912  final AtomicInteger pairData = client.getNotificationAtomicInteger(BlePMDClient.PMD_DATA);
913  if (pair != null && pairData != null &&
914  pair.get() == BleGattBase.ATT_SUCCESS &&
915  pairData.get() == BleGattBase.ATT_SUCCESS) {
916  return session;
917  }
918  throw new PolarNotificationNotEnabled();
919  }
920 
921  protected BleDeviceSession sessionPsFtpClientReady(final String identifier) throws Throwable {
922  BleDeviceSession session = sessionServiceReady(identifier, BlePsFtpUtils.RFC77_PFTP_SERVICE);
923  BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
924  final AtomicInteger pair = client.getNotificationAtomicInteger(BlePsFtpUtils.RFC77_PFTP_MTU_CHARACTERISTIC);
925  if (pair != null && pair.get() == BleGattBase.ATT_SUCCESS ) {
926  return session;
927  }
928  throw new PolarNotificationNotEnabled();
929  }
930 
931  @SuppressLint("CheckResult")
932  protected void stopPmdStreaming(BleDeviceSession session, BlePMDClient client, BlePMDClient.PmdMeasurementType type) {
933  if( session.getSessionState() == BleDeviceSession.DeviceSessionState.SESSION_OPEN ){
934  // stop streaming
935  client.stopMeasurement(type).subscribe(
936  new Action() {
937  @Override
938  public void run() throws Exception {
939 
940  }
941  },
942  new Consumer<Throwable>() {
943  @Override
944  public void accept(Throwable throwable) throws Exception {
945  logError("failed to stop pmd stream: " + throwable.getLocalizedMessage());
946  }
947  }
948  );
949  }
950  }
951 
952  @SuppressLint("CheckResult")
953  protected void setupDevice(final BleDeviceSession session){
954  final String deviceId = session.getPolarDeviceId().length() != 0 ? session.getPolarDeviceId() : session.getAddress();
955  session.monitorServicesDiscovered(true).observeOn(scheduler).toFlowable().flatMapIterable(
956  new Function<List<UUID>, Iterable<UUID>>() {
957  @Override
958  public Iterable<UUID> apply(List<UUID> uuids) throws Exception {
959  return uuids;
960  }
961  }
962  ).flatMap(new Function<UUID, Publisher<?>>() {
963  @Override
964  public Publisher<?> apply(UUID uuid) throws Exception {
965  if(session.fetchClient(uuid) != null) {
966  if (uuid.equals(BleHrClient.HR_SERVICE)) {
967  if (callback != null) {
968  callback.hrFeatureReady(deviceId);
969  }
970  final BleHrClient client = (BleHrClient) session.fetchClient(BleHrClient.HR_SERVICE);
971  client.observeHrNotifications(true).observeOn(scheduler).subscribe(
972  new Consumer<BleHrClient.HrNotificationData>() {
973  @Override
974  public void accept(BleHrClient.HrNotificationData hrNotificationData) throws Exception {
975  if (callback != null) {
977  new PolarHrData(hrNotificationData.hrValue,
978  hrNotificationData.rrs,
979  hrNotificationData.sensorContact,
980  hrNotificationData.sensorContactSupported,
981  hrNotificationData.rrPresent));
982  }
983  }
984  },
985  new Consumer<Throwable>() {
986  @Override
987  public void accept(Throwable throwable) throws Exception {
988  logError(throwable.getMessage());
989  }
990  },
991  new Action() {
992  @Override
993  public void run() throws Exception {
994 
995  }
996  }
997  );
998  } else if (uuid.equals(BleBattClient.BATTERY_SERVICE)) {
999  BleBattClient client = (BleBattClient) session.fetchClient(BleBattClient.BATTERY_SERVICE);
1000  return client.waitBatteryLevelUpdate(true).observeOn(scheduler).doOnSuccess(new Consumer<Integer>() {
1001  @Override
1002  public void accept(Integer integer) throws Exception {
1003  if (callback != null) {
1004  callback.batteryLevelReceived(deviceId, integer);
1005  }
1006  }
1007  }).toFlowable();
1008  } else if (uuid.equals(BlePMDClient.PMD_SERVICE)) {
1009  final BlePMDClient client = (BlePMDClient) session.fetchClient(BlePMDClient.PMD_SERVICE);
1010  return client.waitNotificationEnabled(BlePMDClient.PMD_CP, true).
1011  concatWith(client.waitNotificationEnabled(BlePMDClient.PMD_DATA, true)).andThen(client.readFeature(true).doOnSuccess(new Consumer<BlePMDClient.PmdFeature>() {
1012  @Override
1013  public void accept(BlePMDClient.PmdFeature pmdFeature) {
1014  if (callback != null) {
1015  if (pmdFeature.ecgSupported) {
1016  callback.ecgFeatureReady(deviceId);
1017  }
1018  if (pmdFeature.accSupported) {
1020  }
1021  if (pmdFeature.ppgSupported) {
1022  callback.ppgFeatureReady(deviceId);
1023  }
1024  if (pmdFeature.ppiSupported) {
1025  callback.ppiFeatureReady(deviceId);
1026  }
1027  if (pmdFeature.bioZSupported) {
1028  callback.biozFeatureReady(deviceId);
1029  }
1030  }
1031  }
1032  })).toFlowable();
1033  } else if (uuid.equals(BleDisClient.DIS_SERVICE)) {
1034  BleDisClient client = (BleDisClient) session.fetchClient(BleDisClient.DIS_SERVICE);
1035  return client.observeDisInfo(true).observeOn(scheduler).doOnNext(new Consumer<Pair<UUID, String>>() {
1036  @Override
1037  public void accept(Pair<UUID, String> pair) {
1038  if (callback != null) {
1039  callback.disInformationReceived(deviceId, pair.first , pair.second);
1040  }
1041  }
1042  });
1043  } else if (uuid.equals(BlePsFtpUtils.RFC77_PFTP_SERVICE)) {
1044  BlePsFtpClient client = (BlePsFtpClient) session.fetchClient(BlePsFtpUtils.RFC77_PFTP_SERVICE);
1045  return client.waitPsFtpClientReady(true).observeOn(scheduler).doOnComplete(new Action() {
1046  @Override
1047  public void run() throws Exception {
1048  if (callback != null &&
1049  (session.getPolarDeviceType().equals("OH1") || session.getPolarDeviceType().equals("H10"))) {
1050  callback.polarFtpFeatureReady(deviceId);
1051  }
1052  }
1053  }).toFlowable();
1054  }
1055  }
1056  return Flowable.empty();
1057  }
1058  }).subscribe(
1059  new Consumer<Object>() {
1060  @Override
1061  public void accept(Object o) throws Exception {
1062 
1063  }
1064  },
1065  new Consumer<Throwable>() {
1066  @Override
1067  public void accept(Throwable throwable) throws Exception {
1068  logError(throwable.getMessage());
1069  }
1070  },
1071  new Action() {
1072  @Override
1073  public void run() throws Exception {
1074  log("complete");
1075  }
1076  });
1077  }
1078 
1079  protected Exception handleError(Throwable throwable) {
1080  if( throwable instanceof BleDisconnected ){
1081  return new PolarDeviceDisconnected();
1082  } else {
1083  return new Exception("Unknown Error: " + throwable.getLocalizedMessage());
1084  }
1085  }
1086 
1087  interface FetchRecursiveCondition {
1088  boolean include(String entry);
1089  }
1090 
1091  protected Flowable<String> fetchRecursively(final BlePsFtpClient client, final String path, final FetchRecursiveCondition condition) {
1092  protocol.PftpRequest.PbPFtpOperation.Builder builder = protocol.PftpRequest.PbPFtpOperation.newBuilder();
1093  builder.setCommand(PftpRequest.PbPFtpOperation.Command.GET);
1094  builder.setPath(path);
1095  return client.request(builder.build().toByteArray()).toFlowable().flatMap(new Function<ByteArrayOutputStream, Publisher<String>>() {
1096  @Override
1097  public Publisher<String> apply(ByteArrayOutputStream byteArrayOutputStream) throws Exception {
1098  PftpResponse.PbPFtpDirectory dir = PftpResponse.PbPFtpDirectory.parseFrom(byteArrayOutputStream.toByteArray());
1099  Set<String> entrys = new HashSet<>();
1100  for( int i=0; i < dir.getEntriesCount(); ++i ){
1101  PftpResponse.PbPFtpEntry entry = dir.getEntries(i);
1102  if( condition.include(entry.getName()) ){
1103  BleUtils.validate(entrys.add(path + entry.getName()),"duplicate entry");
1104  }
1105  }
1106  if(entrys.size()!=0) {
1107  return Flowable.fromIterable(entrys).flatMap(new Function<String, Publisher<String>>() {
1108  @Override
1109  public Publisher<String> apply(String s) {
1110  if (s.endsWith("/")) {
1111  return fetchRecursively(client, s, condition);
1112  } else {
1113  return Flowable.just(s);
1114  }
1115  }
1116  });
1117  }
1118  return Flowable.empty();
1119  }
1120  });
1121  }
1122 
1123  protected void log(final String message) {
1124  if(logger != null){
1125  logger.message("" + message);
1126  }
1127  }
1128 
1129  protected void logError(final String message) {
1130  if(logger != null){
1131  logger.message("Error: "+message);
1132  }
1133  }
1134 }
+
void log(final String message)
+
void polarFtpFeatureReady(@NonNull final String identifier)
+ +
void batteryLevelReceived(@NonNull final String identifier, final int level)
+ +
Single< PolarExerciseData > fetchExercise(String identifier, PolarExerciseEntry entry)
+ +
Completable startRecording(String identifier, String exerciseId, RecordingInterval interval, SampleType type)
+
Completable autoConnectToDevice(final int rssiLimit, final String service, final int timeout, final TimeUnit unit, final String polarDeviceType)
-
void setAutomaticReconnection(boolean disable)
-
Single< PolarSensorSetting > requestAccSettings(String identifier)
-
PolarBleApiCallback callback
-
Exception handleError(Throwable throwable)
+
void setAutomaticReconnection(boolean disable)
+
Single< PolarSensorSetting > requestAccSettings(String identifier)
+
void deviceConnected(@NonNull final PolarDeviceInfo polarDeviceInfo)
+
Exception handleError(Throwable throwable)
-
void accelerometerFeatureReady(@NonNull final String identifier)
-
Flowable< PolarOhrPPIData > startOhrPPIStreaming(String identifier)
+
Flowable< PolarOhrPPIData > startOhrPPIStreaming(String identifier)
+
void hrFeatureReady(@NonNull final String identifier)
- + + -
Flowable< PolarHrBroadcastData > startListenForPolarHrBroadcasts(final Set< String > deviceIds)
- +
Flowable< PolarHrBroadcastData > startListenForPolarHrBroadcasts(final Set< String > deviceIds)
+ -
Flowable< PolarDeviceInfo > searchForDevice()
+
Flowable< PolarDeviceInfo > searchForDevice()
-
void polarFtpFeatureReady(@NonNull final String identifier)
- -
Single< PolarSensorSetting > querySettings(final String identifier, final BlePMDClient.PmdMeasurementType type)
+ +
Single< PolarSensorSetting > querySettings(final String identifier, final BlePMDClient.PmdMeasurementType type)
static final int FEATURE_POLAR_SENSOR_STREAMING
-
void deviceDisconnected(@NonNull final PolarDeviceInfo polarDeviceInfo)
-
void disInformationReceived(@NonNull final String identifier, @NonNull UUID uuid, @NonNull final String value)
-
Map< String, Disposable > connectSubscriptions
-
Single< PolarSensorSetting > requestBiozSettings(final String identifier)
- +
Map< String, Disposable > connectSubscriptions
+
Single< PolarSensorSetting > requestBiozSettings(final String identifier)
+ -
Single< PolarSensorSetting > requestEcgSettings(String identifier)
-
BleDeviceSession sessionServiceReady(final String identifier, UUID service)
-
void ecgFeatureReady(@NonNull final String identifier)
-
Single< Pair< Boolean, String > > requestRecordingStatus(String identifier)
+
Single< PolarSensorSetting > requestEcgSettings(String identifier)
+
BleDeviceSession sessionServiceReady(final String identifier, UUID service)
+
Single< Pair< Boolean, String > > requestRecordingStatus(String identifier)
+
void deviceDisconnected(@NonNull final PolarDeviceInfo polarDeviceInfo)
- +
static final int FEATURE_BATTERY_INFO
-
BleDeviceSession fetchSession(final String identifier)
-
boolean isFeatureReady(final String deviceId, int feature)
-
BleDeviceSession sessionByAddress(final String address)
+
BleDeviceSession fetchSession(final String identifier)
+
void ppiFeatureReady(@NonNull final String identifier)
+
void ppgFeatureReady(@NonNull final String identifier)
+
boolean isFeatureReady(final String deviceId, int feature)
+
BleDeviceSession sessionByAddress(final String address)
-
Flowable< PolarAccelerometerData > startAccStreaming(String identifier, PolarSensorSetting setting)
- -
BDBleApiImpl(final Context context, int features)
-
Single< PolarSensorSetting > requestPpgSettings(String identifier)
+
void blePowerStateChanged(final boolean powered)
+
Flowable< PolarAccelerometerData > startAccStreaming(String identifier, PolarSensorSetting setting)
+ +
BDBleApiImpl(final Context context, int features)
+
Single< PolarSensorSetting > requestPpgSettings(String identifier)
-
BleDeviceSession sessionPmdClientReady(final String identifier)
+
BleDeviceSession sessionPmdClientReady(final String identifier)
-
void deviceConnecting(@NonNull final PolarDeviceInfo polarDeviceInfo)
-
Flowable< String > fetchRecursively(final BlePsFtpClient client, final String path, final FetchRecursiveCondition condition)
-
Completable stopRecording(String identifier)
+
Flowable< String > fetchRecursively(final BlePsFtpClient client, final String path, final FetchRecursiveCondition condition)
+
Completable stopRecording(String identifier)
-
void ppiFeatureReady(@NonNull final String identifier)
+
void biozFeatureReady(@NonNull final String identifier)
+
PolarBleApiCallbackProvider callback
static final int FEATURE_DEVICE_INFO
-
void setupDevice(final BleDeviceSession session)
-
void batteryLevelReceived(@NonNull final String identifier, final int level)
- -
void connectToDevice(final String identifier)
-
Flowable< PolarBiozData > startBiozStreaming(final String identifier, PolarSensorSetting setting)
-
Flowable< PolarExerciseEntry > listExercises(String identifier)
+
void accelerometerFeatureReady(@NonNull final String identifier)
+
void setupDevice(final BleDeviceSession session)
+ +
void connectToDevice(final String identifier)
+
Flowable< PolarBiozData > startBiozStreaming(final String identifier, PolarSensorSetting setting)
+
Flowable< PolarExerciseEntry > listExercises(String identifier)
-
Completable autoConnectToDevice(final int rssiLimit, final String service, final String polarDeviceType)
+
Completable autoConnectToDevice(final int rssiLimit, final String service, final String polarDeviceType)
-
BleDeviceSession sessionByDeviceId(final String deviceId)
-
void setPolarFilter(boolean enable)
+
BleDeviceSession sessionByDeviceId(final String deviceId)
+
void setPolarFilter(boolean enable)
+
void setApiCallback(PolarBleApiCallbackProvider callback)
static final int FEATURE_POLAR_FILE_TRANSFER
-
Completable removeExercise(String identifier, PolarExerciseEntry entry)
-
void ppgFeatureReady(@NonNull final String identifier)
- -
void biozFeatureReady(@NonNull final String identifier)
- -
void stopPmdStreaming(BleDeviceSession session, BlePMDClient client, BlePMDClient.PmdMeasurementType type)
- -
void setApiLogger(@Nullable PolarBleApiLogger logger)
-
Flowable< PolarOhrPPGData > startOhrPPGStreaming(String identifier, PolarSensorSetting setting)
-
Flowable< PolarEcgData > startEcgStreaming(String identifier, PolarSensorSetting setting)
+
Completable removeExercise(String identifier, PolarExerciseEntry entry)
+
void disInformationReceived(@NonNull final String identifier, @NonNull UUID uuid, @NonNull final String value)
+ +
void deviceConnecting(@NonNull final PolarDeviceInfo polarDeviceInfo)
+ +
void stopPmdStreaming(BleDeviceSession session, BlePMDClient client, BlePMDClient.PmdMeasurementType type)
+ +
void setApiLogger(@Nullable PolarBleApiLogger logger)
+
Flowable< PolarOhrPPGData > startOhrPPGStreaming(String identifier, PolarSensorSetting setting)
+
Flowable< PolarEcgData > startEcgStreaming(String identifier, PolarSensorSetting setting)
+
void hrNotificationReceived(@NonNull final String identifier, @NonNull final PolarHrData data)
-
void hrNotificationReceived(@NonNull final String identifier, @NonNull final PolarHrData data)
+
void ecgFeatureReady(@NonNull final String identifier)
-
void hrFeatureReady(@NonNull final String identifier)
-
void setApiCallback(PolarBleApiCallback callback)
-
Completable setLocalTime(String identifier, Calendar cal)
-
void deviceConnected(@NonNull final PolarDeviceInfo polarDeviceInfo)
+
Completable setLocalTime(String identifier, Calendar cal)
-
BleDeviceSession sessionPsFtpClientReady(final String identifier)
-
void logError(final String message)
+
BleDeviceSession sessionPsFtpClientReady(final String identifier)
+
void logError(final String message)
-
void disconnectFromDevice(String identifier)
+
void disconnectFromDevice(String identifier)
diff --git a/polar-sdk-android/docs/html/PolarBiozData_8java_source.html b/polar-sdk-android/docs/html/PolarBiozData_8java_source.html index e33ec596..2d30dfeb 100644 --- a/polar-sdk-android/docs/html/PolarBiozData_8java_source.html +++ b/polar-sdk-android/docs/html/PolarBiozData_8java_source.html @@ -66,8 +66,9 @@
PolarBiozData.java
-Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.api.model;
3 
4 import java.util.List;
5 
9 public class PolarBiozData {
10 
14  public long timeStamp;
15 
19  public List<Integer> samples;
20 
21  public PolarBiozData(long timeStamp, List<Integer> samples) {
22  this.timeStamp = timeStamp;
23  this.samples = samples;
24  }
25 }
-
PolarBiozData(long timeStamp, List< Integer > samples)
+Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.api.model;
3 
4 import java.util.List;
5 
9 public class PolarBiozData {
10 
14  public long timeStamp;
15 
19  public List<Integer> samples;
20  public byte status;
21 
22  public PolarBiozData(long timeStamp, List<Integer> samples, byte status) {
23  this.timeStamp = timeStamp;
24  this.samples = samples;
25  this.status = status;
26  }
27 }
+ +
PolarBiozData(long timeStamp, List< Integer > samples, byte status)
diff --git a/polar-sdk-android/docs/html/PolarBleApiCallbackProvider_8java.html b/polar-sdk-android/docs/html/PolarBleApiCallbackProvider_8java.html new file mode 100644 index 00000000..9af567ec --- /dev/null +++ b/polar-sdk-android/docs/html/PolarBleApiCallbackProvider_8java.html @@ -0,0 +1,97 @@ + + + + + + + +SDK for Polar sensors: PolarBleApiCallbackProvider.java File Reference + + + + + + + + + + + +
+
+ + + + + + +
+
SDK for Polar sensors +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
+
PolarBleApiCallbackProvider.java File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Data Structures

interface  polar.com.sdk.api.PolarBleApiCallbackProvider
 
+ + + +

+Packages

package  polar.com.sdk.api
 
+
+
+ + + + diff --git a/polar-sdk-android/docs/html/PolarBleApiCallbackProvider_8java_source.html b/polar-sdk-android/docs/html/PolarBleApiCallbackProvider_8java_source.html new file mode 100644 index 00000000..95aa7dda --- /dev/null +++ b/polar-sdk-android/docs/html/PolarBleApiCallbackProvider_8java_source.html @@ -0,0 +1,103 @@ + + + + + + + +SDK for Polar sensors: PolarBleApiCallbackProvider.java Source File + + + + + + + + + + + +
+
+ + + + + + +
+
SDK for Polar sensors +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
+
PolarBleApiCallbackProvider.java
+
+
+Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.api;
3 import java.util.UUID;
4 
5 import io.reactivex.annotations.NonNull;
8 
12 public interface PolarBleApiCallbackProvider {
13 
17  void blePowerStateChanged(final boolean powered);
18 
23  void deviceConnected(@NonNull final PolarDeviceInfo polarDeviceInfo);
24 
29  void deviceConnecting(@NonNull final PolarDeviceInfo polarDeviceInfo);
30 
36  void deviceDisconnected(@NonNull final PolarDeviceInfo polarDeviceInfo);
37 
43  void ecgFeatureReady(@NonNull final String identifier);
44 
50  void accelerometerFeatureReady(@NonNull final String identifier);
51 
57  void ppgFeatureReady(@NonNull final String identifier);
58 
64  void ppiFeatureReady(@NonNull final String identifier);
65 
70  void biozFeatureReady(@NonNull final String identifier);
71 
76  void hrFeatureReady(@NonNull final String identifier);
77 
85  void disInformationReceived(@NonNull final String identifier, @NonNull UUID uuid, @NonNull final String value);
86 
93  void batteryLevelReceived(@NonNull final String identifier, final int level);
94 
101  void hrNotificationReceived(@NonNull final String identifier,@NonNull final PolarHrData data);
102 
108  void polarFtpFeatureReady(@NonNull final String identifier);
109 }
void polarFtpFeatureReady(@NonNull final String identifier)
+
void batteryLevelReceived(@NonNull final String identifier, final int level)
+
void deviceConnected(@NonNull final PolarDeviceInfo polarDeviceInfo)
+ +
void hrFeatureReady(@NonNull final String identifier)
+ + + +
void deviceDisconnected(@NonNull final PolarDeviceInfo polarDeviceInfo)
+
void ppiFeatureReady(@NonNull final String identifier)
+
void ppgFeatureReady(@NonNull final String identifier)
+ +
void blePowerStateChanged(final boolean powered)
+ + +
void biozFeatureReady(@NonNull final String identifier)
+
void accelerometerFeatureReady(@NonNull final String identifier)
+
void disInformationReceived(@NonNull final String identifier, @NonNull UUID uuid, @NonNull final String value)
+
void deviceConnecting(@NonNull final PolarDeviceInfo polarDeviceInfo)
+
void hrNotificationReceived(@NonNull final String identifier, @NonNull final PolarHrData data)
+
void ecgFeatureReady(@NonNull final String identifier)
+ +
+
+ + + + diff --git a/polar-sdk-android/docs/html/PolarBleApiCallback_8java_source.html b/polar-sdk-android/docs/html/PolarBleApiCallback_8java_source.html index 97153d7a..47c36c52 100644 --- a/polar-sdk-android/docs/html/PolarBleApiCallback_8java_source.html +++ b/polar-sdk-android/docs/html/PolarBleApiCallback_8java_source.html @@ -66,9 +66,10 @@
PolarBleApiCallback.java
-Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.api;
3 
4 import java.util.UUID;
5 
6 import io.reactivex.annotations.NonNull;
9 
13 public abstract class PolarBleApiCallback {
14 
18  public void blePowerStateChanged(final boolean powered) {}
19 
24  public void deviceConnected(@NonNull final PolarDeviceInfo polarDeviceInfo) {}
25 
30  public void deviceConnecting(@NonNull final PolarDeviceInfo polarDeviceInfo) {}
31 
37  public void deviceDisconnected(@NonNull final PolarDeviceInfo polarDeviceInfo) {}
38 
44  public void ecgFeatureReady(@NonNull final String identifier) {}
45 
51  public void accelerometerFeatureReady(@NonNull final String identifier) {}
52 
58  public void ppgFeatureReady(@NonNull final String identifier) {}
59 
65  public void ppiFeatureReady(@NonNull final String identifier) {}
66 
71  public void biozFeatureReady(@NonNull final String identifier) {}
72 
77  public void hrFeatureReady(@NonNull final String identifier) {}
78 
86  public void disInformationReceived(@NonNull final String identifier, @NonNull UUID uuid, @NonNull final String value) {}
87 
94  public void batteryLevelReceived(@NonNull final String identifier, final int level) {}
95 
102  public void hrNotificationReceived(@NonNull final String identifier,@NonNull final PolarHrData data) {}
103 
109  public void polarFtpFeatureReady(@NonNull final String identifier) {}
110 }
void blePowerStateChanged(final boolean powered)
+Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.api;
3 
4 import java.util.UUID;
5 
6 import io.reactivex.annotations.NonNull;
9 
13 public abstract class PolarBleApiCallback implements PolarBleApiCallbackProvider {
14 
18  public void blePowerStateChanged(final boolean powered) {}
19 
24  public void deviceConnected(@NonNull final PolarDeviceInfo polarDeviceInfo) {}
25 
30  public void deviceConnecting(@NonNull final PolarDeviceInfo polarDeviceInfo) {}
31 
37  public void deviceDisconnected(@NonNull final PolarDeviceInfo polarDeviceInfo) {}
38 
44  public void ecgFeatureReady(@NonNull final String identifier) {}
45 
51  public void accelerometerFeatureReady(@NonNull final String identifier) {}
52 
58  public void ppgFeatureReady(@NonNull final String identifier) {}
59 
65  public void ppiFeatureReady(@NonNull final String identifier) {}
66 
71  public void biozFeatureReady(@NonNull final String identifier) {}
72 
77  public void hrFeatureReady(@NonNull final String identifier) {}
78 
86  public void disInformationReceived(@NonNull final String identifier, @NonNull UUID uuid, @NonNull final String value) {}
87 
94  public void batteryLevelReceived(@NonNull final String identifier, final int level) {}
95 
102  public void hrNotificationReceived(@NonNull final String identifier,@NonNull final PolarHrData data) {}
103 
109  public void polarFtpFeatureReady(@NonNull final String identifier) {}
110 }
void blePowerStateChanged(final boolean powered)
void accelerometerFeatureReady(@NonNull final String identifier)
+
void polarFtpFeatureReady(@NonNull final String identifier)
void deviceDisconnected(@NonNull final PolarDeviceInfo polarDeviceInfo)
diff --git a/polar-sdk-android/docs/html/PolarBleApiDefaultImpl_8java_source.html b/polar-sdk-android/docs/html/PolarBleApiDefaultImpl_8java_source.html index b7fbdd22..b012814b 100644 --- a/polar-sdk-android/docs/html/PolarBleApiDefaultImpl_8java_source.html +++ b/polar-sdk-android/docs/html/PolarBleApiDefaultImpl_8java_source.html @@ -66,7 +66,7 @@
PolarBleApiDefaultImpl.java
-Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.api;
3 
4 import android.content.Context;
5 
6 import com.androidcommunications.polar.api.ble.BleRefApiVersion;
7 
9 
13 public class PolarBleApiDefaultImpl {
20  public static PolarBleApi defaultImplementation(final Context context, int features){
21  return new BDBleApiImpl(context,features);
22  }
23 
27  public static String versionInfo(){
28  return "2.1.0";
29  }
30 }
+Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.api;
3 
4 import android.content.Context;
5 
6 import com.androidcommunications.polar.api.ble.BleRefApiVersion;
7 
9 
13 public class PolarBleApiDefaultImpl {
20  public static PolarBleApi defaultImplementation(final Context context, int features){
21  return new BDBleApiImpl(context,features);
22  }
23 
27  public static String versionInfo(){
28  return "2.2.1";
29  }
30 }
diff --git a/polar-sdk-android/docs/html/PolarBleApi_8java_source.html b/polar-sdk-android/docs/html/PolarBleApi_8java_source.html index 91673c1e..45853a2f 100644 --- a/polar-sdk-android/docs/html/PolarBleApi_8java_source.html +++ b/polar-sdk-android/docs/html/PolarBleApi_8java_source.html @@ -66,19 +66,19 @@
PolarBleApi.java
-Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.api;
3 
4 import android.support.annotation.Nullable;
5 import android.support.annotation.Size;
6 import android.util.Pair;
7 
8 import java.util.Calendar;
9 import java.util.Date;
10 import java.util.Set;
11 import java.util.concurrent.TimeUnit;
12 
13 import io.reactivex.Completable;
14 import io.reactivex.Flowable;
15 import io.reactivex.Single;
16 import io.reactivex.annotations.NonNull;
28 
32 public abstract class PolarBleApi {
33 
37  public interface PolarBleApiLogger {
42  void message(final String str);
43  }
44 
48  public enum RecordingInterval {
52  private int value;
53 
54  RecordingInterval(int value) {
55  this.value = value;
56  }
57 
58  public int getValue() {
59  return value;
60  }
61  }
62 
66  public enum SampleType {
67  HR,
68  RR;
69  }
70 
74  public static final int FEATURE_HR = 1;
78  public static final int FEATURE_DEVICE_INFO = 2;
82  public static final int FEATURE_BATTERY_INFO = 4;
86  public static final int FEATURE_POLAR_SENSOR_STREAMING = 8;
90  public static final int FEATURE_POLAR_FILE_TRANSFER = 16;
94  public static final int ALL_FEATURES = 0xff;
95 
96  protected int features;
97 
102  protected PolarBleApi(final int features) {
103  this.features = features;
104  }
105 
109  public abstract void shutDown();
110 
114  public abstract void cleanup();
115 
120  public abstract void setPolarFilter(boolean enable);
121 
128  public abstract boolean isFeatureReady(@NonNull final String deviceId, final int feature);
129 
133  public abstract void backgroundEntered();
134 
138  public abstract void foregroundEntered();
139 
143  public abstract void setApiCallback(@Nullable PolarBleApiCallback callback);
144 
148  public abstract void setApiLogger(@Nullable PolarBleApiLogger logger);
149 
154  public abstract void setAutomaticReconnection(boolean enable);
155 
163  public abstract Completable setLocalTime(@NonNull final String identifier, @NonNull Calendar calendar);
164 
170  public abstract Single<PolarSensorSetting> requestAccSettings(@NonNull final String identifier);
171 
177  public abstract Single<PolarSensorSetting> requestEcgSettings(@NonNull final String identifier);
178 
184  public abstract Single<PolarSensorSetting> requestPpgSettings(@NonNull final String identifier);
185 
186  public abstract Single<PolarSensorSetting> requestBiozSettings(@NonNull final String identifier);
187 
199  public abstract Completable autoConnectToDevice(int rssiLimit, @Nullable String service, int timeout,@NonNull TimeUnit unit,@Nullable final String polarDeviceType);
200  public abstract Completable autoConnectToDevice(int rssiLimit, @Nullable String service, final String polarDeviceType);
201 
207  public abstract void connectToDevice(@NonNull final String identifier) throws PolarInvalidArgument;
208 
214  public abstract void disconnectFromDevice(@NonNull final String identifier) throws PolarInvalidArgument;
215 
224  public abstract Completable startRecording(@NonNull final String identifier,
225  @NonNull @Size(min = 1, max = 64) final String exerciseId,
226  @NonNull RecordingInterval interval,
227  @NonNull SampleType type);
228 
234  public abstract Completable stopRecording(@NonNull final String identifier);
235 
241  public abstract Single<Pair<Boolean,String>> requestRecordingStatus(@NonNull final String identifier);
242 
248  public abstract Flowable<PolarExerciseEntry> listExercises(@NonNull final String identifier);
249 
256  public abstract Single<PolarExerciseData> fetchExercise(@NonNull final String identifier, @NonNull final PolarExerciseEntry entry);
257 
264  public abstract Completable removeExercise(@NonNull final String identifier, @NonNull final PolarExerciseEntry entry);
265 
274  public abstract Flowable<PolarDeviceInfo> searchForDevice();
275 
285  public abstract Flowable<PolarHrBroadcastData> startListenForPolarHrBroadcasts(@Nullable final Set<String> deviceIds);
286 
299  public abstract Flowable<PolarEcgData> startEcgStreaming(@NonNull final String identifier,
300  @NonNull PolarSensorSetting sensorSetting);
301 
314  public abstract Flowable<PolarAccelerometerData> startAccStreaming(@NonNull final String identifier,
315  @NonNull PolarSensorSetting sensorSetting);
316 
329  public abstract Flowable<PolarOhrPPGData> startOhrPPGStreaming(@NonNull final String identifier,
330  @NonNull PolarSensorSetting sensorSetting);
331 
332  public abstract Flowable<PolarBiozData> startBiozStreaming(@NonNull final String identifier,
333  @NonNull PolarSensorSetting sensorSetting);
334 
345  public abstract Flowable<PolarOhrPPIData> startOhrPPIStreaming(@NonNull final String identifier);
346 }
+Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.api;
3 
4 import android.support.annotation.Nullable;
5 import android.support.annotation.Size;
6 import android.util.Pair;
7 
8 import java.util.Calendar;
9 import java.util.Date;
10 import java.util.Set;
11 import java.util.concurrent.TimeUnit;
12 
13 import io.reactivex.Completable;
14 import io.reactivex.Flowable;
15 import io.reactivex.Single;
16 import io.reactivex.annotations.NonNull;
28 
32 public abstract class PolarBleApi {
33 
37  public interface PolarBleApiLogger {
42  void message(final String str);
43  }
44 
48  public enum RecordingInterval {
52  private int value;
53 
54  RecordingInterval(int value) {
55  this.value = value;
56  }
57 
58  public int getValue() {
59  return value;
60  }
61  }
62 
66  public enum SampleType {
67  HR,
68  RR;
69  }
70 
74  public static final int FEATURE_HR = 1;
78  public static final int FEATURE_DEVICE_INFO = 2;
82  public static final int FEATURE_BATTERY_INFO = 4;
86  public static final int FEATURE_POLAR_SENSOR_STREAMING = 8;
90  public static final int FEATURE_POLAR_FILE_TRANSFER = 16;
94  public static final int ALL_FEATURES = 0xff;
95 
96  protected int features;
97 
102  protected PolarBleApi(final int features) {
103  this.features = features;
104  }
105 
109  public abstract void shutDown();
110 
114  public abstract void cleanup();
115 
120  public abstract void setPolarFilter(boolean enable);
121 
128  public abstract boolean isFeatureReady(@NonNull final String deviceId, final int feature);
129 
133  public abstract void backgroundEntered();
134 
138  public abstract void foregroundEntered();
139 
143  public abstract void setApiCallback(@Nullable PolarBleApiCallbackProvider callback);
144 
148  public abstract void setApiLogger(@Nullable PolarBleApiLogger logger);
149 
154  public abstract void setAutomaticReconnection(boolean enable);
155 
163  public abstract Completable setLocalTime(@NonNull final String identifier, @NonNull Calendar calendar);
164 
170  public abstract Single<PolarSensorSetting> requestAccSettings(@NonNull final String identifier);
171 
177  public abstract Single<PolarSensorSetting> requestEcgSettings(@NonNull final String identifier);
178 
184  public abstract Single<PolarSensorSetting> requestPpgSettings(@NonNull final String identifier);
185 
186  public abstract Single<PolarSensorSetting> requestBiozSettings(@NonNull final String identifier);
187 
199  public abstract Completable autoConnectToDevice(int rssiLimit, @Nullable String service, int timeout,@NonNull TimeUnit unit,@Nullable final String polarDeviceType);
200  public abstract Completable autoConnectToDevice(int rssiLimit, @Nullable String service, final String polarDeviceType);
201 
207  public abstract void connectToDevice(@NonNull final String identifier) throws PolarInvalidArgument;
208 
214  public abstract void disconnectFromDevice(@NonNull final String identifier) throws PolarInvalidArgument;
215 
224  public abstract Completable startRecording(@NonNull final String identifier,
225  @NonNull @Size(min = 1, max = 64) final String exerciseId,
226  @NonNull RecordingInterval interval,
227  @NonNull SampleType type);
228 
234  public abstract Completable stopRecording(@NonNull final String identifier);
235 
241  public abstract Single<Pair<Boolean,String>> requestRecordingStatus(@NonNull final String identifier);
242 
248  public abstract Flowable<PolarExerciseEntry> listExercises(@NonNull final String identifier);
249 
256  public abstract Single<PolarExerciseData> fetchExercise(@NonNull final String identifier, @NonNull final PolarExerciseEntry entry);
257 
264  public abstract Completable removeExercise(@NonNull final String identifier, @NonNull final PolarExerciseEntry entry);
265 
274  public abstract Flowable<PolarDeviceInfo> searchForDevice();
275 
285  public abstract Flowable<PolarHrBroadcastData> startListenForPolarHrBroadcasts(@Nullable final Set<String> deviceIds);
286 
299  public abstract Flowable<PolarEcgData> startEcgStreaming(@NonNull final String identifier,
300  @NonNull PolarSensorSetting sensorSetting);
301 
314  public abstract Flowable<PolarAccelerometerData> startAccStreaming(@NonNull final String identifier,
315  @NonNull PolarSensorSetting sensorSetting);
316 
329  public abstract Flowable<PolarOhrPPGData> startOhrPPGStreaming(@NonNull final String identifier,
330  @NonNull PolarSensorSetting sensorSetting);
331 
332  public abstract Flowable<PolarBiozData> startBiozStreaming(@NonNull final String identifier,
333  @NonNull PolarSensorSetting sensorSetting);
334 
345  public abstract Flowable<PolarOhrPPIData> startOhrPPIStreaming(@NonNull final String identifier);
346 }
abstract Single< PolarSensorSetting > requestEcgSettings(@NonNull final String identifier)
abstract Flowable< PolarOhrPPIData > startOhrPPIStreaming(@NonNull final String identifier)
abstract Flowable< PolarAccelerometerData > startAccStreaming(@NonNull final String identifier, @NonNull PolarSensorSetting sensorSetting)
+
abstract void disconnectFromDevice(@NonNull final String identifier)
abstract void setApiLogger(@Nullable PolarBleApiLogger logger)
abstract Completable stopRecording(@NonNull final String identifier)
-
abstract Single< PolarSensorSetting > requestAccSettings(@NonNull final String identifier)
abstract void setAutomaticReconnection(boolean enable)
abstract void connectToDevice(@NonNull final String identifier)
@@ -91,7 +91,7 @@
abstract boolean isFeatureReady(@NonNull final String deviceId, final int feature)
- +
static final int FEATURE_BATTERY_INFO
@@ -118,6 +118,7 @@
abstract Completable removeExercise(@NonNull final String identifier, @NonNull final PolarExerciseEntry entry)
+
abstract void setApiCallback(@Nullable PolarBleApiCallbackProvider callback)
abstract Flowable< PolarDeviceInfo > searchForDevice()
static final int FEATURE_POLAR_FILE_TRANSFER
abstract Flowable< PolarEcgData > startEcgStreaming(@NonNull final String identifier, @NonNull PolarSensorSetting sensorSetting)
@@ -129,7 +130,6 @@ -
abstract void setApiCallback(@Nullable PolarBleApiCallback callback)
abstract Flowable< PolarBiozData > startBiozStreaming(@NonNull final String identifier, @NonNull PolarSensorSetting sensorSetting)
diff --git a/polar-sdk-android/docs/html/PolarOhrPPGData_8java_source.html b/polar-sdk-android/docs/html/PolarOhrPPGData_8java_source.html index 0b48c019..2599a9fe 100644 --- a/polar-sdk-android/docs/html/PolarOhrPPGData_8java_source.html +++ b/polar-sdk-android/docs/html/PolarOhrPPGData_8java_source.html @@ -66,10 +66,10 @@
PolarOhrPPGData.java
-Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.api.model;
3 
4 import java.util.List;
5 
9 public class PolarOhrPPGData {
10 
14  public static class PolarOhrPPGSample {
18  public int ppg0;
22  public int ppg1;
26  public int ppg2;
30  public int ambient;
31 
32  public PolarOhrPPGSample(int ppg0, int ppg1, int ppg2, int ambient) {
33  this.ppg0 = ppg0;
34  this.ppg1 = ppg1;
35  this.ppg2 = ppg2;
36  this.ambient = ambient;
37  }
38  }
39 
43  public List<PolarOhrPPGSample> samples;
44 
48  public long timeStamp;
49 
55  public PolarOhrPPGData(List<PolarOhrPPGSample> samples, long timeStamp) {
56  this.samples = samples;
57  this.timeStamp = timeStamp;
58  }
59 }
- - -
PolarOhrPPGData(List< PolarOhrPPGSample > samples, long timeStamp)
+Go to the documentation of this file.
1 // Copyright © 2019 Polar Electro Oy. All rights reserved.
2 package polar.com.sdk.api.model;
3 
4 import java.util.ArrayList;
5 import java.util.List;
6 
10 public class PolarOhrPPGData {
11 
15  public static class PolarOhrPPGSample {
19  public int ppg0;
23  public int ppg1;
27  public int ppg2;
31  public int ambient;
32 
33  public List<Integer> ppgDataSamples;
34  public int ambient2;
35  public long status;
36 
37  public PolarOhrPPGSample(int ppg0, int ppg1, int ppg2, int ambient) {
38  this.ppg0 = ppg0;
39  this.ppg1 = ppg1;
40  this.ppg2 = ppg2;
41  this.ambient = ambient;
42  this.ppgDataSamples = new ArrayList<>();
43  this.ambient2 = 0;
44  }
45 
46  public PolarOhrPPGSample(int ppg0, int ppg1, int ppg2, int ambient, List<Integer> ppgDataSamples, int ambient2, long status) {
47  this.ppg0 = ppg0;
48  this.ppg1 = ppg1;
49  this.ppg2 = ppg2;
50  this.ambient = ambient;
51  this.ppgDataSamples = ppgDataSamples;
52  this.ambient2 = ambient2;
53  this.status = status;
54  }
55  }
56 
60  public List<PolarOhrPPGSample> samples;
61 
65  public long timeStamp;
66 
72  public PolarOhrPPGData(List<PolarOhrPPGSample> samples, long timeStamp) {
73  this.samples = samples;
74  this.timeStamp = timeStamp;
75  }
76 }
+ + +
PolarOhrPPGData(List< PolarOhrPPGSample > samples, long timeStamp)
diff --git a/polar-sdk-android/docs/html/annotated.html b/polar-sdk-android/docs/html/annotated.html index e3873b17..7295149a 100644 --- a/polar-sdk-android/docs/html/annotated.html +++ b/polar-sdk-android/docs/html/annotated.html @@ -98,9 +98,10 @@  CRecordingInterval  CSampleType  CPolarBleApiCallback - CPolarBleApiDefaultImpl - Nimpl - CBDBleApiImpl + CPolarBleApiCallbackProvider + CPolarBleApiDefaultImpl + Nimpl + CBDBleApiImpl
diff --git a/polar-sdk-android/docs/html/classes.html b/polar-sdk-android/docs/html/classes.html index 139fbf3d..f6ce649a 100644 --- a/polar-sdk-android/docs/html/classes.html +++ b/polar-sdk-android/docs/html/classes.html @@ -69,18 +69,16 @@
b | p | r | s
- - + + - - - - - + + + +
  b  
-
PolarBleApi (polar.com.sdk.api)   PolarDeviceNotFound (polar.com.sdk.api.errors)   PolarNotificationNotEnabled (polar.com.sdk.api.errors)   
  s  
+
PolarBleApi (polar.com.sdk.api)   PolarDeviceNotConnected (polar.com.sdk.api.errors)   PolarInvalidArgument (polar.com.sdk.api.errors)   
  r  
PolarBleApiCallback (polar.com.sdk.api)   PolarEcgData (polar.com.sdk.api.model)   PolarOhrPPGData (polar.com.sdk.api.model)   
BDBleApiImpl (polar.com.sdk.impl)   PolarBleApiDefaultImpl (polar.com.sdk.api)   PolarExerciseData (polar.com.sdk.api.model)   PolarOhrPPIData (polar.com.sdk.api.model)   PolarBleApi.SampleType (polar.com.sdk.api)   
PolarBleApiCallback (polar.com.sdk.api)   PolarDeviceNotFound (polar.com.sdk.api.errors)   PolarNotificationNotEnabled (polar.com.sdk.api.errors)   
BDBleApiImpl (polar.com.sdk.impl)   PolarBleApiCallbackProvider (polar.com.sdk.api)   PolarEcgData (polar.com.sdk.api.model)   PolarOhrPPGData (polar.com.sdk.api.model)   PolarBleApi.RecordingInterval (polar.com.sdk.api)   
  p  
-
PolarBleApi.PolarBleApiLogger (polar.com.sdk.api)   PolarExerciseEntry (polar.com.sdk.api.model)   PolarOperationNotSupported (polar.com.sdk.api.errors)   PolarSensorSetting.SettingType (polar.com.sdk.api.model)   
PolarDeviceDisconnected (polar.com.sdk.api.errors)   PolarHrBroadcastData (polar.com.sdk.api.model)   PolarSensorSetting (polar.com.sdk.api.model)   
PolarAccelerometerData (polar.com.sdk.api.model)   PolarDeviceInfo (polar.com.sdk.api.model)   PolarHrData (polar.com.sdk.api.model)   PolarServiceNotAvailable (polar.com.sdk.api.errors)   
PolarBiozData (polar.com.sdk.api.model)   PolarDeviceNotConnected (polar.com.sdk.api.errors)   PolarInvalidArgument (polar.com.sdk.api.errors)   
  r  
-
PolarBleApi.RecordingInterval (polar.com.sdk.api)   
PolarBleApiDefaultImpl (polar.com.sdk.api)   PolarExerciseData (polar.com.sdk.api.model)   PolarOhrPPIData (polar.com.sdk.api.model)   
  s  
+
PolarBleApi.PolarBleApiLogger (polar.com.sdk.api)   PolarExerciseEntry (polar.com.sdk.api.model)   PolarOperationNotSupported (polar.com.sdk.api.errors)   
PolarAccelerometerData (polar.com.sdk.api.model)   PolarDeviceDisconnected (polar.com.sdk.api.errors)   PolarHrBroadcastData (polar.com.sdk.api.model)   PolarSensorSetting (polar.com.sdk.api.model)   PolarBleApi.SampleType (polar.com.sdk.api)   
PolarBiozData (polar.com.sdk.api.model)   PolarDeviceInfo (polar.com.sdk.api.model)   PolarHrData (polar.com.sdk.api.model)   PolarServiceNotAvailable (polar.com.sdk.api.errors)   PolarSensorSetting.SettingType (polar.com.sdk.api.model)   
b | p | r | s
diff --git a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html index 127f9980..d1d63379 100644 --- a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html +++ b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html @@ -105,8 +105,8 @@   abstract void foregroundEntered ()   -abstract void setApiCallback (@Nullable PolarBleApiCallback callback) -  +abstract void setApiCallback (@Nullable PolarBleApiCallbackProvider callback) +  abstract void setApiLogger (@Nullable PolarBleApiLogger logger)   abstract void setAutomaticReconnection (boolean enable) @@ -836,8 +836,8 @@

-

◆ setApiCallback()

+ +

◆ setApiCallback()

diff --git a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.js b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.js index 53323f99..20aa8837 100644 --- a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.js +++ b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.js @@ -21,7 +21,7 @@ var classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi = [ "requestPpgSettings", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#ae34d02d96a9fac60edde6d7b3f61a2d5", null ], [ "requestRecordingStatus", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a2f95d2c9b7c9963c3b7fa5d7c2949e43", null ], [ "searchForDevice", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#acdbb4f7379e431ed53dec08e99657679", null ], - [ "setApiCallback", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a4682d9318c9ac41927694421bde349a5", null ], + [ "setApiCallback", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a352c7cf35ca7e19e891f4eb7c53940c0", null ], [ "setApiLogger", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#ac92b34d91563bb7a208818dd4358b260", null ], [ "setAutomaticReconnection", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a32484f5b3bacdde45573298a4e1d12a5", null ], [ "setLocalTime", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#ac8923ad69235615e62262a25115a01b9", null ], diff --git a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.html b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.html index 200d1642..caf9f764 100644 --- a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.html +++ b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.html @@ -68,6 +68,15 @@
polar.com.sdk.api.PolarBleApiCallback Class Referenceabstract

+
+Inheritance diagram for polar.com.sdk.api.PolarBleApiCallback:
+
+
+ + +polar.com.sdk.api.PolarBleApiCallbackProvider + +
@@ -135,6 +144,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 51 of file PolarBleApiCallback.java.

@@ -180,6 +191,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 94 of file PolarBleApiCallback.java.

@@ -214,6 +227,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 71 of file PolarBleApiCallback.java.

@@ -248,6 +263,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 18 of file PolarBleApiCallback.java.

@@ -282,6 +299,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 24 of file PolarBleApiCallback.java.

@@ -316,6 +335,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 30 of file PolarBleApiCallback.java.

@@ -350,6 +371,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 37 of file PolarBleApiCallback.java.

@@ -402,6 +425,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 86 of file PolarBleApiCallback.java.

@@ -436,6 +461,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 44 of file PolarBleApiCallback.java.

@@ -470,6 +497,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 77 of file PolarBleApiCallback.java.

@@ -516,6 +545,8 @@

See also
polar.com.sdk.api.model.PolarHrData.java
+

Implements polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 102 of file PolarBleApiCallback.java.

@@ -550,6 +581,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 109 of file PolarBleApiCallback.java.

@@ -584,6 +617,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 58 of file PolarBleApiCallback.java.

@@ -618,6 +653,8 @@

polar.com.sdk.api.PolarBleApiCallbackProvider.

+

Definition at line 65 of file PolarBleApiCallback.java.

diff --git a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.png b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.png new file mode 100644 index 0000000000000000000000000000000000000000..cb343ace890e5cc41ea9b350a8ec6b095fafb43d GIT binary patch literal 1053 zcmeAS@N?(olHy`uVBq!ia0y~yV3Y*112~w0q}02Qra(#}z$e7@|Ns9$=8HF9OZyK^ z0J6aNz<~p-opcKrWsZr5|9;^e1ESl>VX;K|EPla{Qh@ArwiIjx8D(zFTL zJ>n^GdM_ns&i=nu_W5k}=ksoSt=T6qd1u-(mEWru@>ET`rZH*fx1IfQ@+@kJ8u|&d zcFlR`fB1({(QDZhw+Uaaznt!DyNEaK@Arv`H#+PrCVzBG+~(;erB}FI{k`Scf0dhN z{5@O|pTAyFWX1|I#b$|T?mBe(?D*{V?PZ?Pa?eS2>-k;( z?PO8S426aC+#Z#wz>wY>022TOeO^l6V+*h2g))&0``zLhR2w{9*$%vTz4`*f8Z9FR zH*D!YB4YtiB?XfEyM40PPL0aW z72;jMG6Bul`pIX?4e#x{U0c;>zpi=iMbp`B*V|Q(o%`Nf`saJfrBmBdd?uKFH9h7( zY3JU8+~blT?@a&q6eTVETD2xnrTD6={9Zc_pF;t04zrkUyfU4+aRo3Hh^N2%e^*#C z`1yO~!y6K73)CJ1BbRwnoA;WIlhuBoORw$;G%kKHA@q%~=4=a52c6^Ed!(&SW{IRp zCzymgo>F~#MI)_Y?LNn}tTz7>J&z}yv{72aleYgz)|CU6dls0mt^88;@vp$lDQ~!q z_BCuz-Erh(+CDknnX2NCzcpUo^48e@!cRM6XA|w($v*#cUMj0i=Uq^Lukr0&ky(qf zf9>?{|9<#w(f>&4)5kPq=N8O3ez*APgujRD^b~z^$glQR;+2FLR!GQ%;4$j=d#Wzp$Pz)x#C~| literal 0 HcmV?d00001 diff --git a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html index d6913fad..1b2226e7 100644 --- a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html +++ b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html @@ -72,8 +72,8 @@

Public Member Functions

- - + +

Public Member Functions

 PolarBiozData (long timeStamp, List< Integer > samples)
 
 PolarBiozData (long timeStamp, List< Integer > samples, byte status)
 
@@ -81,14 +81,16 @@ + +

Data Fields

 
List< Integer > samples
 
byte status
 

Detailed Description

For bioz data

Definition at line 9 of file PolarBiozData.java.

Constructor & Destructor Documentation

- -

◆ PolarBiozData()

+ +

◆ PolarBiozData()

@@ -141,6 +149,22 @@

Definition at line 19 of file PolarBiozData.java.

+

+ + +

◆ status

+ +
+
+ + + + +
byte polar.com.sdk.api.model.PolarBiozData.status
+
+ +

Definition at line 20 of file PolarBiozData.java.

+
diff --git a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.js b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.js index 0519db49..c079c855 100644 --- a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.js +++ b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.js @@ -1,6 +1,7 @@ var classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData = [ - [ "PolarBiozData", "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html#a73ace427af9328e21ff151fbf06f0e7a", null ], + [ "PolarBiozData", "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html#a22ac1739749274ff4076dd8a5572b935", null ], [ "samples", "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html#a829694108df47c3f5276f2dd845f398a", null ], + [ "status", "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html#ae71748c202067f3e082b08d62cba409c", null ], [ "timeStamp", "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html#a8bb9752d020c3b3948ed97c334fc3858", null ] ]; \ No newline at end of file diff --git a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarExerciseData.html b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarExerciseData.html index 03ad5b85..4955089a 100644 --- a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarExerciseData.html +++ b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarExerciseData.html @@ -137,7 +137,7 @@

-

HR samples in BPM.

+

HR or RR samples.

Definition at line 17 of file PolarExerciseData.java.

diff --git a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarOhrPPGData.html b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarOhrPPGData.html index 570dd4ec..97446d1c 100644 --- a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarOhrPPGData.html +++ b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarOhrPPGData.html @@ -91,7 +91,7 @@

Detailed Description

For photoplethysmography data.

-

Definition at line 9 of file PolarOhrPPGData.java.

+

Definition at line 10 of file PolarOhrPPGData.java.

Constructor & Destructor Documentation

◆ PolarOhrPPGData()

@@ -134,7 +134,7 @@

Definition at line 55 of file PolarOhrPPGData.java.

+

Definition at line 72 of file PolarOhrPPGData.java.

@@ -152,7 +152,7 @@

PPG samples list. Each sample contains signed LED in ppg0, LED in ppg1, LED in ppg2 and ambient light value

-

Definition at line 43 of file PolarOhrPPGData.java.

+

Definition at line 60 of file PolarOhrPPGData.java.

@@ -169,7 +169,7 @@

Last sample timestamp in nanoseconds

-

Definition at line 48 of file PolarOhrPPGData.java.

+

Definition at line 65 of file PolarOhrPPGData.java.

diff --git a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html index 418298e9..548983c6 100644 --- a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html +++ b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html @@ -99,8 +99,8 @@   boolean isFeatureReady (final String deviceId, int feature)   -void setApiCallback (PolarBleApiCallback callback) -  +void setApiCallback (PolarBleApiCallbackProvider callback) +  void setApiLogger (@Nullable PolarBleApiLogger logger)   void setAutomaticReconnection (boolean disable) @@ -168,8 +168,8 @@   abstract void foregroundEntered ()   -abstract void setApiCallback (@Nullable PolarBleApiCallback callback) -  +abstract void setApiCallback (@Nullable PolarBleApiCallbackProvider callback) +  abstract void setApiLogger (@Nullable PolarBleApiLogger logger)   abstract void setAutomaticReconnection (boolean enable) @@ -259,8 +259,8 @@   Scheduler scheduler   -PolarBleApiCallback callback -  +PolarBleApiCallbackProvider callbackPolarBleApiLogger logger   - Protected Attributes inherited from polar.com.sdk.api.PolarBleApi @@ -293,7 +293,7 @@

Detailed Description

The default implementation of the Polar API

-

Definition at line 92 of file BDBleApiImpl.java.

+

Definition at line 93 of file BDBleApiImpl.java.

Constructor & Destructor Documentation

◆ BDBleApiImpl()

@@ -329,7 +329,7 @@

-

Definition at line 108 of file BDBleApiImpl.java.

+

Definition at line 109 of file BDBleApiImpl.java.

@@ -386,7 +386,7 @@

-

Definition at line 346 of file BDBleApiImpl.java.

+

Definition at line 347 of file BDBleApiImpl.java.

@@ -430,7 +430,7 @@

-

Definition at line 400 of file BDBleApiImpl.java.

+

Definition at line 401 of file BDBleApiImpl.java.

@@ -457,7 +457,7 @@

-

Definition at line 336 of file BDBleApiImpl.java.

+

Definition at line 337 of file BDBleApiImpl.java.

@@ -484,7 +484,7 @@

-

Definition at line 235 of file BDBleApiImpl.java.

+

Definition at line 236 of file BDBleApiImpl.java.

@@ -512,7 +512,7 @@

-

Definition at line 405 of file BDBleApiImpl.java.

+

Definition at line 406 of file BDBleApiImpl.java.

@@ -540,7 +540,7 @@

-

Definition at line 447 of file BDBleApiImpl.java.

+

Definition at line 448 of file BDBleApiImpl.java.

@@ -567,7 +567,7 @@

-

Definition at line 218 of file BDBleApiImpl.java.

+

Definition at line 219 of file BDBleApiImpl.java.

@@ -605,7 +605,7 @@

-

Definition at line 588 of file BDBleApiImpl.java.

+

Definition at line 589 of file BDBleApiImpl.java.

@@ -649,7 +649,7 @@

-

Definition at line 1086 of file BDBleApiImpl.java.

+

Definition at line 1091 of file BDBleApiImpl.java.

@@ -677,7 +677,7 @@

-

Definition at line 861 of file BDBleApiImpl.java.

+

Definition at line 866 of file BDBleApiImpl.java.

@@ -704,7 +704,7 @@

-

Definition at line 341 of file BDBleApiImpl.java.

+

Definition at line 342 of file BDBleApiImpl.java.

@@ -732,7 +732,7 @@

-

Definition at line 1074 of file BDBleApiImpl.java.

+

Definition at line 1079 of file BDBleApiImpl.java.

@@ -770,7 +770,7 @@

-

Definition at line 249 of file BDBleApiImpl.java.

+

Definition at line 250 of file BDBleApiImpl.java.

@@ -798,7 +798,7 @@

-

Definition at line 532 of file BDBleApiImpl.java.

+

Definition at line 533 of file BDBleApiImpl.java.

@@ -826,7 +826,7 @@

-

Definition at line 1118 of file BDBleApiImpl.java.

+

Definition at line 1123 of file BDBleApiImpl.java.

@@ -854,7 +854,7 @@

-

Definition at line 1124 of file BDBleApiImpl.java.

+

Definition at line 1129 of file BDBleApiImpl.java.

@@ -892,7 +892,7 @@

-

Definition at line 320 of file BDBleApiImpl.java.

+

Definition at line 321 of file BDBleApiImpl.java.

@@ -930,7 +930,7 @@

-

Definition at line 616 of file BDBleApiImpl.java.

+

Definition at line 621 of file BDBleApiImpl.java.

@@ -958,7 +958,7 @@

-

Definition at line 301 of file BDBleApiImpl.java.

+

Definition at line 302 of file BDBleApiImpl.java.

@@ -986,7 +986,7 @@

-

Definition at line 316 of file BDBleApiImpl.java.

+

Definition at line 317 of file BDBleApiImpl.java.

@@ -1014,7 +1014,7 @@

-

Definition at line 306 of file BDBleApiImpl.java.

+

Definition at line 307 of file BDBleApiImpl.java.

@@ -1042,7 +1042,7 @@

-

Definition at line 311 of file BDBleApiImpl.java.

+

Definition at line 312 of file BDBleApiImpl.java.

@@ -1070,7 +1070,7 @@

-

Definition at line 507 of file BDBleApiImpl.java.

+

Definition at line 508 of file BDBleApiImpl.java.

@@ -1097,7 +1097,7 @@

-

Definition at line 665 of file BDBleApiImpl.java.

+

Definition at line 670 of file BDBleApiImpl.java.

@@ -1125,7 +1125,7 @@

-

Definition at line 870 of file BDBleApiImpl.java.

+

Definition at line 875 of file BDBleApiImpl.java.

@@ -1153,7 +1153,7 @@

-

Definition at line 879 of file BDBleApiImpl.java.

+

Definition at line 884 of file BDBleApiImpl.java.

@@ -1181,7 +1181,7 @@

-

Definition at line 903 of file BDBleApiImpl.java.

+

Definition at line 908 of file BDBleApiImpl.java.

@@ -1209,7 +1209,7 @@

-

Definition at line 916 of file BDBleApiImpl.java.

+

Definition at line 921 of file BDBleApiImpl.java.

@@ -1247,12 +1247,12 @@

-

Definition at line 888 of file BDBleApiImpl.java.

+

Definition at line 893 of file BDBleApiImpl.java.

- -

◆ setApiCallback()

+ +

◆ setApiCallback()

@@ -1303,7 +1303,7 @@

-

Definition at line 269 of file BDBleApiImpl.java.

+

Definition at line 270 of file BDBleApiImpl.java.

@@ -1331,7 +1331,7 @@

-

Definition at line 274 of file BDBleApiImpl.java.

+

Definition at line 275 of file BDBleApiImpl.java.

@@ -1369,7 +1369,7 @@

-

Definition at line 279 of file BDBleApiImpl.java.

+

Definition at line 280 of file BDBleApiImpl.java.

@@ -1397,7 +1397,7 @@

-

Definition at line 240 of file BDBleApiImpl.java.

+

Definition at line 241 of file BDBleApiImpl.java.

@@ -1425,7 +1425,7 @@

-

Definition at line 948 of file BDBleApiImpl.java.

+

Definition at line 953 of file BDBleApiImpl.java.

@@ -1452,7 +1452,7 @@

-

Definition at line 230 of file BDBleApiImpl.java.

+

Definition at line 231 of file BDBleApiImpl.java.

@@ -1490,7 +1490,7 @@

-

Definition at line 735 of file BDBleApiImpl.java.

+

Definition at line 740 of file BDBleApiImpl.java.

@@ -1528,7 +1528,7 @@

-

Definition at line 835 of file BDBleApiImpl.java.

+

Definition at line 840 of file BDBleApiImpl.java.

@@ -1566,7 +1566,7 @@

-

Definition at line 703 of file BDBleApiImpl.java.

+

Definition at line 708 of file BDBleApiImpl.java.

@@ -1594,7 +1594,7 @@

-

Definition at line 679 of file BDBleApiImpl.java.

+

Definition at line 684 of file BDBleApiImpl.java.

@@ -1632,7 +1632,7 @@

-

Definition at line 767 of file BDBleApiImpl.java.

+

Definition at line 772 of file BDBleApiImpl.java.

@@ -1660,7 +1660,7 @@

-

Definition at line 799 of file BDBleApiImpl.java.

+

Definition at line 804 of file BDBleApiImpl.java.

@@ -1710,7 +1710,7 @@

-

Definition at line 463 of file BDBleApiImpl.java.

+

Definition at line 464 of file BDBleApiImpl.java.

@@ -1754,7 +1754,7 @@

-

Definition at line 927 of file BDBleApiImpl.java.

+

Definition at line 932 of file BDBleApiImpl.java.

@@ -1782,7 +1782,7 @@

-

Definition at line 488 of file BDBleApiImpl.java.

+

Definition at line 489 of file BDBleApiImpl.java.

@@ -1807,12 +1807,12 @@

-

Definition at line 99 of file BDBleApiImpl.java.

+

Definition at line 100 of file BDBleApiImpl.java.

- -

◆ callback

+ +

◆ callback

@@ -1855,7 +1855,7 @@

-

Definition at line 95 of file BDBleApiImpl.java.

+

Definition at line 96 of file BDBleApiImpl.java.

@@ -1879,7 +1879,7 @@

-

Definition at line 94 of file BDBleApiImpl.java.

+

Definition at line 95 of file BDBleApiImpl.java.

@@ -1903,7 +1903,7 @@

-

Definition at line 98 of file BDBleApiImpl.java.

+

Definition at line 99 of file BDBleApiImpl.java.

@@ -1927,7 +1927,7 @@

-

Definition at line 96 of file BDBleApiImpl.java.

+

Definition at line 97 of file BDBleApiImpl.java.

@@ -1951,7 +1951,7 @@

-

Definition at line 93 of file BDBleApiImpl.java.

+

Definition at line 94 of file BDBleApiImpl.java.

diff --git a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.js b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.js index 7311525e..d45a9eff 100644 --- a/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.js +++ b/polar-sdk-android/docs/html/classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.js @@ -30,7 +30,7 @@ var classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl = [ "sessionPmdClientReady", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a568cbfd6e9548d54fff470a938cbf000", null ], [ "sessionPsFtpClientReady", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#aed83b0c4e2180511a242f1ccedd3d03c", null ], [ "sessionServiceReady", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a647db72c6f3a1cbd7587cac769cf0e2c", null ], - [ "setApiCallback", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ac61c2b578af2d5563ef677172196d04d", null ], + [ "setApiCallback", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a74af3feec0f83aa5acb8846dc2a1d1d6", null ], [ "setApiLogger", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ad239df6d03a59f3a85506346931b52a1", null ], [ "setAutomaticReconnection", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a2c36d4ab6fbdc804df500d2a1d1c0e5d", null ], [ "setLocalTime", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a95d10bce5ba70d0b499f610d761aeabb", null ], @@ -46,7 +46,7 @@ var classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl = [ "startRecording", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a14a4d99e3a14c3e8dd2a9695e25ec9a8", null ], [ "stopPmdStreaming", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a5e80e959cbc19490c9a1963e6914a092", null ], [ "stopRecording", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a4eb11a28590fe41d76fdb88c28894ce2", null ], - [ "callback", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a5ccfe3027f85d5b1262737b1160006b8", null ], + [ "callback", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ae49061dfea23ddf3c13917f9c757d1f2", null ], [ "connectSubscriptions", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ac6df07abc427e5ad2ba3167a2d8c109b", null ], [ "listener", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ac08998b625def30d377e05abb8a80f8d", null ], [ "logger", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#abb45392febb6f61abfe49ef9482f07bb", null ], diff --git a/polar-sdk-android/docs/html/dir_b936df1acb3136008a04b697d550213c.html b/polar-sdk-android/docs/html/dir_b936df1acb3136008a04b697d550213c.html index 60d98d9c..702c5301 100644 --- a/polar-sdk-android/docs/html/dir_b936df1acb3136008a04b697d550213c.html +++ b/polar-sdk-android/docs/html/dir_b936df1acb3136008a04b697d550213c.html @@ -80,6 +80,8 @@   file  PolarBleApiCallback.java [code]   +file  PolarBleApiCallbackProvider.java [code] +  file  PolarBleApiDefaultImpl.java [code]   diff --git a/polar-sdk-android/docs/html/files.html b/polar-sdk-android/docs/html/files.html index ed50f1ee..8532a85d 100644 --- a/polar-sdk-android/docs/html/files.html +++ b/polar-sdk-android/docs/html/files.html @@ -73,23 +73,24 @@  PolarBiozData.java  PolarBleApi.java  PolarBleApiCallback.java - PolarBleApiDefaultImpl.java - PolarDeviceDisconnected.java - PolarDeviceInfo.java - PolarDeviceNotConnected.java - PolarDeviceNotFound.java - PolarEcgData.java - PolarExerciseData.java - PolarExerciseEntry.java - PolarHrBroadcastData.java - PolarHrData.java - PolarInvalidArgument.java - PolarNotificationNotEnabled.java - PolarOhrPPGData.java - PolarOhrPPIData.java - PolarOperationNotSupported.java - PolarSensorSetting.java - PolarServiceNotAvailable.java + PolarBleApiCallbackProvider.java + PolarBleApiDefaultImpl.java + PolarDeviceDisconnected.java + PolarDeviceInfo.java + PolarDeviceNotConnected.java + PolarDeviceNotFound.java + PolarEcgData.java + PolarExerciseData.java + PolarExerciseEntry.java + PolarHrBroadcastData.java + PolarHrData.java + PolarInvalidArgument.java + PolarNotificationNotEnabled.java + PolarOhrPPGData.java + PolarOhrPPIData.java + PolarOperationNotSupported.java + PolarSensorSetting.java + PolarServiceNotAvailable.java diff --git a/polar-sdk-android/docs/html/files_dup.js b/polar-sdk-android/docs/html/files_dup.js index 3240fae1..de0bceb6 100644 --- a/polar-sdk-android/docs/html/files_dup.js +++ b/polar-sdk-android/docs/html/files_dup.js @@ -18,6 +18,9 @@ var files_dup = [ "PolarBleApiCallback.java", "PolarBleApiCallback_8java.html", [ [ "PolarBleApiCallback", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.html", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback" ] ] ], + [ "PolarBleApiCallbackProvider.java", "PolarBleApiCallbackProvider_8java.html", [ + [ "PolarBleApiCallbackProvider", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider" ] + ] ], [ "PolarBleApiDefaultImpl.java", "PolarBleApiDefaultImpl_8java.html", [ [ "PolarBleApiDefaultImpl", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiDefaultImpl.html", null ] ] ], diff --git a/polar-sdk-android/docs/html/functions.html b/polar-sdk-android/docs/html/functions.html index 5e84bd3f..ff081978 100644 --- a/polar-sdk-android/docs/html/functions.html +++ b/polar-sdk-android/docs/html/functions.html @@ -67,6 +67,7 @@

- a -

  • accelerometerFeatureReady() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
  • address : polar.com.sdk.api.model.PolarDeviceInfo @@ -91,6 +92,7 @@

    - b -

    • batteryLevelReceived() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
    • batteryStatus : polar.com.sdk.api.model.PolarHrBroadcastData @@ -100,16 +102,18 @@

      - b -

      - c -

      • callback -: polar.com.sdk.impl.BDBleApiImpl +: polar.com.sdk.impl.BDBleApiImpl
      • cleanup() : polar.com.sdk.api.PolarBleApi @@ -140,12 +144,15 @@

        - d -

        • deviceConnected() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
        • deviceConnecting() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
        • deviceDisconnected() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
        • deviceId : polar.com.sdk.api.model.PolarDeviceInfo @@ -156,6 +163,7 @@

          - d -

          @@ -163,6 +171,7 @@

          - d -

            - e -

            • ecgFeatureReady() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
            • enableAndroidScanFilter() : polar.com.sdk.impl.BDBleApiImpl @@ -229,9 +238,11 @@

              - h -

              • hrFeatureReady() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
              • hrNotificationReceived() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
              • hrSamples : polar.com.sdk.api.model.PolarExerciseData @@ -310,7 +321,7 @@

                - p -

                  : polar.com.sdk.api.model.PolarAccelerometerData
                • PolarBiozData() -: polar.com.sdk.api.model.PolarBiozData +: polar.com.sdk.api.model.PolarBiozData
                • PolarBleApi() : polar.com.sdk.api.PolarBleApi @@ -332,6 +343,7 @@

                  - p -

                  • polarFtpFeatureReady() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
                  • PolarHrBroadcastData() : polar.com.sdk.api.model.PolarHrBroadcastData @@ -353,9 +365,11 @@

                    - p -

                    @@ -456,8 +470,8 @@

                    - s -

                      : polar.com.sdk.impl.BDBleApiImpl
                    • setApiCallback() -: polar.com.sdk.api.PolarBleApi -, polar.com.sdk.impl.BDBleApiImpl +: polar.com.sdk.api.PolarBleApi +, polar.com.sdk.impl.BDBleApiImpl
                    • setApiLogger() : polar.com.sdk.api.PolarBleApi @@ -516,6 +530,9 @@

                      - s -

                        : polar.com.sdk.api.PolarBleApi , polar.com.sdk.impl.BDBleApiImpl +
                      • status +: polar.com.sdk.api.model.PolarBiozData +
                      • stopPmdStreaming() : polar.com.sdk.impl.BDBleApiImpl
                      • diff --git a/polar-sdk-android/docs/html/functions_func.html b/polar-sdk-android/docs/html/functions_func.html index d0ce516f..dc1fa40c 100644 --- a/polar-sdk-android/docs/html/functions_func.html +++ b/polar-sdk-android/docs/html/functions_func.html @@ -67,6 +67,7 @@

                        - a -

                        • accelerometerFeatureReady() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
                        • autoConnectToDevice() : polar.com.sdk.api.PolarBleApi @@ -82,15 +83,18 @@

                          - b -

                          @@ -113,12 +117,15 @@

                          - d -

                          • deviceConnected() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
                          • deviceConnecting() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
                          • deviceDisconnected() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
                          • disconnectFromDevice() : polar.com.sdk.api.PolarBleApi @@ -126,6 +133,7 @@

                            - d -

                            @@ -133,6 +141,7 @@

                            - d -

                              - e -

                              • ecgFeatureReady() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
                              • enableAndroidScanFilter() : polar.com.sdk.impl.BDBleApiImpl @@ -174,9 +183,11 @@

                                - h -

                                @@ -221,7 +232,7 @@

                                - p -

                                  : polar.com.sdk.api.model.PolarAccelerometerData
                                • PolarBiozData() -: polar.com.sdk.api.model.PolarBiozData +: polar.com.sdk.api.model.PolarBiozData
                                • PolarBleApi() : polar.com.sdk.api.PolarBleApi @@ -240,6 +251,7 @@

                                  - p -

                                  • polarFtpFeatureReady() : polar.com.sdk.api.PolarBleApiCallback +, polar.com.sdk.api.PolarBleApiCallbackProvider
                                  • PolarHrBroadcastData() : polar.com.sdk.api.model.PolarHrBroadcastData @@ -261,9 +273,11 @@

                                    - p -

                                    @@ -327,8 +341,8 @@

                                    - s -

                                      : polar.com.sdk.impl.BDBleApiImpl
                                    • setApiCallback() -: polar.com.sdk.api.PolarBleApi -, polar.com.sdk.impl.BDBleApiImpl +: polar.com.sdk.api.PolarBleApi +, polar.com.sdk.impl.BDBleApiImpl
                                    • setApiLogger() : polar.com.sdk.api.PolarBleApi diff --git a/polar-sdk-android/docs/html/functions_vars.html b/polar-sdk-android/docs/html/functions_vars.html index d7a2977f..2ae1775f 100644 --- a/polar-sdk-android/docs/html/functions_vars.html +++ b/polar-sdk-android/docs/html/functions_vars.html @@ -86,7 +86,7 @@

                                      - b -

                                        - c -

                                        • callback -: polar.com.sdk.impl.BDBleApiImpl +: polar.com.sdk.impl.BDBleApiImpl
                                        • connectSubscriptions : polar.com.sdk.impl.BDBleApiImpl @@ -237,6 +237,9 @@

                                          - s -

                                          diff --git a/polar-sdk-android/docs/html/hierarchy.html b/polar-sdk-android/docs/html/hierarchy.html index 66ea2c72..bae1fce6 100644 --- a/polar-sdk-android/docs/html/hierarchy.html +++ b/polar-sdk-android/docs/html/hierarchy.html @@ -80,21 +80,22 @@  Cpolar.com.sdk.api.model.PolarBiozData  Cpolar.com.sdk.api.PolarBleApi  Cpolar.com.sdk.impl.BDBleApiImpl - Cpolar.com.sdk.api.PolarBleApiCallback - Cpolar.com.sdk.api.PolarBleApiDefaultImpl - Cpolar.com.sdk.api.PolarBleApi.PolarBleApiLogger - Cpolar.com.sdk.api.model.PolarDeviceInfo - Cpolar.com.sdk.api.model.PolarEcgData - Cpolar.com.sdk.api.model.PolarExerciseData - Cpolar.com.sdk.api.model.PolarExerciseEntry - Cpolar.com.sdk.api.model.PolarHrBroadcastData - Cpolar.com.sdk.api.model.PolarHrData - Cpolar.com.sdk.api.model.PolarOhrPPGData - Cpolar.com.sdk.api.model.PolarOhrPPIData - Cpolar.com.sdk.api.model.PolarSensorSetting - Cpolar.com.sdk.api.PolarBleApi.RecordingInterval - Cpolar.com.sdk.api.PolarBleApi.SampleType - Cpolar.com.sdk.api.model.PolarSensorSetting.SettingType + Cpolar.com.sdk.api.PolarBleApiCallbackProvider + Cpolar.com.sdk.api.PolarBleApiCallback + Cpolar.com.sdk.api.PolarBleApiDefaultImpl + Cpolar.com.sdk.api.PolarBleApi.PolarBleApiLogger + Cpolar.com.sdk.api.model.PolarDeviceInfo + Cpolar.com.sdk.api.model.PolarEcgData + Cpolar.com.sdk.api.model.PolarExerciseData + Cpolar.com.sdk.api.model.PolarExerciseEntry + Cpolar.com.sdk.api.model.PolarHrBroadcastData + Cpolar.com.sdk.api.model.PolarHrData + Cpolar.com.sdk.api.model.PolarOhrPPGData + Cpolar.com.sdk.api.model.PolarOhrPPIData + Cpolar.com.sdk.api.model.PolarSensorSetting + Cpolar.com.sdk.api.PolarBleApi.RecordingInterval + Cpolar.com.sdk.api.PolarBleApi.SampleType + Cpolar.com.sdk.api.model.PolarSensorSetting.SettingType diff --git a/polar-sdk-android/docs/html/hierarchy.js b/polar-sdk-android/docs/html/hierarchy.js index 142a437f..2c53a8aa 100644 --- a/polar-sdk-android/docs/html/hierarchy.js +++ b/polar-sdk-android/docs/html/hierarchy.js @@ -14,7 +14,9 @@ var hierarchy = [ "polar.com.sdk.api.PolarBleApi", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html", [ [ "polar.com.sdk.impl.BDBleApiImpl", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html", null ] ] ], - [ "polar.com.sdk.api.PolarBleApiCallback", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.html", null ], + [ "polar.com.sdk.api.PolarBleApiCallbackProvider", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html", [ + [ "polar.com.sdk.api.PolarBleApiCallback", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.html", null ] + ] ], [ "polar.com.sdk.api.PolarBleApiDefaultImpl", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiDefaultImpl.html", null ], [ "polar.com.sdk.api.PolarBleApi.PolarBleApiLogger", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1PolarBleApiLogger.html", null ], [ "polar.com.sdk.api.model.PolarDeviceInfo", "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarDeviceInfo.html", null ], diff --git a/polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html b/polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html new file mode 100644 index 00000000..551934b5 --- /dev/null +++ b/polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html @@ -0,0 +1,537 @@ + + + + + + + +SDK for Polar sensors: polar.com.sdk.api.PolarBleApiCallbackProvider Interface Reference + + + + + + + + + + + +
                                          +
                                          + + + + + + +
                                          +
                                          SDK for Polar sensors +
                                          +
                                          +
                                          + + + + + + +
                                          +
                                          + +
                                          +
                                          +
                                          + +
                                          +
                                          + +
                                          +
                                          polar.com.sdk.api.PolarBleApiCallbackProvider Interface Reference
                                          +
                                          +
                                          +
                                          +Inheritance diagram for polar.com.sdk.api.PolarBleApiCallbackProvider:
                                          +
                                          +
                                          + + +polar.com.sdk.api.PolarBleApiCallback + +
                                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

                                          +Public Member Functions

                                          void blePowerStateChanged (final boolean powered)
                                           
                                          void deviceConnected (@NonNull final PolarDeviceInfo polarDeviceInfo)
                                           
                                          void deviceConnecting (@NonNull final PolarDeviceInfo polarDeviceInfo)
                                           
                                          void deviceDisconnected (@NonNull final PolarDeviceInfo polarDeviceInfo)
                                           
                                          void ecgFeatureReady (@NonNull final String identifier)
                                           
                                          void accelerometerFeatureReady (@NonNull final String identifier)
                                           
                                          void ppgFeatureReady (@NonNull final String identifier)
                                           
                                          void ppiFeatureReady (@NonNull final String identifier)
                                           
                                          void biozFeatureReady (@NonNull final String identifier)
                                           
                                          void hrFeatureReady (@NonNull final String identifier)
                                           
                                          void disInformationReceived (@NonNull final String identifier, @NonNull UUID uuid, @NonNull final String value)
                                           
                                          void batteryLevelReceived (@NonNull final String identifier, final int level)
                                           
                                          void hrNotificationReceived (@NonNull final String identifier, @NonNull final PolarHrData data)
                                           
                                          void polarFtpFeatureReady (@NonNull final String identifier)
                                           
                                          +

                                          Detailed Description

                                          +

                                          Contains the callbacks of the API.

                                          + +

                                          Definition at line 12 of file PolarBleApiCallbackProvider.java.

                                          +

                                          Member Function Documentation

                                          + +

                                          ◆ accelerometerFeatureReady()

                                          + +
                                          +
                                          + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.accelerometerFeatureReady (@NonNull final String identifier)
                                          +
                                          +

                                          Polar device's ACC feature is ready. Application may start ACC stream now if desired. requires feature PolarBleApi::FEATURE_POLAR_SENSOR_STREAMING

                                          Parameters
                                          + + +
                                          identifierPolar device id
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ batteryLevelReceived()

                                          + +
                                          +
                                          + + + + + + + + + + + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.batteryLevelReceived (@NonNull final String identifier,
                                          final int level 
                                          )
                                          +
                                          +

                                          Battery level received requires feature PolarBleApi::FEATURE_BATTERY_INFO

                                          Parameters
                                          + + + +
                                          identifierPolar device id or bt address
                                          levelbattery level (value between 0-100%)
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ biozFeatureReady()

                                          + +
                                          +
                                          + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.biozFeatureReady (@NonNull final String identifier)
                                          +
                                          +

                                          Polar device's bioz feature is ready.

                                          Parameters
                                          + + +
                                          identifierPolar device id
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ blePowerStateChanged()

                                          + +
                                          +
                                          + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.blePowerStateChanged (final boolean powered)
                                          +
                                          +
                                          Parameters
                                          + + +
                                          poweredtrue = Bluetooth power on, false = Bluetooth power off
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ deviceConnected()

                                          + +
                                          +
                                          + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.deviceConnected (@NonNull final PolarDeviceInfo polarDeviceInfo)
                                          +
                                          +

                                          Device is now connected

                                          Parameters
                                          + + +
                                          polarDeviceInfoPolar device information
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ deviceConnecting()

                                          + +
                                          +
                                          + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.deviceConnecting (@NonNull final PolarDeviceInfo polarDeviceInfo)
                                          +
                                          +

                                          Connecting to device

                                          Parameters
                                          + + +
                                          polarDeviceInfoPolar device information
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ deviceDisconnected()

                                          + +
                                          +
                                          + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.deviceDisconnected (@NonNull final PolarDeviceInfo polarDeviceInfo)
                                          +
                                          +

                                          Device is now disconnected, no further action is needed from the application if polar.com.sdk.api.PolarBleApi::disconnectFromPolarDevice is not called. Device will be automatically reconnected

                                          Parameters
                                          + + +
                                          polarDeviceInfoPolar device information
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ disInformationReceived()

                                          + +
                                          +
                                          + + + + + + + + + + + + + + + + + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.disInformationReceived (@NonNull final String identifier,
                                          @NonNull UUID uuid,
                                          @NonNull final String value 
                                          )
                                          +
                                          +

                                          DIS information received requires feature PolarBleApi::FEATURE_DEVICE_INFO

                                          Parameters
                                          + + + + +
                                          identifierPolar device id or bt address
                                          uuiduuid of dis value
                                          valuedis value for uuid
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ ecgFeatureReady()

                                          + +
                                          +
                                          + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.ecgFeatureReady (@NonNull final String identifier)
                                          +
                                          +

                                          Polar device's ECG feature is ready. Application may start ECG stream now if desired. requires feature PolarBleApi::FEATURE_POLAR_SENSOR_STREAMING

                                          Parameters
                                          + + +
                                          identifierPolar device id
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ hrFeatureReady()

                                          + +
                                          +
                                          + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.hrFeatureReady (@NonNull final String identifier)
                                          +
                                          +

                                          Polar device HR client is now ready and HR transmission is starting in a moment.

                                          Parameters
                                          + + +
                                          identifierPolar device id or bt address
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ hrNotificationReceived()

                                          + +
                                          +
                                          + + + + + + + + + + + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.hrNotificationReceived (@NonNull final String identifier,
                                          @NonNull final PolarHrData data 
                                          )
                                          +
                                          +

                                          HR notification data received from device. Notice when using OH1 and PPI measurement is started hr received from this callback is 0.

                                          Parameters
                                          + + + +
                                          identifierPolar device id or bt address
                                          data
                                          +
                                          +
                                          +
                                          See also
                                          polar.com.sdk.api.model.PolarHrData.java
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ polarFtpFeatureReady()

                                          + +
                                          +
                                          + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.polarFtpFeatureReady (@NonNull final String identifier)
                                          +
                                          +

                                          File transfer ready requires feature PolarBleApi::FEATURE_POLAR_FILE_TRANSFER

                                          Parameters
                                          + + +
                                          identifierPolar device id
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ ppgFeatureReady()

                                          + +
                                          +
                                          + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.ppgFeatureReady (@NonNull final String identifier)
                                          +
                                          +

                                          Polar device's PPG feature is ready. Application may start PPG stream now if desired. requires feature PolarBleApi::FEATURE_POLAR_SENSOR_STREAMING

                                          Parameters
                                          + + +
                                          identifierPolar device id
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          + +

                                          ◆ ppiFeatureReady()

                                          + +
                                          +
                                          + + + + + + + + +
                                          void polar.com.sdk.api.PolarBleApiCallbackProvider.ppiFeatureReady (@NonNull final String identifier)
                                          +
                                          +

                                          Polar device's PPI feature is ready. Application may start PPI stream now if desired. requires feature PolarBleApi::FEATURE_POLAR_SENSOR_STREAMING

                                          Parameters
                                          + + +
                                          identifierPolar device id
                                          +
                                          +
                                          + +

                                          Implemented in polar.com.sdk.api.PolarBleApiCallback.

                                          + +
                                          +
                                          +
                                          The documentation for this interface was generated from the following file: +
                                          +
                                          + + + + diff --git a/polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.js b/polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.js new file mode 100644 index 00000000..8e4023cc --- /dev/null +++ b/polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.js @@ -0,0 +1,17 @@ +var interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider = +[ + [ "accelerometerFeatureReady", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a85047da74eb267aff2bed4af4dd4b521", null ], + [ "batteryLevelReceived", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a78097d3ec0e9008595d905ab2302d404", null ], + [ "biozFeatureReady", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a00b1f45a9e85f83cf3481280f751afa6", null ], + [ "blePowerStateChanged", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#aa2327fad0fd836f18a3f26a6355a8d68", null ], + [ "deviceConnected", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#afa130881ddecbb8135bbf78dc45723ea", null ], + [ "deviceConnecting", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a209adefc35b35bdcc47d4a3d18d3c612", null ], + [ "deviceDisconnected", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a74443790ce843fc101418cda1bc34b96", null ], + [ "disInformationReceived", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a954feeb8cd34bdc09b695b4932c163cb", null ], + [ "ecgFeatureReady", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a8a037114fa4c5a7c78960e66ae1c0b7c", null ], + [ "hrFeatureReady", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#aaa3aa5c3fa46b8e42c01e7aac9c8dc64", null ], + [ "hrNotificationReceived", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a486c58d7f53d93646e73350b18ca7848", null ], + [ "polarFtpFeatureReady", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#adc5827b5a6ea10366996a06ebe4351cc", null ], + [ "ppgFeatureReady", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#aaa4a548d3f70132cf6ce25ef095c1388", null ], + [ "ppiFeatureReady", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a4a24d6676e3d29a8351f1c81ca40643d", null ] +]; \ No newline at end of file diff --git a/polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.png b/polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.png new file mode 100644 index 0000000000000000000000000000000000000000..03f93a64415e0815bba9df53b958ab1d5ef221dc GIT binary patch literal 1052 zcmeAS@N?(olHy`uVBq!ia0y~yV3Y*112~w0q}02Qra(#}z$e7@|Ns9$=8HF9OZyK^ z0J6aNz<~p-op{-jq7}Y)Wv>-oyVcB*S%X0+mF+-a8iNd!k~Y47wRCrW z`D@F68NYWsT+fk;tJleX^T>{E`3ybnhBN!q)!yc0AJf^iY{$Bfht8bVwKXpOU1Zz$ z`PAjlJCx!DChtsJrt*8~LY}H=W&tL}w$JUV?h4FlS-7V$^Ho>Le^aLT#yfR~_Z^@5 z@wTMC{?`cIh`s;hB-_|8vZou{1W|h7F&uf+eX z&)FZncAIafpQ^Kb?f?7C?zCUI-tsrUb*X2rOU#*H`Tp({sonX%7H9XqK79M>zewrR zY5`VO3wIpfz1+MnyZ570Px4FNDQ8;B@13yQJNrx~(+?Z@sGrY;SRyoy8TyQvA8@n_ zEYL7!@P~4N%)Z$(uSID`W$QA3$o|2k!Ju}Er{Ur2)mIqSOp#~uH?Q?XF46T~m;GnS%;-O_3+HIhJHJ%D?5~}E$H^Gu;7NZk1+dkIgA&74 zSNXkp9Daua?m5hwv_yCP*&g4e`RRKsivPc#cVdRse^5HO22BT(gp|G3bZCB?^X&Di z%Ef8VTAjl-`Y*|O6e6%uW_>~K3zh5z2DeotpJ{pQT%vB;6**~J&EYdwc;?TLJgz#s za?J*-8IM)N7qgvv=(?11g4cTS`}{LKPwq2#%v}-PcG}8v#(MYUw3A0&ejmuZ^=+p5 ztD5;URcFoJm$~fzwl9K{PrF^Pe}CZHU6EOfvVZOL?njR9hX(!S=chWKPu(N%I3gx) z(ziXOvs7MwuE}^h-)qAek4cMx`0-Ln&tLIDXhB(MTr6`uQ091H%0Gt8t5z>=tl4V` P%*qU&u6{1-oD!M<3JB^1 literal 0 HcmV?d00001 diff --git a/polar-sdk-android/docs/html/namespacepolar_1_1com_1_1sdk_1_1api.html b/polar-sdk-android/docs/html/namespacepolar_1_1com_1_1sdk_1_1api.html index da712258..a1ec2707 100644 --- a/polar-sdk-android/docs/html/namespacepolar_1_1com_1_1sdk_1_1api.html +++ b/polar-sdk-android/docs/html/namespacepolar_1_1com_1_1sdk_1_1api.html @@ -83,6 +83,8 @@   class  PolarBleApiCallback   +interface  PolarBleApiCallbackProvider +  class  PolarBleApiDefaultImpl   diff --git a/polar-sdk-android/docs/html/namespacepolar_1_1com_1_1sdk_1_1api.js b/polar-sdk-android/docs/html/namespacepolar_1_1com_1_1sdk_1_1api.js index 1f9438b3..cb2b703f 100644 --- a/polar-sdk-android/docs/html/namespacepolar_1_1com_1_1sdk_1_1api.js +++ b/polar-sdk-android/docs/html/namespacepolar_1_1com_1_1sdk_1_1api.js @@ -4,5 +4,6 @@ var namespacepolar_1_1com_1_1sdk_1_1api = [ "model", "namespacepolar_1_1com_1_1sdk_1_1api_1_1model.html", "namespacepolar_1_1com_1_1sdk_1_1api_1_1model" ], [ "PolarBleApi", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi" ], [ "PolarBleApiCallback", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.html", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback" ], + [ "PolarBleApiCallbackProvider", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html", "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider" ], [ "PolarBleApiDefaultImpl", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiDefaultImpl.html", null ] ]; \ No newline at end of file diff --git a/polar-sdk-android/docs/html/navtreedata.js b/polar-sdk-android/docs/html/navtreedata.js index 88403f69..581a0f1f 100644 --- a/polar-sdk-android/docs/html/navtreedata.js +++ b/polar-sdk-android/docs/html/navtreedata.js @@ -46,7 +46,7 @@ var NAVTREE = var NAVTREEINDEX = [ "BDBleApiImpl_8java.html", -"namespacepolar_1_1com_1_1sdk_1_1impl.html" +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#aaa4a548d3f70132cf6ce25ef095c1388" ]; var SYNCONMSG = 'click to disable panel synchronisation'; diff --git a/polar-sdk-android/docs/html/navtreeindex0.js b/polar-sdk-android/docs/html/navtreeindex0.js index e8ff693b..cb846fa0 100644 --- a/polar-sdk-android/docs/html/navtreeindex0.js +++ b/polar-sdk-android/docs/html/navtreeindex0.js @@ -6,44 +6,46 @@ var NAVTREEINDEX0 = "PolarAccelerometerData_8java_source.html":[2,0,1], "PolarBiozData_8java.html":[2,0,2], "PolarBiozData_8java_source.html":[2,0,2], +"PolarBleApiCallbackProvider_8java.html":[2,0,5], +"PolarBleApiCallbackProvider_8java_source.html":[2,0,5], "PolarBleApiCallback_8java.html":[2,0,4], "PolarBleApiCallback_8java_source.html":[2,0,4], -"PolarBleApiDefaultImpl_8java.html":[2,0,5], -"PolarBleApiDefaultImpl_8java_source.html":[2,0,5], +"PolarBleApiDefaultImpl_8java.html":[2,0,6], +"PolarBleApiDefaultImpl_8java_source.html":[2,0,6], "PolarBleApi_8java.html":[2,0,3], "PolarBleApi_8java_source.html":[2,0,3], -"PolarDeviceDisconnected_8java.html":[2,0,6], -"PolarDeviceDisconnected_8java_source.html":[2,0,6], -"PolarDeviceInfo_8java.html":[2,0,7], -"PolarDeviceInfo_8java_source.html":[2,0,7], -"PolarDeviceNotConnected_8java.html":[2,0,8], -"PolarDeviceNotConnected_8java_source.html":[2,0,8], -"PolarDeviceNotFound_8java.html":[2,0,9], -"PolarDeviceNotFound_8java_source.html":[2,0,9], -"PolarEcgData_8java.html":[2,0,10], -"PolarEcgData_8java_source.html":[2,0,10], -"PolarExerciseData_8java.html":[2,0,11], -"PolarExerciseData_8java_source.html":[2,0,11], -"PolarExerciseEntry_8java.html":[2,0,12], -"PolarExerciseEntry_8java_source.html":[2,0,12], -"PolarHrBroadcastData_8java.html":[2,0,13], -"PolarHrBroadcastData_8java_source.html":[2,0,13], -"PolarHrData_8java.html":[2,0,14], -"PolarHrData_8java_source.html":[2,0,14], -"PolarInvalidArgument_8java.html":[2,0,15], -"PolarInvalidArgument_8java_source.html":[2,0,15], -"PolarNotificationNotEnabled_8java.html":[2,0,16], -"PolarNotificationNotEnabled_8java_source.html":[2,0,16], -"PolarOhrPPGData_8java.html":[2,0,17], -"PolarOhrPPGData_8java_source.html":[2,0,17], -"PolarOhrPPIData_8java.html":[2,0,18], -"PolarOhrPPIData_8java_source.html":[2,0,18], -"PolarOperationNotSupported_8java.html":[2,0,19], -"PolarOperationNotSupported_8java_source.html":[2,0,19], -"PolarSensorSetting_8java.html":[2,0,20], -"PolarSensorSetting_8java_source.html":[2,0,20], -"PolarServiceNotAvailable_8java.html":[2,0,21], -"PolarServiceNotAvailable_8java_source.html":[2,0,21], +"PolarDeviceDisconnected_8java.html":[2,0,7], +"PolarDeviceDisconnected_8java_source.html":[2,0,7], +"PolarDeviceInfo_8java.html":[2,0,8], +"PolarDeviceInfo_8java_source.html":[2,0,8], +"PolarDeviceNotConnected_8java.html":[2,0,9], +"PolarDeviceNotConnected_8java_source.html":[2,0,9], +"PolarDeviceNotFound_8java.html":[2,0,10], +"PolarDeviceNotFound_8java_source.html":[2,0,10], +"PolarEcgData_8java.html":[2,0,11], +"PolarEcgData_8java_source.html":[2,0,11], +"PolarExerciseData_8java.html":[2,0,12], +"PolarExerciseData_8java_source.html":[2,0,12], +"PolarExerciseEntry_8java.html":[2,0,13], +"PolarExerciseEntry_8java_source.html":[2,0,13], +"PolarHrBroadcastData_8java.html":[2,0,14], +"PolarHrBroadcastData_8java_source.html":[2,0,14], +"PolarHrData_8java.html":[2,0,15], +"PolarHrData_8java_source.html":[2,0,15], +"PolarInvalidArgument_8java.html":[2,0,16], +"PolarInvalidArgument_8java_source.html":[2,0,16], +"PolarNotificationNotEnabled_8java.html":[2,0,17], +"PolarNotificationNotEnabled_8java_source.html":[2,0,17], +"PolarOhrPPGData_8java.html":[2,0,18], +"PolarOhrPPGData_8java_source.html":[2,0,18], +"PolarOhrPPIData_8java.html":[2,0,19], +"PolarOhrPPIData_8java_source.html":[2,0,19], +"PolarOperationNotSupported_8java.html":[2,0,20], +"PolarOperationNotSupported_8java_source.html":[2,0,20], +"PolarSensorSetting_8java.html":[2,0,21], +"PolarSensorSetting_8java_source.html":[2,0,21], +"PolarServiceNotAvailable_8java.html":[2,0,22], +"PolarServiceNotAvailable_8java_source.html":[2,0,22], "annotated.html":[1,0], "classes.html":[1,1], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html":[1,0,0,0,0,0,2], @@ -54,10 +56,10 @@ var NAVTREEINDEX0 = "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a2a6de926dbcc32299dd79d2ba88e2544":[1,0,0,0,0,0,2,9], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a2f95d2c9b7c9963c3b7fa5d7c2949e43":[1,0,0,0,0,0,2,19], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a32484f5b3bacdde45573298a4e1d12a5":[1,0,0,0,0,0,2,23], +"classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a352c7cf35ca7e19e891f4eb7c53940c0":[1,0,0,0,0,0,2,21], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a36bcd4eb256abc810de32d3dbdfdf9e2":[1,0,0,0,0,0,2,28], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a3a0692503cb3f8ebd94bd393dd6b1a7b":[1,0,0,0,0,0,2,4], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a43c533a7a7011c6d2f56a4497fae04f7":[1,0,0,0,0,0,2,7], -"classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a4682d9318c9ac41927694421bde349a5":[1,0,0,0,0,0,2,21], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a5397f7034f2f36820910b65d84b45b1c":[1,0,0,0,0,0,2,6], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a551ad9f20c37fba8d7e1ad08c6c1b258":[1,0,0,0,0,0,2,12], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a63713c5d8a89dee1d2e769068e803bed":[1,0,0,0,0,0,2,10], @@ -95,7 +97,7 @@ var NAVTREEINDEX0 = "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.html#ae98b2e7a18f12255b955693e1afc7bf2":[1,0,0,0,0,0,3,4], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.html#af5ab3ec3f17b4f32085e9e085b0f38c3":[1,0,0,0,0,0,3,13], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallback.html#afec6d56715ba82b46129812be452f1ba":[1,0,0,0,0,0,3,2], -"classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiDefaultImpl.html":[1,0,0,0,0,0,4], +"classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiDefaultImpl.html":[1,0,0,0,0,0,5], "classpolar_1_1com_1_1sdk_1_1api_1_1errors_1_1PolarDeviceDisconnected.html":[1,0,0,0,0,0,0,0], "classpolar_1_1com_1_1sdk_1_1api_1_1errors_1_1PolarDeviceNotConnected.html":[1,0,0,0,0,0,0,1], "classpolar_1_1com_1_1sdk_1_1api_1_1errors_1_1PolarDeviceNotFound.html":[1,0,0,0,0,0,0,2], @@ -110,9 +112,10 @@ var NAVTREEINDEX0 = "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarAccelerometerData.html#a8c127680c13a42a3941f8a9f7decf198":[1,0,0,0,0,0,1,0,2], "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarAccelerometerData.html#af1282a045b75ee338ac6ef33f0bd2726":[1,0,0,0,0,0,1,0,1], "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html":[1,0,0,0,0,0,1,1], -"classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html#a73ace427af9328e21ff151fbf06f0e7a":[1,0,0,0,0,0,1,1,0], +"classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html#a22ac1739749274ff4076dd8a5572b935":[1,0,0,0,0,0,1,1,0], "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html#a829694108df47c3f5276f2dd845f398a":[1,0,0,0,0,0,1,1,1], -"classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html#a8bb9752d020c3b3948ed97c334fc3858":[1,0,0,0,0,0,1,1,2], +"classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html#a8bb9752d020c3b3948ed97c334fc3858":[1,0,0,0,0,0,1,1,3], +"classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarBiozData.html#ae71748c202067f3e082b08d62cba409c":[1,0,0,0,0,0,1,1,2], "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarDeviceInfo.html":[1,0,0,0,0,0,1,2], "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarDeviceInfo.html#a07e3f2b0992559b97bd7f1c3fc53f505":[1,0,0,0,0,0,1,2,1], "classpolar_1_1com_1_1sdk_1_1api_1_1model_1_1PolarDeviceInfo.html#a2f7aa585b18928015513d7380ef1f262":[1,0,0,0,0,0,1,2,2], @@ -179,11 +182,11 @@ var NAVTREEINDEX0 = "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a568cbfd6e9548d54fff470a938cbf000":[1,0,0,0,0,1,0,27], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a573753301ab6af12467792bc87fc19a2":[1,0,0,0,0,1,0,8], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a59c11713e724352b7a8356089185fbda":[1,0,0,0,0,1,0,1], -"classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a5ccfe3027f85d5b1262737b1160006b8":[1,0,0,0,0,1,0,46], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a5d33c2910d8f2583ee44962c4bcac2bf":[1,0,0,0,0,1,0,42], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a5e80e959cbc19490c9a1963e6914a092":[1,0,0,0,0,1,0,44], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a6170765b10eb5ecc9b6b9584b350fb1a":[1,0,0,0,0,1,0,15], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a647db72c6f3a1cbd7587cac769cf0e2c":[1,0,0,0,0,1,0,29], +"classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a74af3feec0f83aa5acb8846dc2a1d1d6":[1,0,0,0,0,1,0,30], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a7700f8c34663e4f37e208c0b5c779582":[1,0,0,0,0,1,0,39], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a829ace600b46dbcb598683a488f821b9":[1,0,0,0,0,1,0,10], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a8bdd3c4c4bc2c98a5ff9ac7cd1385948":[1,0,0,0,0,1,0,19], @@ -198,7 +201,6 @@ var NAVTREEINDEX0 = "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#abc85de0575973be85cc572460952b5d3":[1,0,0,0,0,1,0,21], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ac08998b625def30d377e05abb8a80f8d":[1,0,0,0,0,1,0,48], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ac08c2703034dc62317eaa6c47ed2284c":[1,0,0,0,0,1,0,34], -"classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ac61c2b578af2d5563ef677172196d04d":[1,0,0,0,0,1,0,30], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ac645b2eedd096132b613ed5c0b6ecc2f":[1,0,0,0,0,1,0,18], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ac6df07abc427e5ad2ba3167a2d8c109b":[1,0,0,0,0,1,0,47], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ad239df6d03a59f3a85506346931b52a1":[1,0,0,0,0,1,0,31], @@ -206,6 +208,7 @@ var NAVTREEINDEX0 = "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ae0186ce1014ad60295930835b3620a22":[1,0,0,0,0,1,0,25], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ae1296701871fe33af919ca9423cadd7a":[1,0,0,0,0,1,0,36], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ae46e26479d9e1d5c57605c97343fd0f4":[1,0,0,0,0,1,0,50], +"classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ae49061dfea23ddf3c13917f9c757d1f2":[1,0,0,0,0,1,0,46], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ae897ee6968f1b84641861cda05859a6a":[1,0,0,0,0,1,0,16], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#aea179b27f1dc4b7ed1ad3e2cb971a7a8":[1,0,0,0,0,1,0,7], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#aed55c3ce811dbb765d761f3b90b8ff96":[1,0,0,0,0,1,0,40], @@ -235,19 +238,16 @@ var NAVTREEINDEX0 = "functions_vars.html":[1,3,2], "hierarchy.html":[1,2], "index.html":[], -"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1PolarBleApiLogger.html":[1,0,0,0,0,0,2,0], -"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1PolarBleApiLogger.html#ae55d724f7a34d52fab2f781993d4efcc":[1,0,0,0,0,0,2,0,0], -"namespacepolar.html":[0,0,0], -"namespacepolar.html":[1,0,0], -"namespacepolar_1_1com.html":[1,0,0,0], -"namespacepolar_1_1com.html":[0,0,0,0], -"namespacepolar_1_1com_1_1sdk.html":[1,0,0,0,0], -"namespacepolar_1_1com_1_1sdk.html":[0,0,0,0,0], -"namespacepolar_1_1com_1_1sdk_1_1api.html":[1,0,0,0,0,0], -"namespacepolar_1_1com_1_1sdk_1_1api.html":[0,0,0,0,0,0], -"namespacepolar_1_1com_1_1sdk_1_1api_1_1errors.html":[1,0,0,0,0,0,0], -"namespacepolar_1_1com_1_1sdk_1_1api_1_1errors.html":[0,0,0,0,0,0,0], -"namespacepolar_1_1com_1_1sdk_1_1api_1_1model.html":[1,0,0,0,0,0,1], -"namespacepolar_1_1com_1_1sdk_1_1api_1_1model.html":[0,0,0,0,0,0,1], -"namespacepolar_1_1com_1_1sdk_1_1impl.html":[1,0,0,0,0,1] +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html":[1,0,0,0,0,0,4], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a00b1f45a9e85f83cf3481280f751afa6":[1,0,0,0,0,0,4,2], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a209adefc35b35bdcc47d4a3d18d3c612":[1,0,0,0,0,0,4,5], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a486c58d7f53d93646e73350b18ca7848":[1,0,0,0,0,0,4,10], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a4a24d6676e3d29a8351f1c81ca40643d":[1,0,0,0,0,0,4,13], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a74443790ce843fc101418cda1bc34b96":[1,0,0,0,0,0,4,6], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a78097d3ec0e9008595d905ab2302d404":[1,0,0,0,0,0,4,1], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a85047da74eb267aff2bed4af4dd4b521":[1,0,0,0,0,0,4,0], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a8a037114fa4c5a7c78960e66ae1c0b7c":[1,0,0,0,0,0,4,8], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#a954feeb8cd34bdc09b695b4932c163cb":[1,0,0,0,0,0,4,7], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#aa2327fad0fd836f18a3f26a6355a8d68":[1,0,0,0,0,0,4,3], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#aaa3aa5c3fa46b8e42c01e7aac9c8dc64":[1,0,0,0,0,0,4,9] }; diff --git a/polar-sdk-android/docs/html/navtreeindex1.js b/polar-sdk-android/docs/html/navtreeindex1.js index 71924138..233d7c8c 100644 --- a/polar-sdk-android/docs/html/navtreeindex1.js +++ b/polar-sdk-android/docs/html/navtreeindex1.js @@ -1,6 +1,24 @@ var NAVTREEINDEX1 = { +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#aaa4a548d3f70132cf6ce25ef095c1388":[1,0,0,0,0,0,4,12], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#adc5827b5a6ea10366996a06ebe4351cc":[1,0,0,0,0,0,4,11], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApiCallbackProvider.html#afa130881ddecbb8135bbf78dc45723ea":[1,0,0,0,0,0,4,4], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1PolarBleApiLogger.html":[1,0,0,0,0,0,2,0], +"interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1PolarBleApiLogger.html#ae55d724f7a34d52fab2f781993d4efcc":[1,0,0,0,0,0,2,0,0], +"namespacepolar.html":[0,0,0], +"namespacepolar.html":[1,0,0], +"namespacepolar_1_1com.html":[1,0,0,0], +"namespacepolar_1_1com.html":[0,0,0,0], +"namespacepolar_1_1com_1_1sdk.html":[1,0,0,0,0], +"namespacepolar_1_1com_1_1sdk.html":[0,0,0,0,0], +"namespacepolar_1_1com_1_1sdk_1_1api.html":[1,0,0,0,0,0], +"namespacepolar_1_1com_1_1sdk_1_1api.html":[0,0,0,0,0,0], +"namespacepolar_1_1com_1_1sdk_1_1api_1_1errors.html":[1,0,0,0,0,0,0], +"namespacepolar_1_1com_1_1sdk_1_1api_1_1errors.html":[0,0,0,0,0,0,0], +"namespacepolar_1_1com_1_1sdk_1_1api_1_1model.html":[0,0,0,0,0,0,1], +"namespacepolar_1_1com_1_1sdk_1_1api_1_1model.html":[1,0,0,0,0,0,1], "namespacepolar_1_1com_1_1sdk_1_1impl.html":[0,0,0,0,0,1], +"namespacepolar_1_1com_1_1sdk_1_1impl.html":[1,0,0,0,0,1], "namespaces.html":[0,0], "pages.html":[] };