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

Detailed Description

Main class of the API.

-

Definition at line 30 of file PolarBleApi.java.

+

Definition at line 31 of file PolarBleApi.java.

Constructor & Destructor Documentation

◆ PolarBleApi()

@@ -214,7 +214,7 @@

Definition at line 100 of file PolarBleApi.java.

+

Definition at line 101 of file PolarBleApi.java.

@@ -907,8 +907,8 @@

-

◆ setLocalTime()

+ +

◆ setLocalTime()

@@ -925,8 +925,8 @@

- @NonNull final Date  - time  + @NonNull Calendar  + calendar  @@ -943,7 +943,7 @@

PolarBleApi::FEATURE_POLAR_FILE_TRANSFER

Parameters
- +
identifierpolar device id
timetime to set
calendartime to set
@@ -1351,7 +1351,7 @@

all features mask

-

Definition at line 92 of file PolarBleApi.java.

+

Definition at line 93 of file PolarBleApi.java.

@@ -1376,7 +1376,7 @@

bas feature to receive battery level info.

-

Definition at line 80 of file PolarBleApi.java.

+

Definition at line 81 of file PolarBleApi.java.

@@ -1401,7 +1401,7 @@

dis feature to receive sw information.

-

Definition at line 76 of file PolarBleApi.java.

+

Definition at line 77 of file PolarBleApi.java.

@@ -1426,7 +1426,7 @@

hr feature to receive hr and rr data.

-

Definition at line 72 of file PolarBleApi.java.

+

Definition at line 73 of file PolarBleApi.java.

@@ -1451,7 +1451,7 @@

polar file transfer feature to read exercises from device

-

Definition at line 88 of file PolarBleApi.java.

+

Definition at line 89 of file PolarBleApi.java.

@@ -1476,7 +1476,7 @@

polar sensor streaming for ecg, acc, ppg, ppi, etc...

-

Definition at line 84 of file PolarBleApi.java.

+

Definition at line 85 of file PolarBleApi.java.

@@ -1500,7 +1500,7 @@

-

Definition at line 94 of file PolarBleApi.java.

+

Definition at line 95 of file PolarBleApi.java.

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 11e6bdcd..ce682ea5 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 @@ -24,7 +24,7 @@ var classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi = [ "setApiCallback", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a4682d9318c9ac41927694421bde349a5", 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#a29176c44198372ae4215d9de9a89c5b7", null ], + [ "setLocalTime", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#ac8923ad69235615e62262a25115a01b9", null ], [ "shutDown", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#ab6dec221f95ea5dce6118cadeb362006", null ], [ "startAccStreaming", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a11aa139fffa100c346c13a23fdedfe71", null ], [ "startBiozStreaming", "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a36bcd4eb256abc810de32d3dbdfdf9e2", null ], 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 5e0bf108..2c1665e0 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 @@ -103,8 +103,8 @@   void setAutomaticReconnection (boolean disable)   -Completable setLocalTime (String identifier, Date local) -  +Completable setLocalTime (String identifier, Calendar cal) +  Single< PolarSensorSettingrequestAccSettings (String identifier)   Single< PolarSensorSettingrequestEcgSettings (String identifier) @@ -170,8 +170,8 @@   abstract void setAutomaticReconnection (boolean enable)   -abstract Completable setLocalTime (@NonNull final String identifier, @NonNull final Date time) -  +abstract Completable setLocalTime (@NonNull final String identifier, @NonNull Calendar calendar) +  abstract Single< PolarSensorSettingrequestAccSettings (@NonNull final String identifier)   abstract Single< PolarSensorSettingrequestEcgSettings (@NonNull final String identifier) @@ -372,7 +372,7 @@

-

Definition at line 335 of file BDBleApiImpl.java.

+

Definition at line 333 of file BDBleApiImpl.java.

@@ -410,7 +410,7 @@

-

Definition at line 380 of file BDBleApiImpl.java.

+

Definition at line 378 of file BDBleApiImpl.java.

@@ -437,7 +437,7 @@

-

Definition at line 325 of file BDBleApiImpl.java.

+

Definition at line 323 of file BDBleApiImpl.java.

@@ -492,7 +492,7 @@

-

Definition at line 385 of file BDBleApiImpl.java.

+

Definition at line 383 of file BDBleApiImpl.java.

@@ -520,7 +520,7 @@

-

Definition at line 420 of file BDBleApiImpl.java.

+

Definition at line 418 of file BDBleApiImpl.java.

@@ -585,7 +585,7 @@

-

Definition at line 561 of file BDBleApiImpl.java.

+

Definition at line 559 of file BDBleApiImpl.java.

@@ -629,7 +629,7 @@

-

Definition at line 1043 of file BDBleApiImpl.java.

+

Definition at line 1041 of file BDBleApiImpl.java.

@@ -656,7 +656,7 @@

-

Definition at line 330 of file BDBleApiImpl.java.

+

Definition at line 328 of file BDBleApiImpl.java.

@@ -684,7 +684,7 @@

-

Definition at line 1031 of file BDBleApiImpl.java.

+

Definition at line 1029 of file BDBleApiImpl.java.

@@ -750,7 +750,7 @@

-

Definition at line 505 of file BDBleApiImpl.java.

+

Definition at line 503 of file BDBleApiImpl.java.

@@ -778,7 +778,7 @@

-

Definition at line 1075 of file BDBleApiImpl.java.

+

Definition at line 1073 of file BDBleApiImpl.java.

@@ -806,7 +806,7 @@

-

Definition at line 1081 of file BDBleApiImpl.java.

+

Definition at line 1079 of file BDBleApiImpl.java.

@@ -844,7 +844,7 @@

-

Definition at line 309 of file BDBleApiImpl.java.

+

Definition at line 307 of file BDBleApiImpl.java.

@@ -882,7 +882,7 @@

-

Definition at line 589 of file BDBleApiImpl.java.

+

Definition at line 587 of file BDBleApiImpl.java.

@@ -910,7 +910,7 @@

-

Definition at line 290 of file BDBleApiImpl.java.

+

Definition at line 288 of file BDBleApiImpl.java.

@@ -938,7 +938,7 @@

-

Definition at line 305 of file BDBleApiImpl.java.

+

Definition at line 303 of file BDBleApiImpl.java.

@@ -966,7 +966,7 @@

-

Definition at line 295 of file BDBleApiImpl.java.

+

Definition at line 293 of file BDBleApiImpl.java.

@@ -994,7 +994,7 @@

-

Definition at line 300 of file BDBleApiImpl.java.

+

Definition at line 298 of file BDBleApiImpl.java.

@@ -1022,7 +1022,7 @@

-

Definition at line 480 of file BDBleApiImpl.java.

+

Definition at line 478 of file BDBleApiImpl.java.

@@ -1049,7 +1049,7 @@

-

Definition at line 638 of file BDBleApiImpl.java.

+

Definition at line 636 of file BDBleApiImpl.java.

@@ -1077,7 +1077,7 @@

-

Definition at line 831 of file BDBleApiImpl.java.

+

Definition at line 829 of file BDBleApiImpl.java.

@@ -1105,7 +1105,7 @@

-

Definition at line 855 of file BDBleApiImpl.java.

+

Definition at line 853 of file BDBleApiImpl.java.

@@ -1133,7 +1133,7 @@

-

Definition at line 868 of file BDBleApiImpl.java.

+

Definition at line 866 of file BDBleApiImpl.java.

@@ -1171,7 +1171,7 @@

-

Definition at line 840 of file BDBleApiImpl.java.

+

Definition at line 838 of file BDBleApiImpl.java.

@@ -1259,8 +1259,8 @@

-

◆ setLocalTime()

+ +

◆ setLocalTime()

@@ -1386,7 +1386,7 @@

-

Definition at line 705 of file BDBleApiImpl.java.

+

Definition at line 703 of file BDBleApiImpl.java.

@@ -1424,7 +1424,7 @@

-

Definition at line 805 of file BDBleApiImpl.java.

+

Definition at line 803 of file BDBleApiImpl.java.

@@ -1462,7 +1462,7 @@

-

Definition at line 673 of file BDBleApiImpl.java.

+

Definition at line 671 of file BDBleApiImpl.java.

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

-

Definition at line 653 of file BDBleApiImpl.java.

+

Definition at line 651 of file BDBleApiImpl.java.

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

-

Definition at line 737 of file BDBleApiImpl.java.

+

Definition at line 735 of file BDBleApiImpl.java.

@@ -1556,7 +1556,7 @@

-

Definition at line 769 of file BDBleApiImpl.java.

+

Definition at line 767 of file BDBleApiImpl.java.

@@ -1606,7 +1606,7 @@

-

Definition at line 436 of file BDBleApiImpl.java.

+

Definition at line 434 of file BDBleApiImpl.java.

@@ -1650,7 +1650,7 @@

-

Definition at line 879 of file BDBleApiImpl.java.

+

Definition at line 877 of file BDBleApiImpl.java.

@@ -1678,7 +1678,7 @@

-

Definition at line 461 of file BDBleApiImpl.java.

+

Definition at line 459 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 13a75eb3..456c251f 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 @@ -31,7 +31,7 @@ var classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl = [ "setApiCallback", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ac61c2b578af2d5563ef677172196d04d", 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#a32dd8f5e44596851f227b793113e9cd2", null ], + [ "setLocalTime", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a95d10bce5ba70d0b499f610d761aeabb", null ], [ "setupDevice", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a4a711dc98144cb480f5b4e4ef3c2af5b", null ], [ "shutDown", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#ae1296701871fe33af919ca9423cadd7a", null ], [ "startAccStreaming", "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a34b010c3844f564a377bfb430170e4a9", null ], diff --git a/polar-sdk-android/docs/html/enumpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1RecordingInterval.html b/polar-sdk-android/docs/html/enumpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1RecordingInterval.html index e6727ba4..95b669e6 100644 --- a/polar-sdk-android/docs/html/enumpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1RecordingInterval.html +++ b/polar-sdk-android/docs/html/enumpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1RecordingInterval.html @@ -93,7 +93,7 @@

Detailed Description

Recoding intervals for H10 recording start

-

Definition at line 46 of file PolarBleApi.java.

+

Definition at line 47 of file PolarBleApi.java.

Constructor & Destructor Documentation

◆ RecordingInterval()

@@ -119,7 +119,7 @@

-

Definition at line 52 of file PolarBleApi.java.

+

Definition at line 53 of file PolarBleApi.java.

@@ -147,7 +147,7 @@

-

Definition at line 56 of file PolarBleApi.java.

+

Definition at line 57 of file PolarBleApi.java.

@@ -165,7 +165,7 @@

1 second interval

-

Definition at line 47 of file PolarBleApi.java.

+

Definition at line 48 of file PolarBleApi.java.

@@ -182,7 +182,7 @@

5 second interval

-

Definition at line 48 of file PolarBleApi.java.

+

Definition at line 49 of file PolarBleApi.java.

@@ -206,7 +206,7 @@

-

Definition at line 50 of file PolarBleApi.java.

+

Definition at line 51 of file PolarBleApi.java.

diff --git a/polar-sdk-android/docs/html/enumpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1SampleType.html b/polar-sdk-android/docs/html/enumpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1SampleType.html index f5cd78c0..1d74ea9b 100644 --- a/polar-sdk-android/docs/html/enumpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1SampleType.html +++ b/polar-sdk-android/docs/html/enumpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1SampleType.html @@ -79,7 +79,7 @@

Detailed Description

Sample types for H10 recording start

-

Definition at line 64 of file PolarBleApi.java.

+

Definition at line 65 of file PolarBleApi.java.

Field Documentation

◆ HR

@@ -94,7 +94,7 @@

HeartRate in BPM

-

Definition at line 65 of file PolarBleApi.java.

+

Definition at line 66 of file PolarBleApi.java.

@@ -110,7 +110,7 @@

-

Definition at line 66 of file PolarBleApi.java.

+

Definition at line 67 of file PolarBleApi.java.

diff --git a/polar-sdk-android/docs/html/functions.html b/polar-sdk-android/docs/html/functions.html index 9f8f420f..1b83a4bf 100644 --- a/polar-sdk-android/docs/html/functions.html +++ b/polar-sdk-android/docs/html/functions.html @@ -456,8 +456,8 @@

- s -

    , polar.com.sdk.impl.BDBleApiImpl
  • setLocalTime() -: polar.com.sdk.api.PolarBleApi -, polar.com.sdk.impl.BDBleApiImpl +: polar.com.sdk.api.PolarBleApi +, polar.com.sdk.impl.BDBleApiImpl
  • settings : polar.com.sdk.api.model.PolarSensorSetting diff --git a/polar-sdk-android/docs/html/functions_func.html b/polar-sdk-android/docs/html/functions_func.html index d3d64af6..68f62f4d 100644 --- a/polar-sdk-android/docs/html/functions_func.html +++ b/polar-sdk-android/docs/html/functions_func.html @@ -330,8 +330,8 @@

    - s -

      , polar.com.sdk.impl.BDBleApiImpl
    • setLocalTime() -: polar.com.sdk.api.PolarBleApi -, polar.com.sdk.impl.BDBleApiImpl +: polar.com.sdk.api.PolarBleApi +, polar.com.sdk.impl.BDBleApiImpl
    • SettingType() : polar.com.sdk.api.model.PolarSensorSetting.SettingType diff --git a/polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1PolarBleApiLogger.html b/polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1PolarBleApiLogger.html index 56c34f6d..ed4a2372 100644 --- a/polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1PolarBleApiLogger.html +++ b/polar-sdk-android/docs/html/interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1PolarBleApiLogger.html @@ -77,7 +77,7 @@

      Detailed Description

      Logger interface declaration

      -

      Definition at line 35 of file PolarBleApi.java.

      +

      Definition at line 36 of file PolarBleApi.java.

      Member Function Documentation

      ◆ message()

      diff --git a/polar-sdk-android/docs/html/navtreeindex0.js b/polar-sdk-android/docs/html/navtreeindex0.js index 30b018cc..c7fd23fa 100644 --- a/polar-sdk-android/docs/html/navtreeindex0.js +++ b/polar-sdk-android/docs/html/navtreeindex0.js @@ -51,7 +51,6 @@ var NAVTREEINDEX0 = "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a1d83a0eec58e4a36f095207dcee71a6c":[1,0,0,0,0,0,2,8], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a20700bbdf15b3ea25c632814d3bde8a2":[1,0,0,0,0,0,2,32], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a24e95523c086c9c3818dabc81358d54c":[1,0,0,0,0,0,2,28], -"classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#a29176c44198372ae4215d9de9a89c5b7":[1,0,0,0,0,0,2,24], "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#a36bcd4eb256abc810de32d3dbdfdf9e2":[1,0,0,0,0,0,2,27], @@ -71,6 +70,7 @@ var NAVTREEINDEX0 = "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#ab6dec221f95ea5dce6118cadeb362006":[1,0,0,0,0,0,2,25], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#ab8f30183f9ee4d1a0cc229e06f4f5d5b":[1,0,0,0,0,0,2,5], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#ac2737c48f2aad83fd535d34134e43d17":[1,0,0,0,0,0,2,31], +"classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#ac8923ad69235615e62262a25115a01b9":[1,0,0,0,0,0,2,24], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#ac92b34d91563bb7a208818dd4358b260":[1,0,0,0,0,0,2,22], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#ae34d02d96a9fac60edde6d7b3f61a2d5":[1,0,0,0,0,0,2,18], "classpolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi.html#aed92cfd7807194a6a82d708bdee2a313":[1,0,0,0,0,0,2,4], @@ -148,7 +148,6 @@ var NAVTREEINDEX0 = "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a2c36d4ab6fbdc804df500d2a1d1c0e5d":[1,0,0,0,0,1,0,30], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a2ca3ebc9ca23822d2aca71a2002c1b73":[1,0,0,0,0,1,0,24], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a31b079f8337863ff89f6f1d6dbce65b9":[1,0,0,0,0,1,0,11], -"classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a32dd8f5e44596851f227b793113e9cd2":[1,0,0,0,0,1,0,31], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a34b010c3844f564a377bfb430170e4a9":[1,0,0,0,0,1,0,34], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a4736cc12d728a7a8ddcd15a883486765":[1,0,0,0,0,1,0,5], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a49685140c9028f1d6f140977b03ab4ca":[1,0,0,0,0,1,0,0], @@ -165,6 +164,7 @@ var NAVTREEINDEX0 = "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a647db72c6f3a1cbd7587cac769cf0e2c":[1,0,0,0,0,1,0,27], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a7700f8c34663e4f37e208c0b5c779582":[1,0,0,0,0,1,0,36], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a8bdd3c4c4bc2c98a5ff9ac7cd1385948":[1,0,0,0,0,1,0,18], +"classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a95d10bce5ba70d0b499f610d761aeabb":[1,0,0,0,0,1,0,31], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a964a35d7b8b782183fad03aae73b99be":[1,0,0,0,0,1,0,1], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#a9863d8f3a3756b95cf030e821af4c21c":[1,0,0,0,0,1,0,35], "classpolar_1_1com_1_1sdk_1_1impl_1_1BDBleApiImpl.html#aa65443950ef837c869eb6199a643487c":[1,0,0,0,0,1,0,21], @@ -229,18 +229,18 @@ var NAVTREEINDEX0 = "interfacepolar_1_1com_1_1sdk_1_1api_1_1PolarBleApi_1_1PolarBleApiLogger.html#ae55d724f7a34d52fab2f781993d4efcc":[1,0,0,0,0,0,2,0,0], "namespacepolar.html":[1,0,0], "namespacepolar.html":[0,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.html":[1,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.html":[1,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":[0,0,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_1_1errors.html":[1,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_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_1impl.html":[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":[1,0,0,0,0,1], +"namespacepolar_1_1com_1_1sdk_1_1impl.html":[0,0,0,0,0,1], "namespaces.html":[0,0], "pages.html":[] }; diff --git a/polar-sdk-ios/docs/Protocols/PolarBleApi.html b/polar-sdk-ios/docs/Protocols/PolarBleApi.html index caeaf08a..9304c62e 100644 --- a/polar-sdk-ios/docs/Protocols/PolarBleApi.html +++ b/polar-sdk-ios/docs/Protocols/PolarBleApi.html @@ -470,9 +470,9 @@

      Return Value

    • @@ -487,7 +487,7 @@

      Return Value

      Declaration

      Swift

      -
      func setLocalTime(_ identifier: String, time: Date) -> Completable
      +
      func setLocalTime(_ identifier: String, time: Date, zone: TimeZone) -> Completable
      @@ -519,6 +519,18 @@

      Parameters

      + + + + zone + + + +
      +

      time zone to set

      +
      + + diff --git a/polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Protocols/PolarBleApi.html b/polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Protocols/PolarBleApi.html index caeaf08a..9304c62e 100644 --- a/polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Protocols/PolarBleApi.html +++ b/polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Protocols/PolarBleApi.html @@ -470,9 +470,9 @@

      Return Value

    • @@ -487,7 +487,7 @@

      Return Value

      Declaration

      Swift

      -
      func setLocalTime(_ identifier: String, time: Date) -> Completable
      +
      func setLocalTime(_ identifier: String, time: Date, zone: TimeZone) -> Completable
      @@ -519,6 +519,18 @@

      Parameters

      + + + + zone + + + +
      +

      time zone to set

      +
      + + diff --git a/polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/search.json b/polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/search.json index a8d9ce24..5fc6dbc1 100644 --- a/polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/search.json +++ b/polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/search.json @@ -1 +1 @@ -{"Other Typealiases.html#/s:11PolarBleSdk0A10DeviceInfoa":{"name":"PolarDeviceInfo","abstract":"

      Polar device info

      "},"Other Typealiases.html#/s:11PolarBleSdk0A15HrBroadcastDataa":{"name":"PolarHrBroadcastData","abstract":"

      deviceInfo: see #PolarDeviceInfo ,

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7EcgDataa":{"name":"PolarEcgData","abstract":"

      Polar Ecg data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7AccDataa":{"name":"PolarAccData","abstract":"

      Polar acc data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7PpgDataa":{"name":"PolarPpgData","abstract":"

      Polar ppg data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7PpiDataa":{"name":"PolarPpiData","abstract":"

      Polar ppi data"},"Other Typealiases.html#/s:11PolarBleSdk0A13ExerciseEntrya":{"name":"PolarExerciseEntry","abstract":"

      Polar exercise entry

      "},"Other Typealiases.html#/s:11PolarBleSdk0A12ExerciseDataa":{"name":"PolarExerciseData","abstract":"

      Polar Exercise Data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A15RecordingStatusa":{"name":"PolarRecordingStatus","abstract":"

      Polar Recording status

      "},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO2hryA2CmF":{"name":"hr","abstract":"

      hr feature enables hr client to receive hr and rr data from device

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO10deviceInfoyA2CmF":{"name":"deviceInfo","abstract":"

      deviceInfo enables dis client to receive fw information from device

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO13batteryStatusyA2CmF":{"name":"batteryStatus","abstract":"

      batteryStatus enables bas client to receive battery level info from device

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO20polarSensorStreamingyA2CmF":{"name":"polarSensorStreaming","abstract":"

      polarSensorStreaming enables stream client to start acc, ppg, ecg, ppi streams

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO17polarFileTransferyA2CmF":{"name":"polarFileTransfer","abstract":"

      polarFileTransfer enables file transfer client to list and read stored exercises,","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO03allD0yA2CmF":{"name":"allFeatures","abstract":"

      allFeatures enables all features available

      ","parent_name":"Features"},"Enums/SampleType.html#/s:11PolarBleSdk10SampleTypeO2hryA2CmF":{"name":"hr","abstract":"

      recording type to use is hr in BPM

      ","parent_name":"SampleType"},"Enums/SampleType.html#/s:11PolarBleSdk10SampleTypeO2rryA2CmF":{"name":"rr","abstract":"

      recording type to use is rr interval

      ","parent_name":"SampleType"},"Other Enums.html#/s:11PolarBleSdk17RecordingIntervalO":{"name":"RecordingInterval","abstract":"

      recording interval in seconds for H10

      "},"Enums/SampleType.html":{"name":"SampleType","abstract":"

      sample type for H10 recording

      "},"Enums/Features.html":{"name":"Features","abstract":"

      features available

      "},"Classes/PolarBleApiDefaultImpl.html#/s:11PolarBleSdk0aB14ApiDefaultImplC19polarImplementation_8featuresAA0abD0_pSo17OS_dispatch_queueC_SitFZ":{"name":"polarImplementation(_:features:)","abstract":"

      New instance of Polar Ble API implementation

      ","parent_name":"PolarBleApiDefaultImpl"},"Classes/PolarBleApiDefaultImpl.html#/s:11PolarBleSdk0aB14ApiDefaultImplC11versionInfoSSyFZ":{"name":"versionInfo()","abstract":"

      Return current version

      ","parent_name":"PolarBleApiDefaultImpl"},"Classes/PolarBleApiDefaultImpl.html":{"name":"PolarBleApiDefaultImpl","abstract":"

      Class to provide the default implementation of the Polar Ble API

      "},"PolarErrors.html#/s:11PolarBleSdk20DateTimeFormatFailedC":{"name":"DateTimeFormatFailed","abstract":"

      String to date time formatting failed

      "},"PolarErrors.html#/s:11PolarBleSdk18DeviceNotConnectedC":{"name":"DeviceNotConnected","abstract":"

      Device state != Connected

      "},"PolarErrors.html#/s:11PolarBleSdk14DeviceNotFoundC":{"name":"DeviceNotFound","abstract":"

      Device not found

      "},"PolarErrors.html#/s:11PolarBleSdk19MessageEncodeFailedC":{"name":"MessageEncodeFailed","abstract":"

      Google protocol buffers encode failed

      "},"PolarErrors.html#/s:11PolarBleSdk19MessageDecodeFailedC":{"name":"MessageDecodeFailed","abstract":"

      Google protocol buffers decode failed

      "},"PolarErrors.html#/s:11PolarBleSdk22NotificationNotEnabledC":{"name":"NotificationNotEnabled","abstract":"

      GATT characteristic notification not enabled

      "},"PolarErrors.html#/s:11PolarBleSdk21OperationNotSupportedC":{"name":"OperationNotSupported","abstract":"

      Requested operation is not supported

      "},"PolarErrors.html#/s:11PolarBleSdk15ServiceNotFoundC":{"name":"ServiceNotFound","abstract":"

      GATT service not found

      "},"PolarErrors.html#/s:11PolarBleSdk22UnableToStartStreamingC":{"name":"UnableToStartStreaming","abstract":"

      Failed to start streaming

      "},"PolarErrors.html#/s:11PolarBleSdk15InvalidArgumentC":{"name":"InvalidArgument","abstract":"

      invalid argument

      "},"PolarErrors.html#/s:11PolarBleSdk14UndefinedErrorO":{"name":"UndefinedError","abstract":"

      Unknown error

      "},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO10sampleRateyA2EmF":{"name":"sampleRate","abstract":"

      sample rate in hz

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO10resolutionyA2EmF":{"name":"resolution","abstract":"

      resolution in bits

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO5rangeyA2EmF":{"name":"range","abstract":"

      range in g’s

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO7unknownyA2EmF":{"name":"unknown","abstract":"

      type is unknown

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html":{"name":"SettingType","abstract":"

      settings type

      ","parent_name":"PolarSensorSetting"},"Structs/PolarSensorSetting.html#/s:11PolarBleSdk0A13SensorSettingV8settingsSDyAC0E4TypeOShys6UInt16VGGvp":{"name":"settings","abstract":"

      current settings available / set

      ","parent_name":"PolarSensorSetting"},"Structs/PolarSensorSetting.html#/s:11PolarBleSdk0A13SensorSettingVyACSDyAC0E4TypeOs6UInt16VGcfc":{"name":"init(_:)","abstract":"

      constructor with desired settings

      ","parent_name":"PolarSensorSetting"},"Structs/PolarSensorSetting.html#/s:11PolarBleSdk0A13SensorSettingV11maxSettingsACyF":{"name":"maxSettings()","abstract":"

      helper to retreive max settings available

      ","parent_name":"PolarSensorSetting"},"Protocols/PolarBleApiLogger.html#/s:11PolarBleSdk0aB9ApiLoggerP7messageyySSF":{"name":"message(_:)","abstract":"

      log message from sdk

      ","parent_name":"PolarBleApiLogger"},"Protocols/PolarBleApiPowerStateObserver.html#/s:11PolarBleSdk0aB21ApiPowerStateObserverP03bleE2OnyyF":{"name":"blePowerOn()","abstract":"

      Ble powered on event.

      ","parent_name":"PolarBleApiPowerStateObserver"},"Protocols/PolarBleApiPowerStateObserver.html#/s:11PolarBleSdk0aB21ApiPowerStateObserverP03bleE3OffyyF":{"name":"blePowerOff()","abstract":"

      Ble powered off event, no further actions are needed from the application.

      ","parent_name":"PolarBleApiPowerStateObserver"},"Protocols/PolarBleApiDeviceInfoObserver.html#/s:11PolarBleSdk0aB21ApiDeviceInfoObserverP20batteryLevelReceived_0hI0ySS_SutF":{"name":"batteryLevelReceived(_:batteryLevel:)","abstract":"

      Battery level received from device.

      ","parent_name":"PolarBleApiDeviceInfoObserver"},"Protocols/PolarBleApiDeviceInfoObserver.html#/s:11PolarBleSdk0aB21ApiDeviceInfoObserverP17fwVersionReceived_0hI0ySS_SStF":{"name":"fwVersionReceived(_:fwVersion:)","abstract":"

      Received firmware version info.

      ","parent_name":"PolarBleApiDeviceInfoObserver"},"Protocols/PolarBleApiDeviceHrObserver.html#/s:11PolarBleSdk0aB19ApiDeviceHrObserverP0aF4Dataa":{"name":"PolarHrData","abstract":"

      Polar hr data

      ","parent_name":"PolarBleApiDeviceHrObserver"},"Protocols/PolarBleApiDeviceHrObserver.html#/s:11PolarBleSdk0aB19ApiDeviceHrObserverP15hrValueReceived_4dataySS_s5UInt8V0H0_SaySiG3rrsAI0M2MsSb7contactSb0O9SupportedttF":{"name":"hrValueReceived(_:data:)","abstract":"

      HR notification received.

      ","parent_name":"PolarBleApiDeviceHrObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP14hrFeatureReadyyySSF":{"name":"hrFeatureReady(_:)","abstract":"

      Device HR feature is ready. HR transmission is starting in a short while.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP15ecgFeatureReadyyySSF":{"name":"ecgFeatureReady(_:)","abstract":"

      Device ECG feature is ready. Application can now start ECG streaming.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP15accFeatureReadyyySSF":{"name":"accFeatureReady(_:)","abstract":"

      Device ACC feature is ready. Application can now start ACC streaming.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP18ohrPPGFeatureReadyyySSF":{"name":"ohrPPGFeatureReady(_:)","abstract":"

      Device OHR PPG feature is ready.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP18ohrPPIFeatureReadyyySSF":{"name":"ohrPPIFeatureReady(_:)","abstract":"

      Device OHR PPG feature is ready.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP15ftpFeatureReadyyySSF":{"name":"ftpFeatureReady(_:)","abstract":"

      Device file transfer protocol is ready.","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiObserver.html#/s:11PolarBleSdk0aB11ApiObserverP21polarDeviceConnectingyySS8deviceId_Si4rssiSS4nameSb11connectablet_tF":{"name":"polarDeviceConnecting(_:)","abstract":"

      Callback when connection attempt is started to polar device

      ","parent_name":"PolarBleApiObserver"},"Protocols/PolarBleApiObserver.html#/s:11PolarBleSdk0aB11ApiObserverP20polarDeviceConnectedyySS8deviceId_Si4rssiSS4nameSb11connectablet_tF":{"name":"polarDeviceConnected(_:)","abstract":"

      Device connnection has been established.

      ","parent_name":"PolarBleApiObserver"},"Protocols/PolarBleApiObserver.html#/s:11PolarBleSdk0aB11ApiObserverP23polarDeviceDisconnectedyySS8deviceId_Si4rssiSS4nameSb11connectablet_tF":{"name":"polarDeviceDisconnected(_:)","abstract":"

      Connection lost to Polar device.","parent_name":"PolarBleApiObserver"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP7cleanupyyF":{"name":"cleanup()","abstract":"

      remove all known devices, which are not in use

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP018startAutoConnectToA6Device_05polarI4Type7RxSwift17PrimitiveSequenceVyAF16CompletableTraitOs5NeverOGSi_SSSgtF":{"name":"startAutoConnectToPolarDevice(_:polarDeviceType:)","abstract":"

      Start connecting to a nearby Polar device. PolarBleApiObservers polarDeviceConnected is","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP09connectToA6DeviceyySSF":{"name":"connectToPolarDevice(_:)","abstract":"

      Request a connection to a Polar device. Invokes PolarBleApiObservers polarDeviceConnected.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP014disconnectFromA6DeviceyySSF":{"name":"disconnectFromPolarDevice(_:)","abstract":"

      Disconnect from the current Polar device.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP09searchForA6Device7RxSwift10ObservableCySS8deviceId_Si4rssiSS4nameSb11connectabletGyF":{"name":"searchForPolarDevice()","abstract":"

      Start searching for Polar device(s)

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP14isFeatureReady_7featureSbSS_AA8FeaturesOtF":{"name":"isFeatureReady(_:feature:)","abstract":"

      helper to check is feature ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP12setLocalTime_4time7RxSwift17PrimitiveSequenceVyAF16CompletableTraitOs5NeverOGSS_10Foundation4DateVtF":{"name":"setLocalTime(_:time:)","abstract":"

      set local time to device, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP14startRecording_10exerciseId8interval10sampleType7RxSwift17PrimitiveSequenceVyAH16CompletableTraitOs5NeverOGSS_SSAA0F8IntervalOAA06SampleK0OtF":{"name":"startRecording(_:exerciseId:interval:sampleType:)","abstract":"

      request start recording, only H10 supported, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP13stopRecordingy7RxSwift17PrimitiveSequenceVyAE16CompletableTraitOs5NeverOGSSF":{"name":"stopRecording(_:)","abstract":"

      request stop for current recording, only H10 supported, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP22requestRecordingStatusy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOSb7ongoing_SS7entryIdtGSSF":{"name":"requestRecordingStatus(_:)","abstract":"

      request current recording status, only H10 supported, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP014startListenForA12HrBroadcastsy7RxSwift10ObservableCySS8deviceId_Si4rssiSS4nameSb11connectablet0M4Info_s5UInt8V2hrSb13batteryStatustGShySSGSgF":{"name":"startListenForPolarHrBroadcasts(_:)","abstract":"

      Start listening to broadcasts from one or more Polar devices

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18requestEcgSettingsy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOAA0A13SensorSettingVGSSF":{"name":"requestEcgSettings(_:)","abstract":"

      request ecg settings available

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18requestAccSettingsy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOAA0A13SensorSettingVGSSF":{"name":"requestAccSettings(_:)","abstract":"

      request acc settings available

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18requestPpgSettingsy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOAA0A13SensorSettingVGSSF":{"name":"requestPpgSettings(_:)","abstract":"

      request ppg settings available

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP17startEcgStreaming_8settings7RxSwift10ObservableCys6UInt64V9timeStamp_Says5Int32VG7samplestGSS_AA0A13SensorSettingVtF":{"name":"startEcgStreaming(_:settings:)","abstract":"

      Starts the ECG (Electrocardiography) stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP17startAccStreaming_8settings7RxSwift10ObservableCys6UInt64V9timeStamp_Says5Int32V1x_AM1yAM1ztG7samplestGSS_AA0A13SensorSettingVtF":{"name":"startAccStreaming(_:settings:)","abstract":"

      Start ACC (accelerometer) stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP20startOhrPPGStreaming_8settings7RxSwift10ObservableCys6UInt64V9timeStamp_Says5Int32V4ppg0_AM4ppg1AM4ppg2AM7ambienttG7samplestGSS_AA0A13SensorSettingVtF":{"name":"startOhrPPGStreaming(_:settings:)","abstract":"

      Start an OHR (optical heart rate) PPG (photoplethysmography) stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP20startOhrPPIStreamingy7RxSwift10ObservableCys6UInt64V9timeStamp_SaySi2hr_s6UInt16V6ppInMsAM0P13ErrorEstimateSi10blockerBitSi17skinContactStatusSi0wX9SupportedtG7samplestGSSF":{"name":"startOhrPPIStreaming(_:)","abstract":"

      Start PPI stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP23fetchStoredExerciseListy7RxSwift10ObservableCySS4path_10Foundation4DateV4dateSS7entryIdtGSSF":{"name":"fetchStoredExerciseList(_:)","abstract":"

      Api for fetching stored exercises from Polar OH1/H10 device

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP13fetchExercise_5entry7RxSwift17PrimitiveSequenceVyAF11SingleTraitOs6UInt32V8interval_SayALG7samplestGSS_SS4path_10Foundation4DateV4dateSS0G2IdttF":{"name":"fetchExercise(_:entry:)","abstract":"

      Api for fetching a single exersice from Polar OH1/H10 device

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP14removeExercise_5entry7RxSwift17PrimitiveSequenceVyAF16CompletableTraitOs5NeverOGSS_SS4path_10Foundation4DateV4dateSS0G2IdttF":{"name":"removeExercise(_:entry:)","abstract":"

      Remove single exercise from device

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP8observerAA0abD8Observer_pSgvp":{"name":"observer","abstract":"

      Common GAP (Generic access profile) observer

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18deviceInfoObserverAA0abd6DevicefG0_pSgvp":{"name":"deviceInfoObserver","abstract":"

      Device info observer for DIS (Device information servive) and BAS (Battery service) GATT (Generic attributes) client

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP16deviceHrObserverAA0abd6DevicefG0_pSgvp":{"name":"deviceHrObserver","abstract":"

      Device observer for HR GATT client

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18powerStateObserverAA0abd5PowerfG0_pSgvp":{"name":"powerStateObserver","abstract":"

      Bluetooth power state observer

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP22deviceFeaturesObserverAA0abd6DevicefG0_pSgvp":{"name":"deviceFeaturesObserver","abstract":"

      device features ready observer

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP02isB7PoweredSbvp":{"name":"isBlePowered","abstract":"

      Helper to check if Ble is currently powered

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP6loggerAA0abD6Logger_pSgvp":{"name":"logger","abstract":"

      optional logger set to get traces from sdk

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html":{"name":"PolarBleApi","abstract":"

      Main class of the API.

      "},"Protocols/PolarBleApiObserver.html":{"name":"PolarBleApiObserver","abstract":"

      Polar Ble API connection observer.

      "},"Protocols/PolarBleApiDeviceFeaturesObserver.html":{"name":"PolarBleApiDeviceFeaturesObserver","abstract":"

      Data client observer

      "},"Protocols/PolarBleApiDeviceHrObserver.html":{"name":"PolarBleApiDeviceHrObserver","abstract":"

      Heart rate observer

      "},"Protocols/PolarBleApiDeviceInfoObserver.html":{"name":"PolarBleApiDeviceInfoObserver","abstract":"

      Device info observer.

      "},"Protocols/PolarBleApiPowerStateObserver.html":{"name":"PolarBleApiPowerStateObserver","abstract":"

      Bluetooth state observer.

      "},"Protocols/PolarBleApiLogger.html":{"name":"PolarBleApiLogger","abstract":"

      logger observer

      "},"Structs/PolarSensorSetting.html":{"name":"PolarSensorSetting","abstract":"

      polar sensor settings class

      "},"API.html":{"name":"API"},"PolarErrors.html":{"name":"PolarErrors"},"API Default Implementation.html":{"name":"API Default Implementation"},"Other Enums.html":{"name":"Other Enumerations","abstract":"

      The following enumerations are available globally.

      "},"Other Typealiases.html":{"name":"Other Type Aliases","abstract":"

      The following type aliases are available globally.

      "}} \ No newline at end of file +{"Other Typealiases.html#/s:11PolarBleSdk0A10DeviceInfoa":{"name":"PolarDeviceInfo","abstract":"

      Polar device info

      "},"Other Typealiases.html#/s:11PolarBleSdk0A15HrBroadcastDataa":{"name":"PolarHrBroadcastData","abstract":"

      deviceInfo: see #PolarDeviceInfo ,

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7EcgDataa":{"name":"PolarEcgData","abstract":"

      Polar Ecg data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7AccDataa":{"name":"PolarAccData","abstract":"

      Polar acc data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7PpgDataa":{"name":"PolarPpgData","abstract":"

      Polar ppg data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7PpiDataa":{"name":"PolarPpiData","abstract":"

      Polar ppi data"},"Other Typealiases.html#/s:11PolarBleSdk0A13ExerciseEntrya":{"name":"PolarExerciseEntry","abstract":"

      Polar exercise entry

      "},"Other Typealiases.html#/s:11PolarBleSdk0A12ExerciseDataa":{"name":"PolarExerciseData","abstract":"

      Polar Exercise Data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A15RecordingStatusa":{"name":"PolarRecordingStatus","abstract":"

      Polar Recording status

      "},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO2hryA2CmF":{"name":"hr","abstract":"

      hr feature enables hr client to receive hr and rr data from device

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO10deviceInfoyA2CmF":{"name":"deviceInfo","abstract":"

      deviceInfo enables dis client to receive fw information from device

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO13batteryStatusyA2CmF":{"name":"batteryStatus","abstract":"

      batteryStatus enables bas client to receive battery level info from device

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO20polarSensorStreamingyA2CmF":{"name":"polarSensorStreaming","abstract":"

      polarSensorStreaming enables stream client to start acc, ppg, ecg, ppi streams

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO17polarFileTransferyA2CmF":{"name":"polarFileTransfer","abstract":"

      polarFileTransfer enables file transfer client to list and read stored exercises,","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO03allD0yA2CmF":{"name":"allFeatures","abstract":"

      allFeatures enables all features available

      ","parent_name":"Features"},"Enums/SampleType.html#/s:11PolarBleSdk10SampleTypeO2hryA2CmF":{"name":"hr","abstract":"

      recording type to use is hr in BPM

      ","parent_name":"SampleType"},"Enums/SampleType.html#/s:11PolarBleSdk10SampleTypeO2rryA2CmF":{"name":"rr","abstract":"

      recording type to use is rr interval

      ","parent_name":"SampleType"},"Other Enums.html#/s:11PolarBleSdk17RecordingIntervalO":{"name":"RecordingInterval","abstract":"

      recording interval in seconds for H10

      "},"Enums/SampleType.html":{"name":"SampleType","abstract":"

      sample type for H10 recording

      "},"Enums/Features.html":{"name":"Features","abstract":"

      features available

      "},"Classes/PolarBleApiDefaultImpl.html#/s:11PolarBleSdk0aB14ApiDefaultImplC19polarImplementation_8featuresAA0abD0_pSo17OS_dispatch_queueC_SitFZ":{"name":"polarImplementation(_:features:)","abstract":"

      New instance of Polar Ble API implementation

      ","parent_name":"PolarBleApiDefaultImpl"},"Classes/PolarBleApiDefaultImpl.html#/s:11PolarBleSdk0aB14ApiDefaultImplC11versionInfoSSyFZ":{"name":"versionInfo()","abstract":"

      Return current version

      ","parent_name":"PolarBleApiDefaultImpl"},"Classes/PolarBleApiDefaultImpl.html":{"name":"PolarBleApiDefaultImpl","abstract":"

      Class to provide the default implementation of the Polar Ble API

      "},"PolarErrors.html#/s:11PolarBleSdk20DateTimeFormatFailedC":{"name":"DateTimeFormatFailed","abstract":"

      String to date time formatting failed

      "},"PolarErrors.html#/s:11PolarBleSdk18DeviceNotConnectedC":{"name":"DeviceNotConnected","abstract":"

      Device state != Connected

      "},"PolarErrors.html#/s:11PolarBleSdk14DeviceNotFoundC":{"name":"DeviceNotFound","abstract":"

      Device not found

      "},"PolarErrors.html#/s:11PolarBleSdk19MessageEncodeFailedC":{"name":"MessageEncodeFailed","abstract":"

      Google protocol buffers encode failed

      "},"PolarErrors.html#/s:11PolarBleSdk19MessageDecodeFailedC":{"name":"MessageDecodeFailed","abstract":"

      Google protocol buffers decode failed

      "},"PolarErrors.html#/s:11PolarBleSdk22NotificationNotEnabledC":{"name":"NotificationNotEnabled","abstract":"

      GATT characteristic notification not enabled

      "},"PolarErrors.html#/s:11PolarBleSdk21OperationNotSupportedC":{"name":"OperationNotSupported","abstract":"

      Requested operation is not supported

      "},"PolarErrors.html#/s:11PolarBleSdk15ServiceNotFoundC":{"name":"ServiceNotFound","abstract":"

      GATT service not found

      "},"PolarErrors.html#/s:11PolarBleSdk22UnableToStartStreamingC":{"name":"UnableToStartStreaming","abstract":"

      Failed to start streaming

      "},"PolarErrors.html#/s:11PolarBleSdk15InvalidArgumentC":{"name":"InvalidArgument","abstract":"

      invalid argument

      "},"PolarErrors.html#/s:11PolarBleSdk14UndefinedErrorO":{"name":"UndefinedError","abstract":"

      Unknown error

      "},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO10sampleRateyA2EmF":{"name":"sampleRate","abstract":"

      sample rate in hz

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO10resolutionyA2EmF":{"name":"resolution","abstract":"

      resolution in bits

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO5rangeyA2EmF":{"name":"range","abstract":"

      range in g’s

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO7unknownyA2EmF":{"name":"unknown","abstract":"

      type is unknown

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html":{"name":"SettingType","abstract":"

      settings type

      ","parent_name":"PolarSensorSetting"},"Structs/PolarSensorSetting.html#/s:11PolarBleSdk0A13SensorSettingV8settingsSDyAC0E4TypeOShys6UInt16VGGvp":{"name":"settings","abstract":"

      current settings available / set

      ","parent_name":"PolarSensorSetting"},"Structs/PolarSensorSetting.html#/s:11PolarBleSdk0A13SensorSettingVyACSDyAC0E4TypeOs6UInt16VGcfc":{"name":"init(_:)","abstract":"

      constructor with desired settings

      ","parent_name":"PolarSensorSetting"},"Structs/PolarSensorSetting.html#/s:11PolarBleSdk0A13SensorSettingV11maxSettingsACyF":{"name":"maxSettings()","abstract":"

      helper to retreive max settings available

      ","parent_name":"PolarSensorSetting"},"Protocols/PolarBleApiLogger.html#/s:11PolarBleSdk0aB9ApiLoggerP7messageyySSF":{"name":"message(_:)","abstract":"

      log message from sdk

      ","parent_name":"PolarBleApiLogger"},"Protocols/PolarBleApiPowerStateObserver.html#/s:11PolarBleSdk0aB21ApiPowerStateObserverP03bleE2OnyyF":{"name":"blePowerOn()","abstract":"

      Ble powered on event.

      ","parent_name":"PolarBleApiPowerStateObserver"},"Protocols/PolarBleApiPowerStateObserver.html#/s:11PolarBleSdk0aB21ApiPowerStateObserverP03bleE3OffyyF":{"name":"blePowerOff()","abstract":"

      Ble powered off event, no further actions are needed from the application.

      ","parent_name":"PolarBleApiPowerStateObserver"},"Protocols/PolarBleApiDeviceInfoObserver.html#/s:11PolarBleSdk0aB21ApiDeviceInfoObserverP20batteryLevelReceived_0hI0ySS_SutF":{"name":"batteryLevelReceived(_:batteryLevel:)","abstract":"

      Battery level received from device.

      ","parent_name":"PolarBleApiDeviceInfoObserver"},"Protocols/PolarBleApiDeviceInfoObserver.html#/s:11PolarBleSdk0aB21ApiDeviceInfoObserverP17fwVersionReceived_0hI0ySS_SStF":{"name":"fwVersionReceived(_:fwVersion:)","abstract":"

      Received firmware version info.

      ","parent_name":"PolarBleApiDeviceInfoObserver"},"Protocols/PolarBleApiDeviceHrObserver.html#/s:11PolarBleSdk0aB19ApiDeviceHrObserverP0aF4Dataa":{"name":"PolarHrData","abstract":"

      Polar hr data

      ","parent_name":"PolarBleApiDeviceHrObserver"},"Protocols/PolarBleApiDeviceHrObserver.html#/s:11PolarBleSdk0aB19ApiDeviceHrObserverP15hrValueReceived_4dataySS_s5UInt8V0H0_SaySiG3rrsAI0M2MsSb7contactSb0O9SupportedttF":{"name":"hrValueReceived(_:data:)","abstract":"

      HR notification received.

      ","parent_name":"PolarBleApiDeviceHrObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP14hrFeatureReadyyySSF":{"name":"hrFeatureReady(_:)","abstract":"

      Device HR feature is ready. HR transmission is starting in a short while.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP15ecgFeatureReadyyySSF":{"name":"ecgFeatureReady(_:)","abstract":"

      Device ECG feature is ready. Application can now start ECG streaming.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP15accFeatureReadyyySSF":{"name":"accFeatureReady(_:)","abstract":"

      Device ACC feature is ready. Application can now start ACC streaming.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP18ohrPPGFeatureReadyyySSF":{"name":"ohrPPGFeatureReady(_:)","abstract":"

      Device OHR PPG feature is ready.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP18ohrPPIFeatureReadyyySSF":{"name":"ohrPPIFeatureReady(_:)","abstract":"

      Device OHR PPG feature is ready.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP15ftpFeatureReadyyySSF":{"name":"ftpFeatureReady(_:)","abstract":"

      Device file transfer protocol is ready.","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiObserver.html#/s:11PolarBleSdk0aB11ApiObserverP21polarDeviceConnectingyySS8deviceId_Si4rssiSS4nameSb11connectablet_tF":{"name":"polarDeviceConnecting(_:)","abstract":"

      Callback when connection attempt is started to polar device

      ","parent_name":"PolarBleApiObserver"},"Protocols/PolarBleApiObserver.html#/s:11PolarBleSdk0aB11ApiObserverP20polarDeviceConnectedyySS8deviceId_Si4rssiSS4nameSb11connectablet_tF":{"name":"polarDeviceConnected(_:)","abstract":"

      Device connnection has been established.

      ","parent_name":"PolarBleApiObserver"},"Protocols/PolarBleApiObserver.html#/s:11PolarBleSdk0aB11ApiObserverP23polarDeviceDisconnectedyySS8deviceId_Si4rssiSS4nameSb11connectablet_tF":{"name":"polarDeviceDisconnected(_:)","abstract":"

      Connection lost to Polar device.","parent_name":"PolarBleApiObserver"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP7cleanupyyF":{"name":"cleanup()","abstract":"

      remove all known devices, which are not in use

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP018startAutoConnectToA6Device_05polarI4Type7RxSwift17PrimitiveSequenceVyAF16CompletableTraitOs5NeverOGSi_SSSgtF":{"name":"startAutoConnectToPolarDevice(_:polarDeviceType:)","abstract":"

      Start connecting to a nearby Polar device. PolarBleApiObservers polarDeviceConnected is","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP09connectToA6DeviceyySSF":{"name":"connectToPolarDevice(_:)","abstract":"

      Request a connection to a Polar device. Invokes PolarBleApiObservers polarDeviceConnected.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP014disconnectFromA6DeviceyySSF":{"name":"disconnectFromPolarDevice(_:)","abstract":"

      Disconnect from the current Polar device.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP09searchForA6Device7RxSwift10ObservableCySS8deviceId_Si4rssiSS4nameSb11connectabletGyF":{"name":"searchForPolarDevice()","abstract":"

      Start searching for Polar device(s)

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP14isFeatureReady_7featureSbSS_AA8FeaturesOtF":{"name":"isFeatureReady(_:feature:)","abstract":"

      helper to check is feature ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP12setLocalTime_4time4zone7RxSwift17PrimitiveSequenceVyAG16CompletableTraitOs5NeverOGSS_10Foundation4DateVAO0G4ZoneVtF":{"name":"setLocalTime(_:time:zone:)","abstract":"

      set local time to device, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP14startRecording_10exerciseId8interval10sampleType7RxSwift17PrimitiveSequenceVyAH16CompletableTraitOs5NeverOGSS_SSAA0F8IntervalOAA06SampleK0OtF":{"name":"startRecording(_:exerciseId:interval:sampleType:)","abstract":"

      request start recording, only H10 supported, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP13stopRecordingy7RxSwift17PrimitiveSequenceVyAE16CompletableTraitOs5NeverOGSSF":{"name":"stopRecording(_:)","abstract":"

      request stop for current recording, only H10 supported, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP22requestRecordingStatusy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOSb7ongoing_SS7entryIdtGSSF":{"name":"requestRecordingStatus(_:)","abstract":"

      request current recording status, only H10 supported, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP014startListenForA12HrBroadcastsy7RxSwift10ObservableCySS8deviceId_Si4rssiSS4nameSb11connectablet0M4Info_s5UInt8V2hrSb13batteryStatustGShySSGSgF":{"name":"startListenForPolarHrBroadcasts(_:)","abstract":"

      Start listening to broadcasts from one or more Polar devices

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18requestEcgSettingsy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOAA0A13SensorSettingVGSSF":{"name":"requestEcgSettings(_:)","abstract":"

      request ecg settings available

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18requestAccSettingsy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOAA0A13SensorSettingVGSSF":{"name":"requestAccSettings(_:)","abstract":"

      request acc settings available

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18requestPpgSettingsy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOAA0A13SensorSettingVGSSF":{"name":"requestPpgSettings(_:)","abstract":"

      request ppg settings available

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP17startEcgStreaming_8settings7RxSwift10ObservableCys6UInt64V9timeStamp_Says5Int32VG7samplestGSS_AA0A13SensorSettingVtF":{"name":"startEcgStreaming(_:settings:)","abstract":"

      Starts the ECG (Electrocardiography) stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP17startAccStreaming_8settings7RxSwift10ObservableCys6UInt64V9timeStamp_Says5Int32V1x_AM1yAM1ztG7samplestGSS_AA0A13SensorSettingVtF":{"name":"startAccStreaming(_:settings:)","abstract":"

      Start ACC (accelerometer) stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP20startOhrPPGStreaming_8settings7RxSwift10ObservableCys6UInt64V9timeStamp_Says5Int32V4ppg0_AM4ppg1AM4ppg2AM7ambienttG7samplestGSS_AA0A13SensorSettingVtF":{"name":"startOhrPPGStreaming(_:settings:)","abstract":"

      Start an OHR (optical heart rate) PPG (photoplethysmography) stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP20startOhrPPIStreamingy7RxSwift10ObservableCys6UInt64V9timeStamp_SaySi2hr_s6UInt16V6ppInMsAM0P13ErrorEstimateSi10blockerBitSi17skinContactStatusSi0wX9SupportedtG7samplestGSSF":{"name":"startOhrPPIStreaming(_:)","abstract":"

      Start PPI stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP23fetchStoredExerciseListy7RxSwift10ObservableCySS4path_10Foundation4DateV4dateSS7entryIdtGSSF":{"name":"fetchStoredExerciseList(_:)","abstract":"

      Api for fetching stored exercises from Polar OH1/H10 device

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP13fetchExercise_5entry7RxSwift17PrimitiveSequenceVyAF11SingleTraitOs6UInt32V8interval_SayALG7samplestGSS_SS4path_10Foundation4DateV4dateSS0G2IdttF":{"name":"fetchExercise(_:entry:)","abstract":"

      Api for fetching a single exersice from Polar OH1/H10 device

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP14removeExercise_5entry7RxSwift17PrimitiveSequenceVyAF16CompletableTraitOs5NeverOGSS_SS4path_10Foundation4DateV4dateSS0G2IdttF":{"name":"removeExercise(_:entry:)","abstract":"

      Remove single exercise from device

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP8observerAA0abD8Observer_pSgvp":{"name":"observer","abstract":"

      Common GAP (Generic access profile) observer

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18deviceInfoObserverAA0abd6DevicefG0_pSgvp":{"name":"deviceInfoObserver","abstract":"

      Device info observer for DIS (Device information servive) and BAS (Battery service) GATT (Generic attributes) client

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP16deviceHrObserverAA0abd6DevicefG0_pSgvp":{"name":"deviceHrObserver","abstract":"

      Device observer for HR GATT client

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18powerStateObserverAA0abd5PowerfG0_pSgvp":{"name":"powerStateObserver","abstract":"

      Bluetooth power state observer

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP22deviceFeaturesObserverAA0abd6DevicefG0_pSgvp":{"name":"deviceFeaturesObserver","abstract":"

      device features ready observer

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP02isB7PoweredSbvp":{"name":"isBlePowered","abstract":"

      Helper to check if Ble is currently powered

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP6loggerAA0abD6Logger_pSgvp":{"name":"logger","abstract":"

      optional logger set to get traces from sdk

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html":{"name":"PolarBleApi","abstract":"

      Main class of the API.

      "},"Protocols/PolarBleApiObserver.html":{"name":"PolarBleApiObserver","abstract":"

      Polar Ble API connection observer.

      "},"Protocols/PolarBleApiDeviceFeaturesObserver.html":{"name":"PolarBleApiDeviceFeaturesObserver","abstract":"

      Data client observer

      "},"Protocols/PolarBleApiDeviceHrObserver.html":{"name":"PolarBleApiDeviceHrObserver","abstract":"

      Heart rate observer

      "},"Protocols/PolarBleApiDeviceInfoObserver.html":{"name":"PolarBleApiDeviceInfoObserver","abstract":"

      Device info observer.

      "},"Protocols/PolarBleApiPowerStateObserver.html":{"name":"PolarBleApiPowerStateObserver","abstract":"

      Bluetooth state observer.

      "},"Protocols/PolarBleApiLogger.html":{"name":"PolarBleApiLogger","abstract":"

      logger observer

      "},"Structs/PolarSensorSetting.html":{"name":"PolarSensorSetting","abstract":"

      polar sensor settings class

      "},"API.html":{"name":"API"},"PolarErrors.html":{"name":"PolarErrors"},"API Default Implementation.html":{"name":"API Default Implementation"},"Other Enums.html":{"name":"Other Enumerations","abstract":"

      The following enumerations are available globally.

      "},"Other Typealiases.html":{"name":"Other Type Aliases","abstract":"

      The following type aliases are available globally.

      "}} \ No newline at end of file diff --git a/polar-sdk-ios/docs/docsets/.docset/Contents/Resources/docSet.dsidx b/polar-sdk-ios/docs/docsets/.docset/Contents/Resources/docSet.dsidx index 3fa0b9e4..55bd3f80 100644 Binary files a/polar-sdk-ios/docs/docsets/.docset/Contents/Resources/docSet.dsidx and b/polar-sdk-ios/docs/docsets/.docset/Contents/Resources/docSet.dsidx differ diff --git a/polar-sdk-ios/docs/search.json b/polar-sdk-ios/docs/search.json index a8d9ce24..5fc6dbc1 100644 --- a/polar-sdk-ios/docs/search.json +++ b/polar-sdk-ios/docs/search.json @@ -1 +1 @@ -{"Other Typealiases.html#/s:11PolarBleSdk0A10DeviceInfoa":{"name":"PolarDeviceInfo","abstract":"

      Polar device info

      "},"Other Typealiases.html#/s:11PolarBleSdk0A15HrBroadcastDataa":{"name":"PolarHrBroadcastData","abstract":"

      deviceInfo: see #PolarDeviceInfo ,

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7EcgDataa":{"name":"PolarEcgData","abstract":"

      Polar Ecg data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7AccDataa":{"name":"PolarAccData","abstract":"

      Polar acc data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7PpgDataa":{"name":"PolarPpgData","abstract":"

      Polar ppg data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7PpiDataa":{"name":"PolarPpiData","abstract":"

      Polar ppi data"},"Other Typealiases.html#/s:11PolarBleSdk0A13ExerciseEntrya":{"name":"PolarExerciseEntry","abstract":"

      Polar exercise entry

      "},"Other Typealiases.html#/s:11PolarBleSdk0A12ExerciseDataa":{"name":"PolarExerciseData","abstract":"

      Polar Exercise Data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A15RecordingStatusa":{"name":"PolarRecordingStatus","abstract":"

      Polar Recording status

      "},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO2hryA2CmF":{"name":"hr","abstract":"

      hr feature enables hr client to receive hr and rr data from device

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO10deviceInfoyA2CmF":{"name":"deviceInfo","abstract":"

      deviceInfo enables dis client to receive fw information from device

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO13batteryStatusyA2CmF":{"name":"batteryStatus","abstract":"

      batteryStatus enables bas client to receive battery level info from device

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO20polarSensorStreamingyA2CmF":{"name":"polarSensorStreaming","abstract":"

      polarSensorStreaming enables stream client to start acc, ppg, ecg, ppi streams

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO17polarFileTransferyA2CmF":{"name":"polarFileTransfer","abstract":"

      polarFileTransfer enables file transfer client to list and read stored exercises,","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO03allD0yA2CmF":{"name":"allFeatures","abstract":"

      allFeatures enables all features available

      ","parent_name":"Features"},"Enums/SampleType.html#/s:11PolarBleSdk10SampleTypeO2hryA2CmF":{"name":"hr","abstract":"

      recording type to use is hr in BPM

      ","parent_name":"SampleType"},"Enums/SampleType.html#/s:11PolarBleSdk10SampleTypeO2rryA2CmF":{"name":"rr","abstract":"

      recording type to use is rr interval

      ","parent_name":"SampleType"},"Other Enums.html#/s:11PolarBleSdk17RecordingIntervalO":{"name":"RecordingInterval","abstract":"

      recording interval in seconds for H10

      "},"Enums/SampleType.html":{"name":"SampleType","abstract":"

      sample type for H10 recording

      "},"Enums/Features.html":{"name":"Features","abstract":"

      features available

      "},"Classes/PolarBleApiDefaultImpl.html#/s:11PolarBleSdk0aB14ApiDefaultImplC19polarImplementation_8featuresAA0abD0_pSo17OS_dispatch_queueC_SitFZ":{"name":"polarImplementation(_:features:)","abstract":"

      New instance of Polar Ble API implementation

      ","parent_name":"PolarBleApiDefaultImpl"},"Classes/PolarBleApiDefaultImpl.html#/s:11PolarBleSdk0aB14ApiDefaultImplC11versionInfoSSyFZ":{"name":"versionInfo()","abstract":"

      Return current version

      ","parent_name":"PolarBleApiDefaultImpl"},"Classes/PolarBleApiDefaultImpl.html":{"name":"PolarBleApiDefaultImpl","abstract":"

      Class to provide the default implementation of the Polar Ble API

      "},"PolarErrors.html#/s:11PolarBleSdk20DateTimeFormatFailedC":{"name":"DateTimeFormatFailed","abstract":"

      String to date time formatting failed

      "},"PolarErrors.html#/s:11PolarBleSdk18DeviceNotConnectedC":{"name":"DeviceNotConnected","abstract":"

      Device state != Connected

      "},"PolarErrors.html#/s:11PolarBleSdk14DeviceNotFoundC":{"name":"DeviceNotFound","abstract":"

      Device not found

      "},"PolarErrors.html#/s:11PolarBleSdk19MessageEncodeFailedC":{"name":"MessageEncodeFailed","abstract":"

      Google protocol buffers encode failed

      "},"PolarErrors.html#/s:11PolarBleSdk19MessageDecodeFailedC":{"name":"MessageDecodeFailed","abstract":"

      Google protocol buffers decode failed

      "},"PolarErrors.html#/s:11PolarBleSdk22NotificationNotEnabledC":{"name":"NotificationNotEnabled","abstract":"

      GATT characteristic notification not enabled

      "},"PolarErrors.html#/s:11PolarBleSdk21OperationNotSupportedC":{"name":"OperationNotSupported","abstract":"

      Requested operation is not supported

      "},"PolarErrors.html#/s:11PolarBleSdk15ServiceNotFoundC":{"name":"ServiceNotFound","abstract":"

      GATT service not found

      "},"PolarErrors.html#/s:11PolarBleSdk22UnableToStartStreamingC":{"name":"UnableToStartStreaming","abstract":"

      Failed to start streaming

      "},"PolarErrors.html#/s:11PolarBleSdk15InvalidArgumentC":{"name":"InvalidArgument","abstract":"

      invalid argument

      "},"PolarErrors.html#/s:11PolarBleSdk14UndefinedErrorO":{"name":"UndefinedError","abstract":"

      Unknown error

      "},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO10sampleRateyA2EmF":{"name":"sampleRate","abstract":"

      sample rate in hz

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO10resolutionyA2EmF":{"name":"resolution","abstract":"

      resolution in bits

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO5rangeyA2EmF":{"name":"range","abstract":"

      range in g’s

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO7unknownyA2EmF":{"name":"unknown","abstract":"

      type is unknown

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html":{"name":"SettingType","abstract":"

      settings type

      ","parent_name":"PolarSensorSetting"},"Structs/PolarSensorSetting.html#/s:11PolarBleSdk0A13SensorSettingV8settingsSDyAC0E4TypeOShys6UInt16VGGvp":{"name":"settings","abstract":"

      current settings available / set

      ","parent_name":"PolarSensorSetting"},"Structs/PolarSensorSetting.html#/s:11PolarBleSdk0A13SensorSettingVyACSDyAC0E4TypeOs6UInt16VGcfc":{"name":"init(_:)","abstract":"

      constructor with desired settings

      ","parent_name":"PolarSensorSetting"},"Structs/PolarSensorSetting.html#/s:11PolarBleSdk0A13SensorSettingV11maxSettingsACyF":{"name":"maxSettings()","abstract":"

      helper to retreive max settings available

      ","parent_name":"PolarSensorSetting"},"Protocols/PolarBleApiLogger.html#/s:11PolarBleSdk0aB9ApiLoggerP7messageyySSF":{"name":"message(_:)","abstract":"

      log message from sdk

      ","parent_name":"PolarBleApiLogger"},"Protocols/PolarBleApiPowerStateObserver.html#/s:11PolarBleSdk0aB21ApiPowerStateObserverP03bleE2OnyyF":{"name":"blePowerOn()","abstract":"

      Ble powered on event.

      ","parent_name":"PolarBleApiPowerStateObserver"},"Protocols/PolarBleApiPowerStateObserver.html#/s:11PolarBleSdk0aB21ApiPowerStateObserverP03bleE3OffyyF":{"name":"blePowerOff()","abstract":"

      Ble powered off event, no further actions are needed from the application.

      ","parent_name":"PolarBleApiPowerStateObserver"},"Protocols/PolarBleApiDeviceInfoObserver.html#/s:11PolarBleSdk0aB21ApiDeviceInfoObserverP20batteryLevelReceived_0hI0ySS_SutF":{"name":"batteryLevelReceived(_:batteryLevel:)","abstract":"

      Battery level received from device.

      ","parent_name":"PolarBleApiDeviceInfoObserver"},"Protocols/PolarBleApiDeviceInfoObserver.html#/s:11PolarBleSdk0aB21ApiDeviceInfoObserverP17fwVersionReceived_0hI0ySS_SStF":{"name":"fwVersionReceived(_:fwVersion:)","abstract":"

      Received firmware version info.

      ","parent_name":"PolarBleApiDeviceInfoObserver"},"Protocols/PolarBleApiDeviceHrObserver.html#/s:11PolarBleSdk0aB19ApiDeviceHrObserverP0aF4Dataa":{"name":"PolarHrData","abstract":"

      Polar hr data

      ","parent_name":"PolarBleApiDeviceHrObserver"},"Protocols/PolarBleApiDeviceHrObserver.html#/s:11PolarBleSdk0aB19ApiDeviceHrObserverP15hrValueReceived_4dataySS_s5UInt8V0H0_SaySiG3rrsAI0M2MsSb7contactSb0O9SupportedttF":{"name":"hrValueReceived(_:data:)","abstract":"

      HR notification received.

      ","parent_name":"PolarBleApiDeviceHrObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP14hrFeatureReadyyySSF":{"name":"hrFeatureReady(_:)","abstract":"

      Device HR feature is ready. HR transmission is starting in a short while.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP15ecgFeatureReadyyySSF":{"name":"ecgFeatureReady(_:)","abstract":"

      Device ECG feature is ready. Application can now start ECG streaming.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP15accFeatureReadyyySSF":{"name":"accFeatureReady(_:)","abstract":"

      Device ACC feature is ready. Application can now start ACC streaming.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP18ohrPPGFeatureReadyyySSF":{"name":"ohrPPGFeatureReady(_:)","abstract":"

      Device OHR PPG feature is ready.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP18ohrPPIFeatureReadyyySSF":{"name":"ohrPPIFeatureReady(_:)","abstract":"

      Device OHR PPG feature is ready.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP15ftpFeatureReadyyySSF":{"name":"ftpFeatureReady(_:)","abstract":"

      Device file transfer protocol is ready.","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiObserver.html#/s:11PolarBleSdk0aB11ApiObserverP21polarDeviceConnectingyySS8deviceId_Si4rssiSS4nameSb11connectablet_tF":{"name":"polarDeviceConnecting(_:)","abstract":"

      Callback when connection attempt is started to polar device

      ","parent_name":"PolarBleApiObserver"},"Protocols/PolarBleApiObserver.html#/s:11PolarBleSdk0aB11ApiObserverP20polarDeviceConnectedyySS8deviceId_Si4rssiSS4nameSb11connectablet_tF":{"name":"polarDeviceConnected(_:)","abstract":"

      Device connnection has been established.

      ","parent_name":"PolarBleApiObserver"},"Protocols/PolarBleApiObserver.html#/s:11PolarBleSdk0aB11ApiObserverP23polarDeviceDisconnectedyySS8deviceId_Si4rssiSS4nameSb11connectablet_tF":{"name":"polarDeviceDisconnected(_:)","abstract":"

      Connection lost to Polar device.","parent_name":"PolarBleApiObserver"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP7cleanupyyF":{"name":"cleanup()","abstract":"

      remove all known devices, which are not in use

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP018startAutoConnectToA6Device_05polarI4Type7RxSwift17PrimitiveSequenceVyAF16CompletableTraitOs5NeverOGSi_SSSgtF":{"name":"startAutoConnectToPolarDevice(_:polarDeviceType:)","abstract":"

      Start connecting to a nearby Polar device. PolarBleApiObservers polarDeviceConnected is","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP09connectToA6DeviceyySSF":{"name":"connectToPolarDevice(_:)","abstract":"

      Request a connection to a Polar device. Invokes PolarBleApiObservers polarDeviceConnected.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP014disconnectFromA6DeviceyySSF":{"name":"disconnectFromPolarDevice(_:)","abstract":"

      Disconnect from the current Polar device.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP09searchForA6Device7RxSwift10ObservableCySS8deviceId_Si4rssiSS4nameSb11connectabletGyF":{"name":"searchForPolarDevice()","abstract":"

      Start searching for Polar device(s)

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP14isFeatureReady_7featureSbSS_AA8FeaturesOtF":{"name":"isFeatureReady(_:feature:)","abstract":"

      helper to check is feature ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP12setLocalTime_4time7RxSwift17PrimitiveSequenceVyAF16CompletableTraitOs5NeverOGSS_10Foundation4DateVtF":{"name":"setLocalTime(_:time:)","abstract":"

      set local time to device, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP14startRecording_10exerciseId8interval10sampleType7RxSwift17PrimitiveSequenceVyAH16CompletableTraitOs5NeverOGSS_SSAA0F8IntervalOAA06SampleK0OtF":{"name":"startRecording(_:exerciseId:interval:sampleType:)","abstract":"

      request start recording, only H10 supported, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP13stopRecordingy7RxSwift17PrimitiveSequenceVyAE16CompletableTraitOs5NeverOGSSF":{"name":"stopRecording(_:)","abstract":"

      request stop for current recording, only H10 supported, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP22requestRecordingStatusy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOSb7ongoing_SS7entryIdtGSSF":{"name":"requestRecordingStatus(_:)","abstract":"

      request current recording status, only H10 supported, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP014startListenForA12HrBroadcastsy7RxSwift10ObservableCySS8deviceId_Si4rssiSS4nameSb11connectablet0M4Info_s5UInt8V2hrSb13batteryStatustGShySSGSgF":{"name":"startListenForPolarHrBroadcasts(_:)","abstract":"

      Start listening to broadcasts from one or more Polar devices

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18requestEcgSettingsy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOAA0A13SensorSettingVGSSF":{"name":"requestEcgSettings(_:)","abstract":"

      request ecg settings available

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18requestAccSettingsy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOAA0A13SensorSettingVGSSF":{"name":"requestAccSettings(_:)","abstract":"

      request acc settings available

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18requestPpgSettingsy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOAA0A13SensorSettingVGSSF":{"name":"requestPpgSettings(_:)","abstract":"

      request ppg settings available

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP17startEcgStreaming_8settings7RxSwift10ObservableCys6UInt64V9timeStamp_Says5Int32VG7samplestGSS_AA0A13SensorSettingVtF":{"name":"startEcgStreaming(_:settings:)","abstract":"

      Starts the ECG (Electrocardiography) stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP17startAccStreaming_8settings7RxSwift10ObservableCys6UInt64V9timeStamp_Says5Int32V1x_AM1yAM1ztG7samplestGSS_AA0A13SensorSettingVtF":{"name":"startAccStreaming(_:settings:)","abstract":"

      Start ACC (accelerometer) stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP20startOhrPPGStreaming_8settings7RxSwift10ObservableCys6UInt64V9timeStamp_Says5Int32V4ppg0_AM4ppg1AM4ppg2AM7ambienttG7samplestGSS_AA0A13SensorSettingVtF":{"name":"startOhrPPGStreaming(_:settings:)","abstract":"

      Start an OHR (optical heart rate) PPG (photoplethysmography) stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP20startOhrPPIStreamingy7RxSwift10ObservableCys6UInt64V9timeStamp_SaySi2hr_s6UInt16V6ppInMsAM0P13ErrorEstimateSi10blockerBitSi17skinContactStatusSi0wX9SupportedtG7samplestGSSF":{"name":"startOhrPPIStreaming(_:)","abstract":"

      Start PPI stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP23fetchStoredExerciseListy7RxSwift10ObservableCySS4path_10Foundation4DateV4dateSS7entryIdtGSSF":{"name":"fetchStoredExerciseList(_:)","abstract":"

      Api for fetching stored exercises from Polar OH1/H10 device

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP13fetchExercise_5entry7RxSwift17PrimitiveSequenceVyAF11SingleTraitOs6UInt32V8interval_SayALG7samplestGSS_SS4path_10Foundation4DateV4dateSS0G2IdttF":{"name":"fetchExercise(_:entry:)","abstract":"

      Api for fetching a single exersice from Polar OH1/H10 device

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP14removeExercise_5entry7RxSwift17PrimitiveSequenceVyAF16CompletableTraitOs5NeverOGSS_SS4path_10Foundation4DateV4dateSS0G2IdttF":{"name":"removeExercise(_:entry:)","abstract":"

      Remove single exercise from device

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP8observerAA0abD8Observer_pSgvp":{"name":"observer","abstract":"

      Common GAP (Generic access profile) observer

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18deviceInfoObserverAA0abd6DevicefG0_pSgvp":{"name":"deviceInfoObserver","abstract":"

      Device info observer for DIS (Device information servive) and BAS (Battery service) GATT (Generic attributes) client

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP16deviceHrObserverAA0abd6DevicefG0_pSgvp":{"name":"deviceHrObserver","abstract":"

      Device observer for HR GATT client

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18powerStateObserverAA0abd5PowerfG0_pSgvp":{"name":"powerStateObserver","abstract":"

      Bluetooth power state observer

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP22deviceFeaturesObserverAA0abd6DevicefG0_pSgvp":{"name":"deviceFeaturesObserver","abstract":"

      device features ready observer

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP02isB7PoweredSbvp":{"name":"isBlePowered","abstract":"

      Helper to check if Ble is currently powered

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP6loggerAA0abD6Logger_pSgvp":{"name":"logger","abstract":"

      optional logger set to get traces from sdk

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html":{"name":"PolarBleApi","abstract":"

      Main class of the API.

      "},"Protocols/PolarBleApiObserver.html":{"name":"PolarBleApiObserver","abstract":"

      Polar Ble API connection observer.

      "},"Protocols/PolarBleApiDeviceFeaturesObserver.html":{"name":"PolarBleApiDeviceFeaturesObserver","abstract":"

      Data client observer

      "},"Protocols/PolarBleApiDeviceHrObserver.html":{"name":"PolarBleApiDeviceHrObserver","abstract":"

      Heart rate observer

      "},"Protocols/PolarBleApiDeviceInfoObserver.html":{"name":"PolarBleApiDeviceInfoObserver","abstract":"

      Device info observer.

      "},"Protocols/PolarBleApiPowerStateObserver.html":{"name":"PolarBleApiPowerStateObserver","abstract":"

      Bluetooth state observer.

      "},"Protocols/PolarBleApiLogger.html":{"name":"PolarBleApiLogger","abstract":"

      logger observer

      "},"Structs/PolarSensorSetting.html":{"name":"PolarSensorSetting","abstract":"

      polar sensor settings class

      "},"API.html":{"name":"API"},"PolarErrors.html":{"name":"PolarErrors"},"API Default Implementation.html":{"name":"API Default Implementation"},"Other Enums.html":{"name":"Other Enumerations","abstract":"

      The following enumerations are available globally.

      "},"Other Typealiases.html":{"name":"Other Type Aliases","abstract":"

      The following type aliases are available globally.

      "}} \ No newline at end of file +{"Other Typealiases.html#/s:11PolarBleSdk0A10DeviceInfoa":{"name":"PolarDeviceInfo","abstract":"

      Polar device info

      "},"Other Typealiases.html#/s:11PolarBleSdk0A15HrBroadcastDataa":{"name":"PolarHrBroadcastData","abstract":"

      deviceInfo: see #PolarDeviceInfo ,

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7EcgDataa":{"name":"PolarEcgData","abstract":"

      Polar Ecg data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7AccDataa":{"name":"PolarAccData","abstract":"

      Polar acc data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7PpgDataa":{"name":"PolarPpgData","abstract":"

      Polar ppg data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A7PpiDataa":{"name":"PolarPpiData","abstract":"

      Polar ppi data"},"Other Typealiases.html#/s:11PolarBleSdk0A13ExerciseEntrya":{"name":"PolarExerciseEntry","abstract":"

      Polar exercise entry

      "},"Other Typealiases.html#/s:11PolarBleSdk0A12ExerciseDataa":{"name":"PolarExerciseData","abstract":"

      Polar Exercise Data

      "},"Other Typealiases.html#/s:11PolarBleSdk0A15RecordingStatusa":{"name":"PolarRecordingStatus","abstract":"

      Polar Recording status

      "},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO2hryA2CmF":{"name":"hr","abstract":"

      hr feature enables hr client to receive hr and rr data from device

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO10deviceInfoyA2CmF":{"name":"deviceInfo","abstract":"

      deviceInfo enables dis client to receive fw information from device

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO13batteryStatusyA2CmF":{"name":"batteryStatus","abstract":"

      batteryStatus enables bas client to receive battery level info from device

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO20polarSensorStreamingyA2CmF":{"name":"polarSensorStreaming","abstract":"

      polarSensorStreaming enables stream client to start acc, ppg, ecg, ppi streams

      ","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO17polarFileTransferyA2CmF":{"name":"polarFileTransfer","abstract":"

      polarFileTransfer enables file transfer client to list and read stored exercises,","parent_name":"Features"},"Enums/Features.html#/s:11PolarBleSdk8FeaturesO03allD0yA2CmF":{"name":"allFeatures","abstract":"

      allFeatures enables all features available

      ","parent_name":"Features"},"Enums/SampleType.html#/s:11PolarBleSdk10SampleTypeO2hryA2CmF":{"name":"hr","abstract":"

      recording type to use is hr in BPM

      ","parent_name":"SampleType"},"Enums/SampleType.html#/s:11PolarBleSdk10SampleTypeO2rryA2CmF":{"name":"rr","abstract":"

      recording type to use is rr interval

      ","parent_name":"SampleType"},"Other Enums.html#/s:11PolarBleSdk17RecordingIntervalO":{"name":"RecordingInterval","abstract":"

      recording interval in seconds for H10

      "},"Enums/SampleType.html":{"name":"SampleType","abstract":"

      sample type for H10 recording

      "},"Enums/Features.html":{"name":"Features","abstract":"

      features available

      "},"Classes/PolarBleApiDefaultImpl.html#/s:11PolarBleSdk0aB14ApiDefaultImplC19polarImplementation_8featuresAA0abD0_pSo17OS_dispatch_queueC_SitFZ":{"name":"polarImplementation(_:features:)","abstract":"

      New instance of Polar Ble API implementation

      ","parent_name":"PolarBleApiDefaultImpl"},"Classes/PolarBleApiDefaultImpl.html#/s:11PolarBleSdk0aB14ApiDefaultImplC11versionInfoSSyFZ":{"name":"versionInfo()","abstract":"

      Return current version

      ","parent_name":"PolarBleApiDefaultImpl"},"Classes/PolarBleApiDefaultImpl.html":{"name":"PolarBleApiDefaultImpl","abstract":"

      Class to provide the default implementation of the Polar Ble API

      "},"PolarErrors.html#/s:11PolarBleSdk20DateTimeFormatFailedC":{"name":"DateTimeFormatFailed","abstract":"

      String to date time formatting failed

      "},"PolarErrors.html#/s:11PolarBleSdk18DeviceNotConnectedC":{"name":"DeviceNotConnected","abstract":"

      Device state != Connected

      "},"PolarErrors.html#/s:11PolarBleSdk14DeviceNotFoundC":{"name":"DeviceNotFound","abstract":"

      Device not found

      "},"PolarErrors.html#/s:11PolarBleSdk19MessageEncodeFailedC":{"name":"MessageEncodeFailed","abstract":"

      Google protocol buffers encode failed

      "},"PolarErrors.html#/s:11PolarBleSdk19MessageDecodeFailedC":{"name":"MessageDecodeFailed","abstract":"

      Google protocol buffers decode failed

      "},"PolarErrors.html#/s:11PolarBleSdk22NotificationNotEnabledC":{"name":"NotificationNotEnabled","abstract":"

      GATT characteristic notification not enabled

      "},"PolarErrors.html#/s:11PolarBleSdk21OperationNotSupportedC":{"name":"OperationNotSupported","abstract":"

      Requested operation is not supported

      "},"PolarErrors.html#/s:11PolarBleSdk15ServiceNotFoundC":{"name":"ServiceNotFound","abstract":"

      GATT service not found

      "},"PolarErrors.html#/s:11PolarBleSdk22UnableToStartStreamingC":{"name":"UnableToStartStreaming","abstract":"

      Failed to start streaming

      "},"PolarErrors.html#/s:11PolarBleSdk15InvalidArgumentC":{"name":"InvalidArgument","abstract":"

      invalid argument

      "},"PolarErrors.html#/s:11PolarBleSdk14UndefinedErrorO":{"name":"UndefinedError","abstract":"

      Unknown error

      "},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO10sampleRateyA2EmF":{"name":"sampleRate","abstract":"

      sample rate in hz

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO10resolutionyA2EmF":{"name":"resolution","abstract":"

      resolution in bits

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO5rangeyA2EmF":{"name":"range","abstract":"

      range in g’s

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html#/s:11PolarBleSdk0A13SensorSettingV0E4TypeO7unknownyA2EmF":{"name":"unknown","abstract":"

      type is unknown

      ","parent_name":"SettingType"},"Structs/PolarSensorSetting/SettingType.html":{"name":"SettingType","abstract":"

      settings type

      ","parent_name":"PolarSensorSetting"},"Structs/PolarSensorSetting.html#/s:11PolarBleSdk0A13SensorSettingV8settingsSDyAC0E4TypeOShys6UInt16VGGvp":{"name":"settings","abstract":"

      current settings available / set

      ","parent_name":"PolarSensorSetting"},"Structs/PolarSensorSetting.html#/s:11PolarBleSdk0A13SensorSettingVyACSDyAC0E4TypeOs6UInt16VGcfc":{"name":"init(_:)","abstract":"

      constructor with desired settings

      ","parent_name":"PolarSensorSetting"},"Structs/PolarSensorSetting.html#/s:11PolarBleSdk0A13SensorSettingV11maxSettingsACyF":{"name":"maxSettings()","abstract":"

      helper to retreive max settings available

      ","parent_name":"PolarSensorSetting"},"Protocols/PolarBleApiLogger.html#/s:11PolarBleSdk0aB9ApiLoggerP7messageyySSF":{"name":"message(_:)","abstract":"

      log message from sdk

      ","parent_name":"PolarBleApiLogger"},"Protocols/PolarBleApiPowerStateObserver.html#/s:11PolarBleSdk0aB21ApiPowerStateObserverP03bleE2OnyyF":{"name":"blePowerOn()","abstract":"

      Ble powered on event.

      ","parent_name":"PolarBleApiPowerStateObserver"},"Protocols/PolarBleApiPowerStateObserver.html#/s:11PolarBleSdk0aB21ApiPowerStateObserverP03bleE3OffyyF":{"name":"blePowerOff()","abstract":"

      Ble powered off event, no further actions are needed from the application.

      ","parent_name":"PolarBleApiPowerStateObserver"},"Protocols/PolarBleApiDeviceInfoObserver.html#/s:11PolarBleSdk0aB21ApiDeviceInfoObserverP20batteryLevelReceived_0hI0ySS_SutF":{"name":"batteryLevelReceived(_:batteryLevel:)","abstract":"

      Battery level received from device.

      ","parent_name":"PolarBleApiDeviceInfoObserver"},"Protocols/PolarBleApiDeviceInfoObserver.html#/s:11PolarBleSdk0aB21ApiDeviceInfoObserverP17fwVersionReceived_0hI0ySS_SStF":{"name":"fwVersionReceived(_:fwVersion:)","abstract":"

      Received firmware version info.

      ","parent_name":"PolarBleApiDeviceInfoObserver"},"Protocols/PolarBleApiDeviceHrObserver.html#/s:11PolarBleSdk0aB19ApiDeviceHrObserverP0aF4Dataa":{"name":"PolarHrData","abstract":"

      Polar hr data

      ","parent_name":"PolarBleApiDeviceHrObserver"},"Protocols/PolarBleApiDeviceHrObserver.html#/s:11PolarBleSdk0aB19ApiDeviceHrObserverP15hrValueReceived_4dataySS_s5UInt8V0H0_SaySiG3rrsAI0M2MsSb7contactSb0O9SupportedttF":{"name":"hrValueReceived(_:data:)","abstract":"

      HR notification received.

      ","parent_name":"PolarBleApiDeviceHrObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP14hrFeatureReadyyySSF":{"name":"hrFeatureReady(_:)","abstract":"

      Device HR feature is ready. HR transmission is starting in a short while.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP15ecgFeatureReadyyySSF":{"name":"ecgFeatureReady(_:)","abstract":"

      Device ECG feature is ready. Application can now start ECG streaming.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP15accFeatureReadyyySSF":{"name":"accFeatureReady(_:)","abstract":"

      Device ACC feature is ready. Application can now start ACC streaming.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP18ohrPPGFeatureReadyyySSF":{"name":"ohrPPGFeatureReady(_:)","abstract":"

      Device OHR PPG feature is ready.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP18ohrPPIFeatureReadyyySSF":{"name":"ohrPPIFeatureReady(_:)","abstract":"

      Device OHR PPG feature is ready.

      ","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiDeviceFeaturesObserver.html#/s:11PolarBleSdk0aB25ApiDeviceFeaturesObserverP15ftpFeatureReadyyySSF":{"name":"ftpFeatureReady(_:)","abstract":"

      Device file transfer protocol is ready.","parent_name":"PolarBleApiDeviceFeaturesObserver"},"Protocols/PolarBleApiObserver.html#/s:11PolarBleSdk0aB11ApiObserverP21polarDeviceConnectingyySS8deviceId_Si4rssiSS4nameSb11connectablet_tF":{"name":"polarDeviceConnecting(_:)","abstract":"

      Callback when connection attempt is started to polar device

      ","parent_name":"PolarBleApiObserver"},"Protocols/PolarBleApiObserver.html#/s:11PolarBleSdk0aB11ApiObserverP20polarDeviceConnectedyySS8deviceId_Si4rssiSS4nameSb11connectablet_tF":{"name":"polarDeviceConnected(_:)","abstract":"

      Device connnection has been established.

      ","parent_name":"PolarBleApiObserver"},"Protocols/PolarBleApiObserver.html#/s:11PolarBleSdk0aB11ApiObserverP23polarDeviceDisconnectedyySS8deviceId_Si4rssiSS4nameSb11connectablet_tF":{"name":"polarDeviceDisconnected(_:)","abstract":"

      Connection lost to Polar device.","parent_name":"PolarBleApiObserver"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP7cleanupyyF":{"name":"cleanup()","abstract":"

      remove all known devices, which are not in use

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP018startAutoConnectToA6Device_05polarI4Type7RxSwift17PrimitiveSequenceVyAF16CompletableTraitOs5NeverOGSi_SSSgtF":{"name":"startAutoConnectToPolarDevice(_:polarDeviceType:)","abstract":"

      Start connecting to a nearby Polar device. PolarBleApiObservers polarDeviceConnected is","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP09connectToA6DeviceyySSF":{"name":"connectToPolarDevice(_:)","abstract":"

      Request a connection to a Polar device. Invokes PolarBleApiObservers polarDeviceConnected.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP014disconnectFromA6DeviceyySSF":{"name":"disconnectFromPolarDevice(_:)","abstract":"

      Disconnect from the current Polar device.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP09searchForA6Device7RxSwift10ObservableCySS8deviceId_Si4rssiSS4nameSb11connectabletGyF":{"name":"searchForPolarDevice()","abstract":"

      Start searching for Polar device(s)

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP14isFeatureReady_7featureSbSS_AA8FeaturesOtF":{"name":"isFeatureReady(_:feature:)","abstract":"

      helper to check is feature ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP12setLocalTime_4time4zone7RxSwift17PrimitiveSequenceVyAG16CompletableTraitOs5NeverOGSS_10Foundation4DateVAO0G4ZoneVtF":{"name":"setLocalTime(_:time:zone:)","abstract":"

      set local time to device, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP14startRecording_10exerciseId8interval10sampleType7RxSwift17PrimitiveSequenceVyAH16CompletableTraitOs5NeverOGSS_SSAA0F8IntervalOAA06SampleK0OtF":{"name":"startRecording(_:exerciseId:interval:sampleType:)","abstract":"

      request start recording, only H10 supported, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP13stopRecordingy7RxSwift17PrimitiveSequenceVyAE16CompletableTraitOs5NeverOGSSF":{"name":"stopRecording(_:)","abstract":"

      request stop for current recording, only H10 supported, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP22requestRecordingStatusy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOSb7ongoing_SS7entryIdtGSSF":{"name":"requestRecordingStatus(_:)","abstract":"

      request current recording status, only H10 supported, requires ftp to be ready

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP014startListenForA12HrBroadcastsy7RxSwift10ObservableCySS8deviceId_Si4rssiSS4nameSb11connectablet0M4Info_s5UInt8V2hrSb13batteryStatustGShySSGSgF":{"name":"startListenForPolarHrBroadcasts(_:)","abstract":"

      Start listening to broadcasts from one or more Polar devices

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18requestEcgSettingsy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOAA0A13SensorSettingVGSSF":{"name":"requestEcgSettings(_:)","abstract":"

      request ecg settings available

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18requestAccSettingsy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOAA0A13SensorSettingVGSSF":{"name":"requestAccSettings(_:)","abstract":"

      request acc settings available

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18requestPpgSettingsy7RxSwift17PrimitiveSequenceVyAE11SingleTraitOAA0A13SensorSettingVGSSF":{"name":"requestPpgSettings(_:)","abstract":"

      request ppg settings available

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP17startEcgStreaming_8settings7RxSwift10ObservableCys6UInt64V9timeStamp_Says5Int32VG7samplestGSS_AA0A13SensorSettingVtF":{"name":"startEcgStreaming(_:settings:)","abstract":"

      Starts the ECG (Electrocardiography) stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP17startAccStreaming_8settings7RxSwift10ObservableCys6UInt64V9timeStamp_Says5Int32V1x_AM1yAM1ztG7samplestGSS_AA0A13SensorSettingVtF":{"name":"startAccStreaming(_:settings:)","abstract":"

      Start ACC (accelerometer) stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP20startOhrPPGStreaming_8settings7RxSwift10ObservableCys6UInt64V9timeStamp_Says5Int32V4ppg0_AM4ppg1AM4ppg2AM7ambienttG7samplestGSS_AA0A13SensorSettingVtF":{"name":"startOhrPPGStreaming(_:settings:)","abstract":"

      Start an OHR (optical heart rate) PPG (photoplethysmography) stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP20startOhrPPIStreamingy7RxSwift10ObservableCys6UInt64V9timeStamp_SaySi2hr_s6UInt16V6ppInMsAM0P13ErrorEstimateSi10blockerBitSi17skinContactStatusSi0wX9SupportedtG7samplestGSSF":{"name":"startOhrPPIStreaming(_:)","abstract":"

      Start PPI stream.

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP23fetchStoredExerciseListy7RxSwift10ObservableCySS4path_10Foundation4DateV4dateSS7entryIdtGSSF":{"name":"fetchStoredExerciseList(_:)","abstract":"

      Api for fetching stored exercises from Polar OH1/H10 device

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP13fetchExercise_5entry7RxSwift17PrimitiveSequenceVyAF11SingleTraitOs6UInt32V8interval_SayALG7samplestGSS_SS4path_10Foundation4DateV4dateSS0G2IdttF":{"name":"fetchExercise(_:entry:)","abstract":"

      Api for fetching a single exersice from Polar OH1/H10 device

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP14removeExercise_5entry7RxSwift17PrimitiveSequenceVyAF16CompletableTraitOs5NeverOGSS_SS4path_10Foundation4DateV4dateSS0G2IdttF":{"name":"removeExercise(_:entry:)","abstract":"

      Remove single exercise from device

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP8observerAA0abD8Observer_pSgvp":{"name":"observer","abstract":"

      Common GAP (Generic access profile) observer

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18deviceInfoObserverAA0abd6DevicefG0_pSgvp":{"name":"deviceInfoObserver","abstract":"

      Device info observer for DIS (Device information servive) and BAS (Battery service) GATT (Generic attributes) client

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP16deviceHrObserverAA0abd6DevicefG0_pSgvp":{"name":"deviceHrObserver","abstract":"

      Device observer for HR GATT client

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP18powerStateObserverAA0abd5PowerfG0_pSgvp":{"name":"powerStateObserver","abstract":"

      Bluetooth power state observer

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP22deviceFeaturesObserverAA0abd6DevicefG0_pSgvp":{"name":"deviceFeaturesObserver","abstract":"

      device features ready observer

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP02isB7PoweredSbvp":{"name":"isBlePowered","abstract":"

      Helper to check if Ble is currently powered

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html#/s:11PolarBleSdk0aB3ApiP6loggerAA0abD6Logger_pSgvp":{"name":"logger","abstract":"

      optional logger set to get traces from sdk

      ","parent_name":"PolarBleApi"},"Protocols/PolarBleApi.html":{"name":"PolarBleApi","abstract":"

      Main class of the API.

      "},"Protocols/PolarBleApiObserver.html":{"name":"PolarBleApiObserver","abstract":"

      Polar Ble API connection observer.

      "},"Protocols/PolarBleApiDeviceFeaturesObserver.html":{"name":"PolarBleApiDeviceFeaturesObserver","abstract":"

      Data client observer

      "},"Protocols/PolarBleApiDeviceHrObserver.html":{"name":"PolarBleApiDeviceHrObserver","abstract":"

      Heart rate observer

      "},"Protocols/PolarBleApiDeviceInfoObserver.html":{"name":"PolarBleApiDeviceInfoObserver","abstract":"

      Device info observer.

      "},"Protocols/PolarBleApiPowerStateObserver.html":{"name":"PolarBleApiPowerStateObserver","abstract":"

      Bluetooth state observer.

      "},"Protocols/PolarBleApiLogger.html":{"name":"PolarBleApiLogger","abstract":"

      logger observer

      "},"Structs/PolarSensorSetting.html":{"name":"PolarSensorSetting","abstract":"

      polar sensor settings class

      "},"API.html":{"name":"API"},"PolarErrors.html":{"name":"PolarErrors"},"API Default Implementation.html":{"name":"API Default Implementation"},"Other Enums.html":{"name":"Other Enumerations","abstract":"

      The following enumerations are available globally.

      "},"Other Typealiases.html":{"name":"Other Type Aliases","abstract":"

      The following type aliases are available globally.

      "}} \ No newline at end of file