From 0d58c747cb6926cc08bb74073c60d95718908e17 Mon Sep 17 00:00:00 2001 From: Jukka Oikarinen Date: Thu, 23 Mar 2023 09:37:34 +0200 Subject: [PATCH] Polar ble sdk 5.0.0 (#352) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Android SDK source 5.0.0 * Android Example: - creation of local gradle property to enable local SDK build easily - updates android example according to new SDK refactorings - implements minimal offline recording management (Verity Sense device) * Documentation updated for release 5.0.0 * Android source: gradle update * Android source: gradle updates * Android source: experimenting the jump to Java 11 * Android source: temporary step back to Android Gradle plugin 7.3.1 * Android source: latest SDK into use * iOS Source: Offline recording. Basic functionality * Documentation update: little addition to migration guide * iOS example: Added offline recording basic functionality. Also refactored the example to be more user friendly. * iOS source: offline recording basic funtionality * Documentation update * Android source: PolarOhrData is deprecated and replaced with PolarPpgData * Android example: PolarOhrData is deprecated and replaced with PolarPpgData * Android example: Small gradle update * iOS source: Minimum iOS target lifted from 13 to 14 * iOS example: Minor updates * Release 5.0.0-beta1 * PolarBleSdk.podspec updated for release 5.0.0-beta1 * Android and iOS examples now uses the 5.0.0-beta1 * iOS source: PolarOhrData replaced by the PolarPpgData * iOS Example: PolarOhrData replaced by the PolarPpgData * iOS example: fine tuning * Android source: Delete enhanced and also more traces for better issue tracking * iOS source: - Offline recording delete enhanced - Traces for better issue tracking - reverted the BLE State Preservation and Restoration * Release 5.0.0-beta2 * Android example: 5.0.0-beta2 taken into use * PolarBleSdk.podspec update for release 5.0.0-beta2 * iOS example: 5.0.0-beta2 taken into use * iOS Source: offline recording triggers * Android source: updates on API * Release 5.0.0-beta3 * PolarBleSdk.podspec update for release 5.0.0-beta3 * Android example: 5.0.0-beta3 taken into use * iOS example: 5.0.0-beta3 taken into use * iOS Example: Added icon * Android example: Added icon * Documenation: migration guide updated * iOS Source: isFeatureReady() functionality updated * Android source: better handling of full memory situation and other small enhancements * iOS source: better handling of possible empty offline recording, better handling of full memory situation and other small enhancements * Release 5.0.0-beta4 * PolarBleSdk.podspec update for release 5.0.0-beta4 * iOS example: 5.0.0-beta4 taken into use * Android example: 5.0.0-beta4 taken into use * #329: refactored the names of PPI and HR related classes to make Andro… (#345) * 329: refactored the names of PPI and HR related classes to make Android SDK and iOS SDK consistent * 329: Update example of iOS and Android to match with refactored class names * 329: migration guide updated * Added information that offline recording read is not possible in SDK mode * Offline recording documentation: memory management added * SDK mode documentation: fixed the description related to SDK mode state change * Know issues documenation update * Revert the change of where rrsMs was replaced with rrs in HrData. Removed the rrs and brought back the rrsMs * Gradle updates on Android example and demo apps * Added search view to help with the devices search * Streams data can be shared * Android source: minor enhancements and code cleanup in core communications * iOS source: minor enhancements and code cleanup in core communications * Release 5.0.0 --------- Co-authored-by: Michael Lutz --- PolarBleSdk.podspec | 2 +- README.md | 164 +- .../PolarSDK-ECG-HR-Demo/app/build.gradle | 8 +- .../polar/polarsdkecghrdemo/ECGActivity.kt | 87 +- .../com/polar/polarsdkecghrdemo/HRActivity.kt | 84 +- .../polar/polarsdkecghrdemo/HrAndRrPlotter.kt | 4 +- .../polar/polarsdkecghrdemo/MainActivity.kt | 14 +- .../PolarSDK-ECG-HR-Demo/build.gradle | 4 +- .../KnownIssues.md | 1 + documentation/MigrationGuide5.0.0.md | 54 + documentation/OfflineRecordingExplained.md | 58 + documentation/SdkModeExplained.md | 30 + .../TimeSystemExplained.md | 0 .../androidBleSdkTestApp/app/build.gradle | 17 +- .../app/src/main/AndroidManifest.xml | 8 +- .../com/polar/androidblesdk/MainActivity.kt | 276 +- .../drawable-v24/ic_launcher_foreground.xml | 34 - .../res/drawable/ic_launcher_background.xml | 170 - .../app/src/main/res/layout/activity_main.xml | 45 + .../res/mipmap-anydpi-v26/ic_launcher.xml | 4 +- .../mipmap-anydpi-v26/ic_launcher_round.xml | 4 +- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3056 -> 0 bytes .../mipmap-hdpi/ic_launcher_background.png | Bin 0 -> 513 bytes .../mipmap-hdpi/ic_launcher_foreground.png | Bin 0 -> 6311 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 5024 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2096 -> 0 bytes .../mipmap-mdpi/ic_launcher_background.png | Bin 0 -> 331 bytes .../mipmap-mdpi/ic_launcher_foreground.png | Bin 0 -> 5229 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 2858 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4569 -> 0 bytes .../mipmap-xhdpi/ic_launcher_background.png | Bin 0 -> 681 bytes .../mipmap-xhdpi/ic_launcher_foreground.png | Bin 0 -> 7277 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 7098 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 6464 -> 0 bytes .../mipmap-xxhdpi/ic_launcher_background.png | Bin 0 -> 1020 bytes .../mipmap-xxhdpi/ic_launcher_foreground.png | Bin 0 -> 9282 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 10676 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 9250 -> 0 bytes .../mipmap-xxxhdpi/ic_launcher_background.png | Bin 0 -> 1707 bytes .../mipmap-xxxhdpi/ic_launcher_foreground.png | Bin 0 -> 11397 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 15523 -> 0 bytes .../app/src/main/res/values/strings.xml | 7 + .../androidBleSdkTestApp/build.gradle | 4 +- .../androidBleSdkTestApp/gradle.properties | 2 +- .../androidBleSdkTestApp/settings.gradle | 2 +- examples/example-ios/iosBleSdkTestApp/Podfile | 4 +- .../example-ios/iosBleSdkTestApp/Podfile.lock | 12 +- .../iosBleSdkTestApp/Pods/Manifest.lock | 12 +- .../Pods/Pods.xcodeproj/project.pbxproj | 3124 +++++++++-------- .../Pods/PolarBleSdk/README.md | 164 +- .../PolarBleSdk/sdk/api/PolarBleApi.swift | 290 +- .../sdk/api/PolarBleApiDefaultImpl.swift | 4 +- .../sdk/api/PolarBleApiObservers.swift | 24 +- .../sdk/api/PolarH10OfflineExerciseApi.swift | 89 + .../sdk/api/PolarOfflineRecordingApi.swift | 145 + .../sdk/api/PolarOnlineStreamingApi.swift | 122 + .../PolarBleSdk/sdk/api/PolarSdkModeApi.swift | 43 + .../sdk/api/errors/PolarErrors.swift | 8 +- .../api/model/PolarOfflineRecordingData.swift | 12 + .../model/PolarOfflineRecordingEntry.swift | 22 + .../PolarOfflineRecordingTriggerMode.swift | 31 + .../sdk/api/model/PolarRecordingSecret.swift | 18 + .../sdk/api/model/PolarSensorSetting.swift | 15 +- .../sdk/impl/PolarBleApiImpl.swift | 976 ++++- .../sdk/impl/utils/PolarDataUtils.swift | 132 + .../model => impl}/utils/PolarTimeUtils.swift | 0 .../Sources/iOSCommunications/TypeUtils.swift | 19 +- .../ble/api/model/BleDeviceSession.swift | 30 +- .../api/model/gatt/BleGattClientFactory.swift | 4 +- .../api/model/gatt/client/BleHrClient.swift | 2 +- .../model/gatt/client/pmd/BlePmdClient.swift | 289 +- .../client/pmd/PmdActiveMeasurement.swift | 28 + .../client/pmd/PmdControlPointCommand.swift | 15 + .../gatt/client/pmd/PmdMeasurementType.swift | 21 +- .../gatt/client/pmd/PmdOfflineTrigger.swift | 77 + .../gatt/client/pmd/PmdRecordingType.swift | 12 + .../model/gatt/client/pmd/PmdSdkMode.swift | 17 + .../api/model/gatt/client/pmd/PmdSecret.swift | 126 + .../model/gatt/client/pmd/PmdSetting.swift | 1 + .../model/gatt/client/pmd/model/AccData.swift | 18 +- .../model/gatt/client/pmd/model/EcgData.swift | 9 +- .../model/gatt/client/pmd/model/GyrData.swift | 9 +- .../model/gatt/client/pmd/model/MagData.swift | 9 +- .../gatt/client/pmd/model/OfflineHrData.swift | 37 + .../model/gatt/client/pmd/model/PpgData.swift | 11 +- .../model/gatt/client/pmd/model/PpiData.swift | 10 +- .../gatt/exceptions/BleGattException.swift | 1 + .../OfflineRecordingData.swift | 326 ++ .../OfflineRecordingError.swift | 14 + .../OfflineRecordingUtils.swift | 17 + .../central/CBDeviceListenerImpl.swift | 28 +- .../central/CBDeviceSessionImpl.swift | 105 +- .../SwiftProtobuf/BinaryDelimited.swift | 12 +- .../Google_Protobuf_Value+Extensions.swift | 6 +- .../Sources/SwiftProtobuf/JSONDecoder.swift | 28 +- .../SwiftProtobuf/JSONDecodingOptions.swift | 4 +- .../SwiftProtobuf/JSONEncodingError.swift | 3 + .../Sources/SwiftProtobuf/JSONScanner.swift | 15 +- .../Sources/SwiftProtobuf/Version.swift | 4 +- .../Sources/SwiftProtobuf/any.pb.swift | 5 +- .../Sources/SwiftProtobuf/descriptor.pb.swift | 186 +- .../Sources/SwiftProtobuf/timestamp.pb.swift | 2 - .../Sources/SwiftProtobuf/wrappers.pb.swift | 2 +- .../PolarBleSdk/PolarBleSdk-Info.plist | 2 +- .../SwiftProtobuf/SwiftProtobuf-Info.plist | 2 +- .../project.pbxproj | 168 +- .../AppIcon.appiconset/Contents.json | 13 + .../sdkbleicon1024x1024.png | Bin 0 -> 36649 bytes .../sdkbleicon120x120 1.png | Bin 0 -> 6552 bytes .../AppIcon.appiconset/sdkbleicon120x120.png | Bin 0 -> 6552 bytes .../AppIcon.appiconset/sdkbleicon152x152.png | Bin 0 -> 7469 bytes .../AppIcon.appiconset/sdkbleicon167x167.png | Bin 0 -> 7876 bytes .../AppIcon.appiconset/sdkbleicon192x192.png | Bin 0 -> 8670 bytes .../AppIcon.appiconset/sdkbleicon58x58 1.png | Bin 0 -> 4998 bytes .../AppIcon.appiconset/sdkbleicon58x58.png | Bin 0 -> 4998 bytes .../AppIcon.appiconset/sdkbleicon76x76.png | Bin 0 -> 5457 bytes .../AppIcon.appiconset/sdkbleicon80x80 1.png | Bin 0 -> 5557 bytes .../AppIcon.appiconset/sdkbleicon80x80 2.png | Bin 0 -> 5557 bytes .../AppIcon.appiconset/sdkbleicon80x80.png | Bin 0 -> 5557 bytes .../AppIcon.appiconset/sdkbleicon87x87.png | Bin 0 -> 5725 bytes .../iosBleSdkTestApp/Info.plist | 2 + .../Models/BatteryStatusFeature.swift | 26 + .../Models/DeviceConnectionState.swift | 9 + .../Models/DeviceInfoFeature.swift | 8 + .../Models/DeviceSearch.swift | 31 + .../Models/DeviceTimeSetupFeature.swift | 8 + .../Models/H10ExerciseRecordingFeature.swift | 9 + .../Models/OfflineRecordingData.swift | 27 + .../Models/OfflineRecordingEntries.swift | 10 + .../Models/OfflineRecordingFeature.swift | 10 + .../Models/OnlineStreamingFeature.swift | 16 + .../Models/RecordingSettings.swift | 18 + .../Models/SdkModeFeature.swift | 8 + .../Models/StreamSettings.swift | 18 - .../iosBleSdkTestApp/PolarBleSdkManager.swift | 1137 ++++-- .../iosBleSdkTestApp/Views/ContentView.swift | 287 +- .../Views/DeviceSearch/DeviceSearchRow.swift | 51 + .../Views/DeviceSearch/DeviceSearchView.swift | 101 + .../DeviceSettings/DeviceSettingsView.swift | 142 + .../Views/H10Exercise/H10ExerciseView.swift | 110 + .../OfflineRecordingDetailsView.swift | 190 + .../OfflineRecordingEntriesRow.swift | 101 + .../OfflineRecordingListView.swift | 62 + .../OfflineRecordingStartView.swift | 110 + .../OfflineRecordingView.swift | 76 + .../OnlineStreaming/OnlineStreamsView.swift | 177 + ...mSettingsView.swift => SettingsView.swift} | 58 +- .../iosBleSdkTestApp/Views/UiHelper.swift | 23 +- .../iosBleSdkTestApp/iosBleSdkTestApp.swift | 4 +- .../iosBleSdkTestAppTests.swift | 7 - .../iosBleSdkTestAppUITests.swift | 7 - polar-sdk-android/docs/allclasses.html | 26 +- .../api/PolarBleApi.PolarBleSdkFeature.html | 461 +++ ...l => PolarBleApi.PolarDeviceDataType.html} | 36 +- .../docs/com/polar/sdk/api/PolarBleApi.html | 858 +---- .../polar/sdk/api/PolarBleApiCallback.html | 84 +- .../sdk/api/PolarBleApiCallbackProvider.html | 84 +- .../polar/sdk/api/PolarBleApiDefaultImpl.html | 8 +- ...OfflineExerciseApi.RecordingInterval.html} | 24 +- ...olarH10OfflineExerciseApi.SampleType.html} | 18 +- .../sdk/api/PolarH10OfflineExerciseApi.html | 573 +++ .../sdk/api/PolarOfflineRecordingApi.html | 743 ++++ .../sdk/api/PolarOnlineStreamingApi.html | 754 ++++ .../com/polar/sdk/api/PolarSdkModeApi.html | 443 +++ .../errors/PolarOfflineRecordingError.html | 430 +++ .../polar/sdk/api/errors/package-summary.html | 6 +- .../api/model/PolarHrData.PolarHrSample.html | 508 +++ .../com/polar/sdk/api/model/PolarHrData.html | 174 +- ...lineRecordingData.AccOfflineRecording.html | 450 +++ ...ineRecordingData.GyroOfflineRecording.html | 450 +++ ...flineRecordingData.HrOfflineRecording.html | 450 +++ ...lineRecordingData.MagOfflineRecording.html | 450 +++ ...lineRecordingData.PpgOfflineRecording.html | 450 +++ ...lineRecordingData.PpiOfflineRecording.html | 450 +++ .../api/model/PolarOfflineRecordingData.html | 447 +++ .../api/model/PolarOfflineRecordingEntry.html | 387 ++ .../model/PolarOfflineRecordingTrigger.html | 421 +++ .../PolarOfflineRecordingTriggerMode.html | 431 +++ .../com/polar/sdk/api/model/PolarOhrData.html | 2 +- .../polar/sdk/api/model/PolarOhrPPIData.html | 2 +- .../model/PolarPpgData.PolarPpgSample.html | 421 +++ .../api/model/PolarPpgData.PpgDataType.html | 425 +++ .../com/polar/sdk/api/model/PolarPpgData.html | 435 +++ .../PolarPpiData.PolarPpiSample.html} | 172 +- .../model/PolarPpiData.html} | 93 +- .../model/PolarRecordingSecret.html} | 84 +- .../polar/sdk/api/model/package-summary.html | 44 +- .../com/polar/sdk/api/package-summary.html | 44 +- .../docs/com/polar/sdk/impl/BDBleApiImpl.html | 1565 --------- .../com/polar/sdk/impl/package-summary.html | 232 -- polar-sdk-android/docs/deprecated.html | 124 +- polar-sdk-android/docs/element-list | 21 +- .../docs/index-files/index-1.html | 49 +- .../docs/index-files/index-10.html | 42 +- .../docs/index-files/index-11.html | 16 +- .../docs/index-files/index-12.html | 420 ++- .../docs/index-files/index-13.html | 122 +- .../docs/index-files/index-14.html | 264 +- .../docs/index-files/index-15.html | 46 +- .../docs/index-files/index-16.html | 37 +- .../docs/index-files/index-17.html | 245 ++ .../docs/index-files/index-2.html | 75 +- .../docs/index-files/index-3.html | 49 +- .../docs/index-files/index-4.html | 39 +- .../docs/index-files/index-5.html | 20 +- .../docs/index-files/index-6.html | 137 +- .../docs/index-files/index-7.html | 966 ++++- .../docs/index-files/index-8.html | 33 +- .../docs/index-files/index-9.html | 67 +- polar-sdk-android/docs/index.html | 2 - polar-sdk-android/docs/member-search-index.js | 2 +- polar-sdk-android/docs/package-list | 21 +- .../docs/package-search-index.js | 2 +- polar-sdk-android/docs/type-search-index.js | 2 +- polar-sdk-ios/docs/Classes.html | 49 +- .../docs/Classes/PolarBleApiDefaultImpl.html | 49 +- polar-sdk-ios/docs/Enums.html | 122 +- .../docs/Enums/PolarBleSdkFeature.html | 363 ++ .../PolarDeviceDataType.html} | 79 +- polar-sdk-ios/docs/Enums/PolarErrors.html | 91 +- .../docs/Enums/PolarOfflineRecordingData.html | 318 ++ .../PolarOfflineRecordingTriggerMode.html | 265 ++ .../PpgDataType.html} | 61 +- .../docs/Enums/RecordingInterval.html | 49 +- polar-sdk-ios/docs/Enums/SampleType.html | 49 +- polar-sdk-ios/docs/Extensions.html | 49 +- .../docs/Extensions/PrimitiveSequence.html | 49 +- polar-sdk-ios/docs/Protocols.html | 154 +- polar-sdk-ios/docs/Protocols/PolarBleApi.html | 447 +-- .../PolarBleApiDeviceFeaturesObserver.html | 95 +- .../PolarBleApiDeviceHrObserver.html | 228 -- .../PolarBleApiDeviceInfoObserver.html | 49 +- .../docs/Protocols/PolarBleApiLogger.html | 49 +- .../docs/Protocols/PolarBleApiObserver.html | 49 +- .../PolarBleApiPowerStateObserver.html | 49 +- .../PolarBleApiSdkModeFeatureObserver.html | 203 -- .../Protocols/PolarH10OfflineExerciseApi.html | 333 ++ .../Protocols/PolarOfflineRecordingApi.html | 442 +++ .../Protocols/PolarOnlineStreamingApi.html | 414 +++ .../docs/Protocols/PolarSdkModeApi.html | 279 ++ polar-sdk-ios/docs/Structs.html | 116 +- .../PolarOfflineRecordingEntry.html} | 112 +- .../Structs/PolarOfflineRecordingTrigger.html | 269 ++ .../PolarRecordingSecret.html} | 65 +- .../docs/Structs/PolarSensorSetting.html | 73 +- .../PolarSensorSetting/SettingType.html | 49 +- polar-sdk-ios/docs/Typealiases.html | 83 +- .../Contents/Resources/Documents/Classes.html | 49 +- .../Classes/PolarBleApiDefaultImpl.html | 49 +- .../Contents/Resources/Documents/Enums.html | 122 +- .../Documents/Enums/PolarBleSdkFeature.html | 363 ++ .../Documents/Enums/PolarDeviceDataType.html} | 79 +- .../Documents/Enums/PolarErrors.html | 91 +- .../Enums/PolarOfflineRecordingData.html | 318 ++ .../PolarOfflineRecordingTriggerMode.html | 265 ++ .../Documents/Enums/PpgDataType.html} | 61 +- .../Documents/Enums/RecordingInterval.html | 49 +- .../Resources/Documents/Enums/SampleType.html | 49 +- .../Resources/Documents/Extensions.html | 49 +- .../Extensions/PrimitiveSequence.html | 49 +- .../Resources/Documents/Protocols.html | 154 +- .../Documents/Protocols/PolarBleApi.html | 447 +-- .../PolarBleApiDeviceFeaturesObserver.html | 95 +- .../PolarBleApiDeviceHrObserver.html | 228 -- .../PolarBleApiDeviceInfoObserver.html | 49 +- .../Protocols/PolarBleApiLogger.html | 49 +- .../Protocols/PolarBleApiObserver.html | 49 +- .../PolarBleApiPowerStateObserver.html | 49 +- .../PolarBleApiSdkModeFeatureObserver.html | 203 -- .../Protocols/PolarH10OfflineExerciseApi.html | 333 ++ .../Protocols/PolarOfflineRecordingApi.html | 442 +++ .../Protocols/PolarOnlineStreamingApi.html | 414 +++ .../Documents/Protocols/PolarSdkModeApi.html | 279 ++ .../Contents/Resources/Documents/Structs.html | 116 +- .../PolarOfflineRecordingEntry.html} | 112 +- .../Structs/PolarOfflineRecordingTrigger.html | 269 ++ .../PolarRecordingSecret.html} | 65 +- .../Documents/Structs/PolarSensorSetting.html | 73 +- .../PolarSensorSetting/SettingType.html | 49 +- .../Resources/Documents/Typealiases.html | 83 +- .../Contents/Resources/Documents/index.html | 49 +- .../Contents/Resources/Documents/search.json | 2 +- .../.docset/Contents/Resources/docSet.dsidx | Bin 36864 -> 49152 bytes polar-sdk-ios/docs/docsets/.tgz | Bin 102588 -> 99615 bytes polar-sdk-ios/docs/index.html | 49 +- polar-sdk-ios/docs/search.json | 2 +- polar-sdk-ios/docs/undocumented.json | 2 +- .../android-communications/build.gradle | 2 +- .../android-communications/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../library/build.gradle | 18 +- .../exceptions/BleControlPointCommandError.kt | 3 +- .../BleControlPointResponseError.kt | 8 + .../api/ble/exceptions/SecurityError.kt | 5 + .../ble/model/gatt/client/BleDisClient.java | 2 +- .../ble/model/gatt/client/BleHrClient.java | 138 - .../api/ble/model/gatt/client/BleHrClient.kt | 134 + .../ble/model/gatt/client/pmd/BlePMDClient.kt | 154 +- .../gatt/client/pmd/PmdActiveMeasurement.kt | 24 + .../gatt/client/pmd/PmdControlPointCommand.kt | 7 +- .../client/pmd/PmdControlPointResponse.kt | 3 +- .../gatt/client/pmd/PmdMeasurementType.kt | 24 +- .../gatt/client/pmd/PmdOfflineTrigger.kt | 75 + .../model/gatt/client/pmd/PmdRecordingType.kt | 23 + .../ble/model/gatt/client/pmd/PmdSdkMode.kt | 16 + .../ble/model/gatt/client/pmd/PmdSecret.kt | 93 + .../ble/model/gatt/client/pmd/PmdSetting.kt | 6 +- .../model/gatt/client/pmd/model/GyrData.kt | 1 + .../model/gatt/client/pmd/model/MagData.kt | 6 +- .../gatt/client/pmd/model/OfflineHrData.kt | 39 + .../client/pmd/model/PmdDataModelUtils.kt | 34 + .../model/gatt/client/pmd/model/PpgData.kt | 2 +- .../gatt/client/psftp/BlePsFtpClient.java | 4 +- .../offlinerecording/OfflineRecordingData.kt | 345 ++ .../offlinerecording/OfflineRecordingError.kt | 12 + .../OfflineRecordingUtility.kt | 19 + .../common/ble/AtomicSet.java | 3 + .../common/ble/TypeUtils.kt | 4 + .../ble/bluedroid/host/BDDeviceList.java | 11 +- .../bluedroid/host/BDDeviceListenerImpl.java | 2 + .../bluedroid/host/BDDeviceSessionImpl.java | 7 +- .../ble/bluedroid/host/GattCallback.kt | 19 +- .../host/connection/ConnectionHandler.kt | 9 +- .../sdk/java/com/polar/sdk/api/PolarBleApi.kt | 401 +-- .../com/polar/sdk/api/PolarBleApiCallback.kt | 48 +- .../sdk/api/PolarBleApiCallbackProvider.kt | 38 +- .../polar/sdk/api/PolarBleApiDefaultImpl.kt | 4 +- .../sdk/api/PolarH10OfflineExerciseApi.kt | 99 + .../polar/sdk/api/PolarOfflineRecordingApi.kt | 186 + .../polar/sdk/api/PolarOnlineStreamingApi.kt | 192 + .../java/com/polar/sdk/api/PolarSdkModeApi.kt | 53 + .../api/errors/PolarOfflineRecordingError.kt | 7 + .../sdk/api/model/PolarAccelerometerData.kt | 2 +- .../polar/sdk/api/model/PolarDeviceInfo.kt | 2 +- .../com/polar/sdk/api/model/PolarEcgData.kt | 2 +- .../com/polar/sdk/api/model/PolarGyroData.kt | 2 +- .../sdk/api/model/PolarHrBroadcastData.kt | 2 +- .../com/polar/sdk/api/model/PolarHrData.kt | 41 +- .../sdk/api/model/PolarMagnetometerData.kt | 4 +- .../api/model/PolarOfflineRecordingData.kt | 63 + .../api/model/PolarOfflineRecordingEntry.kt | 31 + .../model/PolarOfflineRecordingTriggerMode.kt | 29 + .../com/polar/sdk/api/model/PolarOhrData.kt | 5 +- .../polar/sdk/api/model/PolarOhrPPIData.kt | 3 +- .../com/polar/sdk/api/model/PolarPpgData.kt | 32 + .../com/polar/sdk/api/model/PolarPpiData.kt | 31 + .../sdk/api/model/PolarRecordingSecret.kt | 21 + .../sdk/api/model/utils/PolarDataUtils.kt | 166 - .../java/com/polar/sdk/impl/BDBleApiImpl.kt | 1153 ++++-- .../polar/sdk/impl/utils/PolarDataUtils.kt | 270 ++ .../model => impl}/utils/PolarTimeUtils.kt | 2 +- .../BleAdvertisementContentTest.kt | 2 +- .../ble/model/gatt/client/BleHrClientTest.kt | 69 +- .../model/gatt/client/pmd/BlePmdClientTest.kt | 8 +- .../client/pmd/PmdActiveMeasurementTest.kt | 64 + .../gatt/client/pmd/PmdOfflineTriggerTest.kt | 130 + .../model/gatt/client/pmd/PmdSecretTest.kt | 172 + .../gatt/client/pmd/model/AccDataTest.kt | 28 +- .../client/pmd/model/GnssLocationDataTest.kt | 1 + .../client/pmd/model/OfflineHrDataTest.kt | 58 + .../gatt/client/pmd/model/PpiDataTest.kt | 15 +- .../OfflineRecordingDataTest.kt | 1736 +++++++++ .../common/ble/TypeUtilsTest.kt | 46 +- .../ble/bluedroid/host/BDDeviceListTest.kt | 105 + .../host/connection/ConnectionHandlerTest.kt | 17 +- .../sdk/api/model/utils/PolarTimeUtilsTest.kt | 1 + sources/iOS/ios-communications/Podfile | 2 +- sources/iOS/ios-communications/Podfile.lock | 6 +- .../PolarBleSdk/sdk/api/PolarBleApi.swift | 290 +- .../sdk/api/PolarBleApiDefaultImpl.swift | 4 +- .../sdk/api/PolarBleApiObservers.swift | 26 +- .../sdk/api/PolarH10OfflineExerciseApi.swift | 89 + .../sdk/api/PolarOfflineRecordingApi.swift | 145 + .../sdk/api/PolarOnlineStreamingApi.swift | 125 + .../PolarBleSdk/sdk/api/PolarSdkModeApi.swift | 43 + .../sdk/api/errors/PolarErrors.swift | 8 +- .../api/model/PolarOfflineRecordingData.swift | 12 + .../model/PolarOfflineRecordingEntry.swift | 22 + .../PolarOfflineRecordingTriggerMode.swift | 31 + .../sdk/api/model/PolarRecordingSecret.swift | 18 + .../sdk/api/model/PolarSensorSetting.swift | 15 +- .../sdk/impl/PolarBleApiImpl.swift | 984 +++++- .../sdk/impl/utils/PolarDataUtils.swift | 132 + .../model => impl}/utils/PolarTimeUtils.swift | 0 .../Sources/iOSCommunications/TypeUtils.swift | 19 +- .../ble/api/BleDeviceListener.swift | 2 +- .../ble/api/model/BleDeviceSession.swift | 30 +- .../api/model/gatt/BleGattClientFactory.swift | 4 +- .../api/model/gatt/client/BleHrClient.swift | 33 +- .../model/gatt/client/pmd/BlePmdClient.swift | 289 +- .../client/pmd/PmdActiveMeasurement.swift | 28 + .../client/pmd/PmdControlPointCommand.swift | 15 + .../gatt/client/pmd/PmdMeasurementType.swift | 21 +- .../gatt/client/pmd/PmdOfflineTrigger.swift | 77 + .../gatt/client/pmd/PmdRecordingType.swift | 12 + .../model/gatt/client/pmd/PmdSdkMode.swift | 17 + .../api/model/gatt/client/pmd/PmdSecret.swift | 126 + .../model/gatt/client/pmd/PmdSetting.swift | 1 + .../model/gatt/client/pmd/model/AccData.swift | 18 +- .../model/gatt/client/pmd/model/EcgData.swift | 9 +- .../model/gatt/client/pmd/model/GyrData.swift | 9 +- .../model/gatt/client/pmd/model/MagData.swift | 49 +- .../gatt/client/pmd/model/OfflineHrData.swift | 37 + .../model/gatt/client/pmd/model/PpgData.swift | 11 +- .../model/gatt/client/pmd/model/PpiData.swift | 10 +- .../gatt/exceptions/BleGattException.swift | 1 + .../OfflineRecordingData.swift | 326 ++ .../OfflineRecordingError.swift | 14 + .../OfflineRecordingUtils.swift | 17 + .../central/CBDeviceListenerImpl.swift | 28 +- .../central/CBDeviceSessionImpl.swift | 105 +- .../BleHrClientTest.swift | 62 +- .../iOSCommunicationsTests/MagDataTest.swift | 146 +- .../OfflineHrDataTest.swift | 51 + .../OfflineRecordingDataTest.swift | 1733 +++++++++ .../PmdOfflineTriggerTest.swift | 126 + .../PmdSecretTest.swift | 167 + .../PmdTimeStampUtilsTest.swift | 12 +- .../project.pbxproj | 203 +- .../Polar_Measurement_Data_Specification.pdf | Bin 691398 -> 0 bytes technical_documentation/SdkModeExplained.md | 26 - 421 files changed, 38757 insertions(+), 10828 deletions(-) rename {technical_documentation => documentation}/KnownIssues.md (98%) create mode 100644 documentation/MigrationGuide5.0.0.md create mode 100644 documentation/OfflineRecordingExplained.md create mode 100644 documentation/SdkModeExplained.md rename {technical_documentation => documentation}/TimeSystemExplained.md (100%) delete mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/drawable-v24/ic_launcher_foreground.xml delete mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/drawable/ic_launcher_background.xml delete mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-hdpi/ic_launcher_background.png create mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png delete mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-hdpi/ic_launcher_round.png delete mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-mdpi/ic_launcher_background.png create mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png delete mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-mdpi/ic_launcher_round.png delete mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png create mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png delete mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png delete mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png create mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png delete mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png delete mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png create mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png delete mode 100644 examples/example-android/androidBleSdkTestApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/PolarH10OfflineExerciseApi.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/PolarOfflineRecordingApi.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/PolarOnlineStreamingApi.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/PolarSdkModeApi.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/PolarOfflineRecordingData.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/PolarOfflineRecordingEntry.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/PolarOfflineRecordingTriggerMode.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/PolarRecordingSecret.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/impl/utils/PolarDataUtils.swift rename examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/{api/model => impl}/utils/PolarTimeUtils.swift (100%) create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/PmdActiveMeasurement.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/PmdControlPointCommand.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/PmdOfflineTrigger.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/PmdRecordingType.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/PmdSdkMode.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/PmdSecret.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/model/OfflineHrData.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/offlinerecording/OfflineRecordingData.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/offlinerecording/OfflineRecordingError.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/offlinerecording/OfflineRecordingUtils.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon1024x1024.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon120x120 1.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon120x120.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon152x152.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon167x167.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon192x192.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon58x58 1.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon58x58.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon76x76.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon80x80 1.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon80x80 2.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon80x80.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Assets.xcassets/AppIcon.appiconset/sdkbleicon87x87.png create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/BatteryStatusFeature.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/DeviceConnectionState.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/DeviceInfoFeature.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/DeviceSearch.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/DeviceTimeSetupFeature.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/H10ExerciseRecordingFeature.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/OfflineRecordingData.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/OfflineRecordingEntries.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/OfflineRecordingFeature.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/OnlineStreamingFeature.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/RecordingSettings.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/SdkModeFeature.swift delete mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/StreamSettings.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Views/DeviceSearch/DeviceSearchRow.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Views/DeviceSearch/DeviceSearchView.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Views/DeviceSettings/DeviceSettingsView.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Views/H10Exercise/H10ExerciseView.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Views/OfflineRecording/OfflineRecordingDetailsView.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Views/OfflineRecording/OfflineRecordingEntriesRow.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Views/OfflineRecording/OfflineRecordingListView.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Views/OfflineRecording/OfflineRecordingStartView.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Views/OfflineRecording/OfflineRecordingView.swift create mode 100644 examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Views/OnlineStreaming/OnlineStreamsView.swift rename examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Views/{StreamSettingsView.swift => SettingsView.swift} (63%) create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.PolarBleSdkFeature.html rename polar-sdk-android/docs/com/polar/sdk/api/{PolarBleApi.DeviceStreamingFeature.html => PolarBleApi.PolarDeviceDataType.html} (91%) rename polar-sdk-android/docs/com/polar/sdk/api/{PolarBleApi.RecordingInterval.html => PolarH10OfflineExerciseApi.RecordingInterval.html} (93%) rename polar-sdk-android/docs/com/polar/sdk/api/{PolarBleApi.SampleType.html => PolarH10OfflineExerciseApi.SampleType.html} (95%) create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/PolarH10OfflineExerciseApi.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/PolarOfflineRecordingApi.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/PolarOnlineStreamingApi.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/PolarSdkModeApi.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/errors/PolarOfflineRecordingError.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarHrData.PolarHrSample.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.AccOfflineRecording.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.GyroOfflineRecording.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.HrOfflineRecording.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.MagOfflineRecording.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.PpgOfflineRecording.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.PpiOfflineRecording.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingEntry.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingTrigger.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingTriggerMode.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpgData.PolarPpgSample.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpgData.PpgDataType.html create mode 100644 polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpgData.html rename polar-sdk-android/docs/com/polar/sdk/api/{PolarBleApi.Companion.html => model/PolarPpiData.PolarPpiSample.html} (74%) rename polar-sdk-android/docs/com/polar/sdk/{impl/BDBleApiImpl.FetchRecursiveCondition.html => api/model/PolarPpiData.html} (72%) rename polar-sdk-android/docs/com/polar/sdk/{impl/BDBleApiImpl.Companion.html => api/model/PolarRecordingSecret.html} (77%) delete mode 100644 polar-sdk-android/docs/com/polar/sdk/impl/BDBleApiImpl.html delete mode 100644 polar-sdk-android/docs/com/polar/sdk/impl/package-summary.html create mode 100644 polar-sdk-android/docs/index-files/index-17.html create mode 100644 polar-sdk-ios/docs/Enums/PolarBleSdkFeature.html rename polar-sdk-ios/docs/{docsets/.docset/Contents/Resources/Documents/Enums/DeviceStreamingFeature.html => Enums/PolarDeviceDataType.html} (77%) create mode 100644 polar-sdk-ios/docs/Enums/PolarOfflineRecordingData.html create mode 100644 polar-sdk-ios/docs/Enums/PolarOfflineRecordingTriggerMode.html rename polar-sdk-ios/docs/{docsets/.docset/Contents/Resources/Documents/Enums/OhrDataType.html => Enums/PpgDataType.html} (78%) delete mode 100644 polar-sdk-ios/docs/Protocols/PolarBleApiDeviceHrObserver.html delete mode 100644 polar-sdk-ios/docs/Protocols/PolarBleApiSdkModeFeatureObserver.html create mode 100644 polar-sdk-ios/docs/Protocols/PolarH10OfflineExerciseApi.html create mode 100644 polar-sdk-ios/docs/Protocols/PolarOfflineRecordingApi.html create mode 100644 polar-sdk-ios/docs/Protocols/PolarOnlineStreamingApi.html create mode 100644 polar-sdk-ios/docs/Protocols/PolarSdkModeApi.html rename polar-sdk-ios/docs/{Enums/Features.html => Structs/PolarOfflineRecordingEntry.html} (73%) create mode 100644 polar-sdk-ios/docs/Structs/PolarOfflineRecordingTrigger.html rename polar-sdk-ios/docs/{Protocols/PolarBleApiCCCWriteObserver.html => Structs/PolarRecordingSecret.html} (74%) create mode 100644 polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Enums/PolarBleSdkFeature.html rename polar-sdk-ios/docs/{Enums/DeviceStreamingFeature.html => docsets/.docset/Contents/Resources/Documents/Enums/PolarDeviceDataType.html} (77%) create mode 100644 polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Enums/PolarOfflineRecordingData.html create mode 100644 polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Enums/PolarOfflineRecordingTriggerMode.html rename polar-sdk-ios/docs/{Enums/OhrDataType.html => docsets/.docset/Contents/Resources/Documents/Enums/PpgDataType.html} (78%) delete mode 100644 polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Protocols/PolarBleApiDeviceHrObserver.html delete mode 100644 polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Protocols/PolarBleApiSdkModeFeatureObserver.html create mode 100644 polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Protocols/PolarH10OfflineExerciseApi.html create mode 100644 polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Protocols/PolarOfflineRecordingApi.html create mode 100644 polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Protocols/PolarOnlineStreamingApi.html create mode 100644 polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Protocols/PolarSdkModeApi.html rename polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/{Enums/Features.html => Structs/PolarOfflineRecordingEntry.html} (73%) create mode 100644 polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/Structs/PolarOfflineRecordingTrigger.html rename polar-sdk-ios/docs/docsets/.docset/Contents/Resources/Documents/{Protocols/PolarBleApiCCCWriteObserver.html => Structs/PolarRecordingSecret.html} (74%) create mode 100644 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/exceptions/BleControlPointResponseError.kt create mode 100644 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/exceptions/SecurityError.kt delete mode 100755 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/gatt/client/BleHrClient.java create mode 100755 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/gatt/client/BleHrClient.kt create mode 100644 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/gatt/client/pmd/PmdActiveMeasurement.kt create mode 100644 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/gatt/client/pmd/PmdOfflineTrigger.kt create mode 100644 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/gatt/client/pmd/PmdRecordingType.kt create mode 100644 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/gatt/client/pmd/PmdSdkMode.kt create mode 100644 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/gatt/client/pmd/PmdSecret.kt create mode 100644 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/gatt/client/pmd/model/OfflineHrData.kt create mode 100644 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/gatt/client/pmd/model/PmdDataModelUtils.kt create mode 100644 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/offlinerecording/OfflineRecordingData.kt create mode 100644 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/offlinerecording/OfflineRecordingError.kt create mode 100644 sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/offlinerecording/OfflineRecordingUtility.kt create mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/api/PolarH10OfflineExerciseApi.kt create mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/api/PolarOfflineRecordingApi.kt create mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/api/PolarOnlineStreamingApi.kt create mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/api/PolarSdkModeApi.kt create mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/api/errors/PolarOfflineRecordingError.kt create mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/api/model/PolarOfflineRecordingData.kt create mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/api/model/PolarOfflineRecordingEntry.kt create mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/api/model/PolarOfflineRecordingTriggerMode.kt create mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/api/model/PolarPpgData.kt create mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/api/model/PolarPpiData.kt create mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/api/model/PolarRecordingSecret.kt delete mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/api/model/utils/PolarDataUtils.kt create mode 100644 sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/impl/utils/PolarDataUtils.kt rename sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/{api/model => impl}/utils/PolarTimeUtils.kt (98%) create mode 100644 sources/Android/android-communications/library/src/test/java/com/polar/androidcommunications/api/ble/model/gatt/client/pmd/PmdActiveMeasurementTest.kt create mode 100644 sources/Android/android-communications/library/src/test/java/com/polar/androidcommunications/api/ble/model/gatt/client/pmd/PmdOfflineTriggerTest.kt create mode 100644 sources/Android/android-communications/library/src/test/java/com/polar/androidcommunications/api/ble/model/gatt/client/pmd/PmdSecretTest.kt create mode 100644 sources/Android/android-communications/library/src/test/java/com/polar/androidcommunications/api/ble/model/gatt/client/pmd/model/OfflineHrDataTest.kt create mode 100644 sources/Android/android-communications/library/src/test/java/com/polar/androidcommunications/api/ble/model/offlinerecording/OfflineRecordingDataTest.kt create mode 100644 sources/Android/android-communications/library/src/test/java/com/polar/androidcommunications/enpoints/ble/bluedroid/host/BDDeviceListTest.kt create mode 100644 sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/PolarH10OfflineExerciseApi.swift create mode 100644 sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/PolarOfflineRecordingApi.swift create mode 100644 sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/PolarOnlineStreamingApi.swift create mode 100644 sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/PolarSdkModeApi.swift create mode 100644 sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/PolarOfflineRecordingData.swift create mode 100644 sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/PolarOfflineRecordingEntry.swift create mode 100644 sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/PolarOfflineRecordingTriggerMode.swift create mode 100644 sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/PolarRecordingSecret.swift create mode 100644 sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/impl/utils/PolarDataUtils.swift rename sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/{api/model => impl}/utils/PolarTimeUtils.swift (100%) create mode 100644 sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/PmdActiveMeasurement.swift create mode 100644 sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/PmdControlPointCommand.swift create mode 100644 sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/PmdOfflineTrigger.swift create mode 100644 sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/PmdRecordingType.swift create mode 100644 sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/PmdSdkMode.swift create mode 100644 sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/PmdSecret.swift create mode 100644 sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/pmd/model/OfflineHrData.swift create mode 100644 sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/offlinerecording/OfflineRecordingData.swift create mode 100644 sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/offlinerecording/OfflineRecordingError.swift create mode 100644 sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/offlinerecording/OfflineRecordingUtils.swift create mode 100644 sources/iOS/ios-communications/Tests/iOSCommunicationsTests/OfflineHrDataTest.swift create mode 100644 sources/iOS/ios-communications/Tests/iOSCommunicationsTests/OfflineRecordingDataTest.swift create mode 100644 sources/iOS/ios-communications/Tests/iOSCommunicationsTests/PmdOfflineTriggerTest.swift create mode 100644 sources/iOS/ios-communications/Tests/iOSCommunicationsTests/PmdSecretTest.swift delete mode 100644 technical_documentation/Polar_Measurement_Data_Specification.pdf delete mode 100644 technical_documentation/SdkModeExplained.md diff --git a/PolarBleSdk.podspec b/PolarBleSdk.podspec index ae78deab..cbc49540 100644 --- a/PolarBleSdk.podspec +++ b/PolarBleSdk.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'PolarBleSdk' - s.version = '4.0.0' + s.version = '5.0.0-beta4' s.summary = 'SDK for Polar sensors' s.homepage = 'https://github.com/polarofficial/polar-ble-sdk' s.license = { :type => 'Custom', :file => 'Polar_SDK_License.txt' } diff --git a/README.md b/README.md index 70c6e163..8e3d3f86 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,28 @@ # SDK for Polar sensors -This is the official repository of Polar's software development kit. With this SDK you are able to develop your own applications for sensors made by Polar. +This is the official repository of Polar's software development kit. With this SDK you are able to develop your own Android and iOS applications for sensors made by Polar. -This SDK uses ReactiveX. You can read more about ReactiveX from their website [reactivex](http://reactivex.io) +The SDK API uses ReactiveX. You can read more about ReactiveX from their website [reactivex](http://reactivex.io) -3rd party software license listing [ThirdPartySoftwareListing](ThirdPartySoftwareListing.txt) - -By exploiting the SDK, you indicate your acceptance of [License](Polar_SDK_License.txt). - -If you wish to collaborate with Polar commercially, [click here](https://www.polar.com/en/developers) - -### Quick License Summary / Your rights to use the SDK -You may use, copy and modify the SDK as long as you -include the original copyright and license notice in any copy of the -software/source and you comply with the license terms. You are -allowed to use the SDK for the development of software for your -private as well as for commercial use for as long as you use the SDK -in compliance with the license terms. +- [Features](#features) +- [Project structure](#project-structure) +- [Android getting started](#android-getting-started) +- [iOS getting started](#ios-getting-started) +- [Migration Guides](#migration-guides) +- [Collaboration](#collaboration) +- [License](#license) +- [Third-party code and licenses](#third-party-code-and-licenses) +## Features ### H10 Heart rate sensor Most accurate Heart rate sensor in the markets. The H10 is used in the Getting started section of this page. [Store page](https://www.polar.com/en/sensors/h10-heart-rate-sensor) -#### H10 heart rate sensor available data types -* From version 3.0.35 onwards. -* Heart rate as beats per minute. RR Interval in ms and 1/1024 format. +#### H10 features available by the SDK +* Heart rate as beats per minute and RR Interval in ms. * Heart rate broadcast. -* Electrocardiography (ECG) data in µV with sample rate 130Hz. Default epoch for timestamp is 1.1.2000 -* Accelerometer data with sample rates of 25Hz, 50Hz, 100Hz and 200Hz and range of 2G, 4G and 8G. Axis specific acceleration data in mG. Default epoch for timestamp is 1.1.2000 +* Electrocardiography (ECG) data in µV with sample rate 130Hz. +* Accelerometer data with sample rates of 25Hz, 50Hz, 100Hz and 200Hz and range of 2G, 4G and 8G. Axis specific acceleration data in mG. * Start and stop of internal recording and request for internal recording status. Recording supports RR, HR with one second sampletime or HR with five second sampletime. * List, read and remove for stored internal recording (sensor supports only one recording at the time). @@ -35,15 +30,15 @@ Most accurate Heart rate sensor in the markets. The H10 is used in the Getting s Reliable high quality heart rate chest strap. [Store page](https://www.polar.com/en/sensors/h9-heart-rate-sensor) -#### H9 heart rate sensor available data types -* Heart rate as beats per minute. RR Interval in ms and 1/1024 format. +#### H9 features available by the SDK +* Heart rate as beats per minute and RR Interval in ms. * Heart rate broadcast. ### Polar Verity Sense Optical heart rate sensor Optical heart rate sensor is a rechargeable device that measures user’s heart rate with LED technology. [Store page](https://www.polar.com/en/products/accessories/polar-verity-sense) -#### Polar Verity Sense Optical heart rate sensor available data types +#### Polar Verity Sense features available by the SDK * Heart rate as beats per minute. * Heart rate broadcast. * Photoplethysmograpy (PPG) values. @@ -51,32 +46,30 @@ Optical heart rate sensor is a rechargeable device that measures user’s heart * Accelerometer data with sample rate of 52Hz and range of 8G. Axis specific acceleration data in mG. * Gyroscope data with sample rate of 52Hz and ranges of 250dps, 500dps, 1000dps and 2000dps. Axis specific gyroscope data in dps. * Magnetometer data with sample rates of 10Hz, 20Hz, 50HZ and 100Hz and range of +/-50 Gauss. Axis specific magnetometer data in Gauss. -* List, read and remove stored exercise. Recording of exercise requires that sensor is registered to Polar Flow account. Stored sample data contains HR with one second sampletime. -* [SDK mode](technical_documentation/SdkModeExplained.md) (from version 1.1.5 onwards) +* [SDK mode](documentation/SdkModeExplained.md) (from version 1.1.5 onwards) +* [Offline recording](documentation/OfflineRecordingExplained.md) (from version 2.1.0 onwards) ### OH1 Optical heart rate sensor Optical heart rate sensor is a rechargeable device that measures user’s heart rate with LED technology. [Store page](https://www.polar.com/us-en/products/accessories/oh1-optical-heart-rate-sensor) -#### OH1 Optical heart rate sensor available data types -* From version 2.0.8 onwards. +#### OH1 features available by the SDK * Heart rate as beats per minute. * Heart rate broadcast. * Photoplethysmograpy (PPG) values. * PP interval (milliseconds) representing cardiac pulse-to-pulse interval extracted from PPG signal. * Accelerometer data with samplerate of 50Hz and range of 8G. Axis specific acceleration data in mG. -* List, read and remove stored exercise. Recording of exercise requires that sensor is registered to Polar Flow account. Stored sample data contains HR with one second sampletime. -### Project structure -* [polar-sdk-ios](polar-sdk-ios/) contains documentation for the iOS SDK source -* [polar-sdk-android](polar-sdk-android/) contains documentation for the Android SDK source +## Project structure +* [polar-sdk-ios](polar-sdk-ios/) contains source documentation for the iOS SDK source +* [polar-sdk-android](polar-sdk-android/) contains source documentation for the Android SDK source * [demos](demos/) contains Android ecg demo application * [examples](examples/) contains both android and ios example app utilizing most of the features from sdk -* [technical_documentation](technical_documentation/) contains documentation related to SDK +* [documentation](documentation/) contains documentation related to SDK -# Android: Getting started -Detailed documentation: [Documentation]((polar-sdk-android/docs/html/) -## Installation +## Android getting started +Detailed documentation: [Documentation](polar-sdk-android/docs/) +### Installation 1. In `build.gradle` make sure the __minSdk__ is set to __24__ or higher. ```gradle @@ -101,12 +94,12 @@ android { } ``` -3. Add the dependency Polar BLE SDK library. Also you will need the dependencies to [RxJava](https://github.com/ReactiveX/RxJava) to use the Polar BLE SDK Library +3. Add the dependency to Polar BLE SDK library. Also you will need the dependencies to [RxJava](https://github.com/ReactiveX/RxJava) to use the Polar BLE SDK Library ```gradle dependencies { implementation 'com.github.polarofficial:polar-ble-sdk:${sdk_version}' - implementation 'io.reactivex.rxjava3:rxjava:3.1.3' - implementation 'io.reactivex.rxjava3:rxandroid:3.0.0' + implementation 'io.reactivex.rxjava3:rxjava:3.1.6' + implementation 'io.reactivex.rxjava3:rxandroid:3.0.2' } ``` @@ -117,7 +110,8 @@ dependencies { to decide the location so "neverForLocation" permission flag can be used.--> + android:usesPermissionFlags="neverForLocation" + tools:targetApi="s" /> @@ -165,19 +159,27 @@ On your application you must request for the [permissions](https://developer.and ``` -## Code example: Heart rate +### Code example: Heart rate See the [example](examples/example-android) folder for the full project. #### Key things 1. Load the default api implementation and add callback. ```kt -// NOTICE in this code snippet all the features are enabled, if only interested on particular feature(s) like Heart rate and Battery info then -// PolarBleApiDefaultImpl.defaultImplementation(this, PolarBleApi.FEATURE_HR or PolarBleApi.FEATURE_BATTERY_INFO) -// batteryLevelReceived callback is invoked after connection - -val api: PolarBleApi = PolarBleApiDefaultImpl.defaultImplementation(applicationContext, PolarBleApi.ALL_FEATURES) - +// NOTICE in this code snippet all the features are enabled. +// You may enable only the features you are interested +val api: PolarBleApi = PolarBleApiDefaultImpl.defaultImplementation(applicationContext, + setOf(PolarBleApi.PolarBleSdkFeature.FEATURE_HR, + PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_SDK_MODE, + PolarBleApi.PolarBleSdkFeature.FEATURE_BATTERY_INFO, + PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_H10_EXERCISE_RECORDING, + PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING, + PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_ONLINE_STREAMING, + PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_DEVICE_TIME_SETUP, + PolarBleApi.PolarBleSdkFeature.FEATURE_DEVICE_INFO) + ) + ) + api.setApiCallback(object : PolarBleApiCallback() { override fun blePowerStateChanged(powered: Boolean) { @@ -196,16 +198,10 @@ api.setApiCallback(object : PolarBleApiCallback() { Log.d("MyApp", "DISCONNECTED: ${polarDeviceInfo.deviceId}") } - override fun streamingFeaturesReady(identifier: String, features: Set) { - for (feature in features) { - Log.d("MyApp", "Streaming feature $feature is ready") - } + override fun bleSdkFeatureReady(identifier: String, feature: PolarBleApi.PolarBleSdkFeature) { + Log.d(TAG, "Polar BLE SDK feature $feature is ready") } - - override fun hrFeatureReady(identifier: String) { - Log.d("MyApp", "HR READY: $identifier") - } - + override fun disInformationReceived(identifier: String, uuid: UUID, value: String) { Log.d("MyApp", "DIS INFO uuid: $uuid value: $value") } @@ -213,14 +209,6 @@ api.setApiCallback(object : PolarBleApiCallback() { override fun batteryLevelReceived(identifier: String, level: Int) { Log.d("MyApp", "BATTERY LEVEL: $level") } - - override fun hrNotificationReceived(identifier: String, data: PolarHrData) { - Log.d("MyApp", "HR value: ${data.hr} rrsMs: ${data.rrsMs} rr: ${data.rrs} contact: ${data.contactStatus} , ${data.contactStatusSupported}") - } - - override fun polarFtpFeatureReady(s: String) { - Log.d("MyApp", "FTP ready") - } }) ``` 2. Request permissions @@ -241,13 +229,8 @@ override fun onRequestPermissionsResult(requestCode: Int, permissions: Array)` where is the deviceID printed to your sensor, using `api.autoConnectToDevice(-50, null, null).subscribe()` to connect nearby device or `api.searchForDevice()` to scan and then select the device -# iOS: Getting started -Detailed documentation: [Documentation](polar-sdk-ios/docs/). Minimum iOS version is 13. -## Requirements +## iOS getting started +Detailed documentation: [Documentation](polar-sdk-ios/docs/). Minimum iOS version is 14. +### Requirements * Xcode 12.x * Swift 5.x -## Dependencies +### Dependencies * [RxSwift 6.0](https://github.com/ReactiveX/RxSwift) or above * [Swift Protobuf 1.18.0](https://github.com/apple/swift-protobuf) or above -## Installation +### Installation #### CocoaPods If you use [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) to manage your dependencies, add PolarBleSdk to your `Podfile`: @@ -275,7 +258,7 @@ If you use [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) use_frameworks! target 'YOUR_TARGET_NAME' do - pod 'PolarBleSdk', '~> 3.3' + pod 'PolarBleSdk', '~> 5.0' end ``` @@ -285,7 +268,7 @@ Add PolarBleSdk as a dependency to your `Package.swift` manifest ```swift dependencies: [ - .package(name: "PolarBleSdk", url: "https://github.com/polarofficial/polar-ble-sdk.git", .upToNextMajor(from: "3.3.0")) + .package(name: "PolarBleSdk", url: "https://github.com/polarofficial/polar-ble-sdk.git", .upToNextMajor(from: "5.0.0")) ] ``` or alternatively use [XCode package manager](https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app) to add Swift package to your project. @@ -294,21 +277,21 @@ or alternatively use [XCode package manager](https://developer.apple.com/documen If you use [Cathage](https://github.com/Carthage/Carthage) to manage your dependencies, add PolarBleSdk to your `Cartfile` ``` -github "polarofficial/polar-ble-sdk" ~> 3.3 +github "polarofficial/polar-ble-sdk" ~> 5.0 ``` ```bash $ carthage update --use-xcframeworks ``` -## Setup your application +### Setup your application * In your project target settings enable __Background Modes__, add __Uses Bluetooth LE accessories__ * In your project target property list add the key [NSBluetoothAlwaysUsageDescription](https://developer.apple.com/documentation/bundleresources/information_property_list/nsbluetoothalwaysusagedescription) -## Code example: Heart rate +### Code example: Heart rate See the [example](examples/example-ios) folder for the full project -### Key things +#### Key things `deviceId` is your Polar device's id. This is not required if you are using automatic connection. @@ -393,3 +376,24 @@ class MyController: UIViewController, ``` 3. Connect to a Polar device using `api.connectToDevice(id)` , `api.startAutoConnectToDevice(_ rssi: Int, service: CBUUID?, polarDeviceType: String?)` to connect nearby device or `api.searchForDevice()` to scan and select the device + +## Migration guides +- [Polar BLE SDK 5.0.0 Migration Guide](documentation/MigrationGuide5.0.0.md) + +## Collaboration +If you wish to collaborate with Polar commercially, [click here](https://www.polar.com/en/business/developers) + +## License + +### Quick License Summary / Your rights to use the SDK +You may use, copy and modify the SDK as long as you +include the original copyright and license notice in any copy of the +software/source and you comply with the license terms. You are +allowed to use the SDK for the development of software for your +private as well as for commercial use for as long as you use the SDK +in compliance with the license terms. + +By exploiting the SDK, you indicate your acceptance of [License](Polar_SDK_License.txt). + +## Third-party code and licenses +Third-party code and licenses used in Polar BLE SDK see license listing [ThirdPartySoftwareListing](ThirdPartySoftwareListing.txt) diff --git a/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/build.gradle b/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/build.gradle index 9e1484bd..1f54ba8c 100644 --- a/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/build.gradle +++ b/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/build.gradle @@ -29,12 +29,12 @@ android { dependencies { implementation 'com.github.polarofficial:polar-ble-sdk:4.0.0' implementation 'com.androidplot:androidplot-core:1.5.10' - implementation 'io.reactivex.rxjava3:rxjava:3.1.5' - implementation 'io.reactivex.rxjava3:rxandroid:3.0.0' - implementation 'androidx.appcompat:appcompat:1.6.0' + implementation 'io.reactivex.rxjava3:rxjava:3.1.6' + implementation 'io.reactivex.rxjava3:rxandroid:3.0.2' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation "androidx.core:core-ktx:1.9.0" implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10" testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' diff --git a/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/ECGActivity.kt b/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/ECGActivity.kt index 5b7053b8..ed0cb1f9 100755 --- a/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/ECGActivity.kt +++ b/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/ECGActivity.kt @@ -9,7 +9,6 @@ import com.androidplot.xy.BoundaryMode import com.androidplot.xy.StepMode import com.androidplot.xy.XYPlot import com.polar.sdk.api.PolarBleApi -import com.polar.sdk.api.PolarBleApi.DeviceStreamingFeature import com.polar.sdk.api.PolarBleApiCallback import com.polar.sdk.api.PolarBleApiDefaultImpl.defaultImplementation import com.polar.sdk.api.errors.PolarInvalidArgument @@ -35,6 +34,8 @@ class ECGActivity : AppCompatActivity(), PlotterListener { private lateinit var plot: XYPlot private lateinit var ecgPlotter: EcgPlotter private var ecgDisposable: Disposable? = null + private var hrDisposable: Disposable? = null + private lateinit var deviceId: String override fun onCreate(savedInstanceState: Bundle?) { @@ -50,10 +51,11 @@ class ECGActivity : AppCompatActivity(), PlotterListener { api = defaultImplementation( applicationContext, - PolarBleApi.FEATURE_POLAR_SENSOR_STREAMING or - PolarBleApi.FEATURE_BATTERY_INFO or - PolarBleApi.FEATURE_DEVICE_INFO or - PolarBleApi.FEATURE_HR + setOf( + PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_ONLINE_STREAMING, + PolarBleApi.PolarBleSdkFeature.FEATURE_BATTERY_INFO, + PolarBleApi.PolarBleSdkFeature.FEATURE_DEVICE_INFO + ) ) api.setApiCallback(object : PolarBleApiCallback() { override fun blePowerStateChanged(powered: Boolean) { @@ -73,20 +75,18 @@ class ECGActivity : AppCompatActivity(), PlotterListener { Log.d(TAG, "Device disconnected ${polarDeviceInfo.deviceId}") } - override fun streamingFeaturesReady(identifier: String, features: Set) { - for (feature in features) { - Log.d(TAG, "Streaming feature is ready: $feature") - when (feature) { - DeviceStreamingFeature.ECG -> streamECG() - else -> {} + override fun bleSdkFeatureReady(identifier: String, feature: PolarBleApi.PolarBleSdkFeature) { + Log.d(TAG, "feature ready $feature") + + when (feature) { + PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_ONLINE_STREAMING -> { + streamECG() + streamHR() } + else -> {} } } - override fun hrFeatureReady(identifier: String) { - Log.d(TAG, "HR Feature ready $identifier") - } - override fun disInformationReceived(identifier: String, uuid: UUID, value: String) { if (uuid == UUID.fromString("00002a28-0000-1000-8000-00805f9b34fb")) { val msg = "Firmware: " + value.trim { it <= ' ' } @@ -101,19 +101,22 @@ class ECGActivity : AppCompatActivity(), PlotterListener { textViewBattery.append(batteryLevelText) } - override fun hrNotificationReceived(identifier: String, data: PolarHrData) { - Log.d(TAG, "HR " + data.hr) - if (data.rrsMs.isNotEmpty()) { - val rrText = "(${data.rrsMs.joinToString(separator = "ms, ")}ms)" - textViewRR.text = rrText - } - - textViewHR.text = data.hr.toString() + override fun hrNotificationReceived(identifier: String, data: PolarHrData.PolarHrSample) { + // deprecated } override fun polarFtpFeatureReady(identifier: String) { - Log.d(TAG, "Polar FTP ready $identifier") + // deprecated } + + override fun streamingFeaturesReady(identifier: String, features: Set) { + // deprecated + } + + override fun hrFeatureReady(identifier: String) { + // deprecated + } + }) try { api.connectToDevice(deviceId) @@ -143,8 +146,9 @@ class ECGActivity : AppCompatActivity(), PlotterListener { } fun streamECG() { - if (ecgDisposable == null) { - ecgDisposable = api.requestStreamSettings(deviceId, DeviceStreamingFeature.ECG) + val isDisposed = ecgDisposable?.isDisposed ?: true + if (isDisposed) { + ecgDisposable = api.requestStreamSettings(deviceId, PolarBleApi.PolarDeviceDataType.ECG) .toFlowable() .flatMap { sensorSetting: PolarSensorSetting -> api.startEcgStreaming(deviceId, sensorSetting.maxSettings()) } .observeOn(AndroidSchedulers.mainThread()) @@ -170,6 +174,37 @@ class ECGActivity : AppCompatActivity(), PlotterListener { } } + fun streamHR() { + val isDisposed = hrDisposable?.isDisposed ?: true + if (isDisposed) { + hrDisposable = api.startHrStreaming(deviceId) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe( + { hrData: PolarHrData -> + for (sample in hrData.samples) { + Log.d(TAG, "HR " + sample.hr) + if (sample.rrsMs.isNotEmpty()) { + val rrText = "(${sample.rrsMs.joinToString(separator = "ms, ")}ms)" + textViewRR.text = rrText + } + + textViewHR.text = sample.hr.toString() + + } + }, + { error: Throwable -> + Log.e(TAG, "HR stream failed. Reason $error") + hrDisposable = null + }, + { Log.d(TAG, "HR stream complete") } + ) + } else { + // NOTE stops streaming if it is "running" + hrDisposable?.dispose() + hrDisposable = null + } + } + override fun update() { runOnUiThread { plot.redraw() } } diff --git a/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/HRActivity.kt b/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/HRActivity.kt index 95de8fe8..0e0fd715 100755 --- a/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/HRActivity.kt +++ b/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/HRActivity.kt @@ -10,12 +10,13 @@ import com.androidplot.xy.StepMode import com.androidplot.xy.XYGraphWidget import com.androidplot.xy.XYPlot import com.polar.sdk.api.PolarBleApi -import com.polar.sdk.api.PolarBleApi.DeviceStreamingFeature import com.polar.sdk.api.PolarBleApiCallback import com.polar.sdk.api.PolarBleApiDefaultImpl.defaultImplementation import com.polar.sdk.api.errors.PolarInvalidArgument import com.polar.sdk.api.model.PolarDeviceInfo import com.polar.sdk.api.model.PolarHrData +import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers +import io.reactivex.rxjava3.disposables.Disposable import java.text.DecimalFormat import java.util.* @@ -32,11 +33,14 @@ class HRActivity : AppCompatActivity(), PlotterListener { private lateinit var textViewBattery: TextView private lateinit var textViewFwVersion: TextView private lateinit var plot: XYPlot + private var hrDisposable: Disposable? = null + + private lateinit var deviceId: String override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_hr) - val deviceId = intent.getStringExtra("id") ?: throw Exception("HRActivity couldn't be created, no deviceId given") + deviceId = intent.getStringExtra("id") ?: throw Exception("HRActivity couldn't be created, no deviceId given") textViewHR = findViewById(R.id.hr_view_hr) textViewRR = findViewById(R.id.hr_view_rr) textViewDeviceId = findViewById(R.id.hr_view_deviceId) @@ -46,9 +50,11 @@ class HRActivity : AppCompatActivity(), PlotterListener { api = defaultImplementation( applicationContext, - PolarBleApi.FEATURE_BATTERY_INFO or - PolarBleApi.FEATURE_DEVICE_INFO or - PolarBleApi.FEATURE_HR + setOf( + PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_ONLINE_STREAMING, + PolarBleApi.PolarBleSdkFeature.FEATURE_BATTERY_INFO, + PolarBleApi.PolarBleSdkFeature.FEATURE_DEVICE_INFO + ) ) api.setApiLogger { str: String -> Log.d("SDK", str) } api.setApiCallback(object : PolarBleApiCallback() { @@ -69,14 +75,15 @@ class HRActivity : AppCompatActivity(), PlotterListener { Log.d(TAG, "Device disconnected ${polarDeviceInfo.deviceId}") } - override fun streamingFeaturesReady(identifier: String, features: Set) { - for (feature in features) { - Log.d(TAG, "Streaming feature is ready: $feature") - } - } + override fun bleSdkFeatureReady(identifier: String, feature: PolarBleApi.PolarBleSdkFeature) { + Log.d(TAG, "feature ready $feature") - override fun hrFeatureReady(identifier: String) { - Log.d(TAG, "HR Feature ready $identifier") + when (feature) { + PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_ONLINE_STREAMING -> { + streamHR() + } + else -> {} + } } override fun disInformationReceived(identifier: String, uuid: UUID, value: String) { @@ -93,19 +100,20 @@ class HRActivity : AppCompatActivity(), PlotterListener { textViewBattery.append(batteryLevelText) } - override fun hrNotificationReceived(identifier: String, data: PolarHrData) { - Log.d(TAG, "HR ${data.hr} RR ${data.rrsMs}") - - if (data.rrsMs.isNotEmpty()) { - val rrText = "(${data.rrsMs.joinToString(separator = "ms, ")}ms)" - textViewRR.text = rrText - } - textViewHR.text = data.hr.toString() - plotter.addValues(data) + override fun hrNotificationReceived(identifier: String, data: PolarHrData.PolarHrSample) { + //deprecated } override fun polarFtpFeatureReady(identifier: String) { - Log.d(TAG, "Polar FTP ready $identifier") + //deprecated + } + + override fun streamingFeaturesReady(identifier: String, features: Set) { + //deprecated + } + + override fun hrFeatureReady(identifier: String) { + //deprecated } }) @@ -141,4 +149,36 @@ class HRActivity : AppCompatActivity(), PlotterListener { override fun update() { runOnUiThread { plot.redraw() } } + + fun streamHR() { + val isDisposed = hrDisposable?.isDisposed ?: true + if (isDisposed) { + hrDisposable = api.startHrStreaming(deviceId) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe( + { hrData: PolarHrData -> + for (sample in hrData.samples) { + Log.d(TAG, "HR ${sample.hr} RR ${sample.rrsMs}") + + if (sample.rrsMs.isNotEmpty()) { + val rrText = "(${sample.rrsMs.joinToString(separator = "ms, ")}ms)" + textViewRR.text = rrText + } + textViewHR.text = sample.hr.toString() + plotter.addValues(sample) + + } + }, + { error: Throwable -> + Log.e(TAG, "HR stream failed. Reason $error") + hrDisposable = null + }, + { Log.d(TAG, "HR stream complete") } + ) + } else { + // NOTE stops streaming if it is "running" + hrDisposable?.dispose() + hrDisposable = null + } + } } \ No newline at end of file diff --git a/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/HrAndRrPlotter.kt b/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/HrAndRrPlotter.kt index 6aed7536..af5ab2b4 100755 --- a/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/HrAndRrPlotter.kt +++ b/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/HrAndRrPlotter.kt @@ -54,7 +54,7 @@ class HrAndRrPlotter { * * @param polarHrData The HR data that came in. */ - fun addValues(polarHrData: PolarHrData) { + fun addValues(polarHrData: PolarHrData.PolarHrSample) { val now = Date() val time = now.time for (i in 0 until NVALS - 1) { @@ -103,6 +103,4 @@ class HrAndRrPlotter { fun setListener(listener: PlotterListener?) { this.listener = listener } - - } \ No newline at end of file diff --git a/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/MainActivity.kt b/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/MainActivity.kt index 786b3214..f0435c77 100755 --- a/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/MainActivity.kt +++ b/demos/Android-Demos/PolarSDK-ECG-HR-Demo/app/src/main/java/com/polar/polarsdkecghrdemo/MainActivity.kt @@ -115,16 +115,14 @@ class MainActivity : AppCompatActivity() { bluetoothOnActivityResultLauncher.launch(enableBtIntent) } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { - requestPermissions(arrayOf(Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT), PERMISSION_REQUEST_CODE) - } else { - requestPermissions(arrayOf(Manifest.permission.ACCESS_FINE_LOCATION), PERMISSION_REQUEST_CODE) - } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + requestPermissions(arrayOf(Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT), PERMISSION_REQUEST_CODE) } else { - requestPermissions(arrayOf(Manifest.permission.ACCESS_COARSE_LOCATION), PERMISSION_REQUEST_CODE) + requestPermissions(arrayOf(Manifest.permission.ACCESS_FINE_LOCATION), PERMISSION_REQUEST_CODE) } + } else { + requestPermissions(arrayOf(Manifest.permission.ACCESS_COARSE_LOCATION), PERMISSION_REQUEST_CODE) } } diff --git a/demos/Android-Demos/PolarSDK-ECG-HR-Demo/build.gradle b/demos/Android-Demos/PolarSDK-ECG-HR-Demo/build.gradle index eca69ada..e5500dcd 100644 --- a/demos/Android-Demos/PolarSDK-ECG-HR-Demo/build.gradle +++ b/demos/Android-Demos/PolarSDK-ECG-HR-Demo/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'com.android.application' version '7.4.0' apply false - id 'org.jetbrains.kotlin.android' version '1.7.21' apply false + id 'com.android.application' version '7.4.2' apply false + id 'org.jetbrains.kotlin.android' version '1.8.10' apply false } task clean(type: Delete) { diff --git a/technical_documentation/KnownIssues.md b/documentation/KnownIssues.md similarity index 98% rename from technical_documentation/KnownIssues.md rename to documentation/KnownIssues.md index bbd4f26b..0b8a912b 100644 --- a/technical_documentation/KnownIssues.md +++ b/documentation/KnownIssues.md @@ -7,6 +7,7 @@ - **Workaround:** - The PPG stream is working even the `startOhrStreaming` request is made using the 135Hz as sampleRate parameter in `PolarSensorSetting`. However, the received PPG stream is sampled with 55Hz. - If [SDK mode](SdkModeExplained.md) is enabled then PPG settings is read correctly. +- **FIX:** FIXED IN VERITY SENSE FIRMWARE 2.1.0 #### Issue 2 - **Firmware:** all firmwares diff --git a/documentation/MigrationGuide5.0.0.md b/documentation/MigrationGuide5.0.0.md new file mode 100644 index 00000000..68be0fe4 --- /dev/null +++ b/documentation/MigrationGuide5.0.0.md @@ -0,0 +1,54 @@ +# PolarBleSDK 5.0.0 Migration Guide + +PolarBleSDK 5.0.0 is a major release that includes API-breaking changes. This guide aims to make the transition easier for developers who are updating their existing applications from PolarBleSDK 4.x.x to the latest APIs + +## New Features +PolarBleSDK 5.0.0 introduces a new feature that enables offline recording functionality in VeritySense. To learn more about offline recording, please see the [documentation](OfflineRecordingExplained.md) + +## Terminology update +In previous versions of the Polar BLE SDK, the core functionality provided online data streams over the BLE connection. This functionality was typically referred to as "streaming" in the PolarBleSdk vocabulary and APIs. With the introduction of new features for recording data to device storage in PolarBleSDK 5.0.0, the terminology has been updated. + +The updated terminology now distinguishes between "online streaming" and "offline recording". "Online streaming" refers to the functionality for streaming data in real time over the BLE connection. "Offline recording" refers to the new feature that allows data to be saved directly to the device storage. This change in terminology reflects the new capabilities of the Polar BLE SDK, and helps to clarify the distinction between the two modes of data handling. + +## Breaking API Changes Android +- The Polar BLE SDK previously defined feature names such as `FEATURE_HR`, `FEATURE_DEVICE_INFO`, `FEATURE_BATTERY_INFO`, `FEATURE_POLAR_SENSOR_STREAMING`, `FEATURE_POLAR_FILE_TRANSFER`, and `ALL_FEATURES` as constants. In the new version of the SDK, the features are defined in an enum class called `PolarBleSdkFeature`, with feature names that better describe their functionality. This change allows the Polar BLE SDK to optimize resource usage by only enabling features that are needed by the API user. Additionally, the new feature names are not tied to the BLE service names that provide the feature functionality, making them more understandable to the API user. Overall, this change simplifies the use of the Polar BLE SDK for developers who may not have a deep understanding of BLE service names and the related features they provide. + +- In the previous version of the Polar BLE SDK, the available data types for online streaming were defined in an enum class called `DeviceStreamingFeature`. In the new version of the SDK this enum is renamed to `PolarDeviceDataType`, as it now includes data types for both online streaming and offline recording. This change simplifies the naming convention for developers, and makes it easier to understand the different types of data available from the Polar device, both when streaming live data and when recording data for later analysis. + +- In the previous version of the Polar BLE SDK, the `backgroundEntered` function was deprecated, and it has now been removed from the API. This function was previously used to detect when the app was sent to the background, but the information is not needed by SDK anymore. + +- In previous versions of the Polar BLE SDK, the callbacks `polarFtpFeatureReady`, `hrFeatureReady`, and `sdkModeFeatureAvailable` were used to determine when certain features were ready for use. In the latest version of the SDK, these callbacks have been deprecated and replaced with a new callback called `bleSdkFeatureReady`. The `bleSdkFeatureReady` callback is now used to indicate when any feature of the Polar BLE SDK is ready for use. When a feature becomes ready, the `bleSdkFeatureReady` callback is called with the `PolarBleSdkFeature` parameter, which indicates the specific feature that is ready for use. nThis change allows for a more efficient and consistent way of handling feature readiness, as all features can now be managed through a single callback. Developers who are updating their apps to the latest version of the Polar BLE SDK should ensure that they are using the new `bleSdkFeatureReady` callback to manage feature readiness. + +- In the latest version of the Polar BLE SDK, the `streamingFeaturesReady` callback in `PolarBleApiCallback` has been deprecated. Instead, the new `bleSdkFeatureReady` callback can be used to determine whether a Polar device supports online streaming and if the online streaming feature is ready for use. When the `bleSdkFeatureReady` callback is called with the feature parameter set to `FEATURE_POLAR_ONLINE_STREAMING`, it indicates that the device is ready to stream online data, and the `PolarOnlineStreamingApi` can be used to access the data. The `getAvailableOnlineStreamDataTypes` function in `PolarOnlineStreamingApi` can be used to retrieve a list of available data types that can be streamed from the connected device. + +- `PolarHrSample` no longer has a `rrs` property. Instead, it has a `rrsMs` property that represents the R-wave to R-wave intervals in milliseconds. Update any code that uses `rrs` to use `rrsMs` instead. `PolarHrSample` also has a new `rrAvailable` property that indicates whether RR data is available for the sample. + +## Deprecated APIs on Android + +- `hrNotificationReceived` is deprecated in `PolarBleApiCallback`. The recommended way to receive heart rate is the `startHrStreaming` API, similar to streaming of other data types. + +- the `startOhrStreaming` API has been renamed to `startPpgStreaming`. This change was made to better describe the type of data that will be streamed using the API. + +- the `startOhrPPIStreaming` API has been renamed to `startPpiStreaming`. This change was made to better describe the type of data that will be streamed using the API. + +- the `PolarOhrPPIData` data class has been renamed to `PolarPpiData` in order to provide a more accurate description of the type of data it represents. + + +## Breaking API Changes iOS +- The SDK features in the Polar BLE SDK were previously defined in an enum class called `Features`. The new version of the SDK defines the features in an enum class called `PolarBleSdkFeature`, with feature names that better describe their functionality. This change allows the Polar BLE SDK to optimize resource usage by only enabling features that are needed by the API user. Additionally, the new feature names are not tied to the BLE service names that provide the feature functionality, making them more understandable to the API user. Overall, this change simplifies the use of the Polar BLE SDK for developers who may not have a deep understanding of BLE service names and the related features they provide. + +- In the previous version of the Polar BLE SDK, the available data types for online streaming were defined in an enum class called `DeviceStreamingFeature`. In the new version of the SDK this enum is renamed to `PolarDeviceDataType`, as it now includes data types for both online streaming and offline recording. This change simplifies the naming convention for developers, and makes it easier to understand the different types of data available from the Polar device, both when streaming live data and when recording data for later analysis. + +- In previous versions of the Polar BLE SDK, the callbacks `polarFtpFeatureReady`, `hrFeatureReady`, and `sdkModeFeatureAvailable` were used to determine when certain features were ready for use. In the latest version of the SDK, these callbacks have been deprecated and replaced with a new callback called `bleSdkFeatureReady`. The `bleSdkFeatureReady` callback is now used to indicate when any feature of the Polar BLE SDK is ready for use. When a feature becomes ready, the `bleSdkFeatureReady` callback is called with the `PolarBleSdkFeature` parameter, which indicates the specific feature that is ready for use. nThis change allows for a more efficient and consistent way of handling feature readiness, as all features can now be managed through a single callback. Developers who are updating their apps to the latest version of the Polar BLE SDK should ensure that they are using the new `bleSdkFeatureReady` callback to manage feature readiness. + +- In the latest version of the Polar BLE SDK, the `streamingFeaturesReady` callback in `PolarBleApiCallback` has been deprecated. Instead, the new `bleSdkFeatureReady` callback can be used to determine whether a Polar device supports online streaming and if the online streaming feature is ready for use. When the `bleSdkFeatureReady` callback is called with the feature parameter set to `FEATURE_POLAR_ONLINE_STREAMING`, it indicates that the device is ready to stream online data, and the `PolarOnlineStreamingApi` can be used to access the data. The `getAvailableOnlineStreamDataTypes` function in `PolarOnlineStreamingApi` can be used to retrieve a list of available data types that can be streamed from the connected device. + +- The `PolarHrData` type has been changed from a tuple to an array of tuples. Update any code that uses this type to reflect this change. `PolarHrData` no longer has a `rrs` property. Instead, it has a `rrsMs` property that represents the R-wave to R-wave intervals in milliseconds. The `rrAvailable` property have been added. + +## Deprecated APIs on iOS + +- `hrValueReceived` is deprecated in `PolarBleApiDeviceHrObserver`. The recommended way to receive heart rate is the `startHrStreaming` API, similar to streaming of other data types. + +- the `startOhrStreaming` API has been renamed to `startPpgStreaming`. This change was made to better describe the type of data that will be streamed using the API. + +- the `startOhrPPIStreaming` API has been renamed to `startPpiStreaming`. This change was made to better describe the type of data that will be streamed using the API. diff --git a/documentation/OfflineRecordingExplained.md b/documentation/OfflineRecordingExplained.md new file mode 100644 index 00000000..017abc7c --- /dev/null +++ b/documentation/OfflineRecordingExplained.md @@ -0,0 +1,58 @@ +# Offline Recording + +The offline recording makes it possible to record data into Polar device internal memory. The recording continues even though the BLE connection is lost while recording. + +- [Basic usage](#features) +- [Advanced usage](#advanced-usage) +- [Memory management](#memory-management) +- [Security](#security) +- [Availability](#availability) +- [Considerations](#considerations) + +## Basic usage + +To enable the offline recording the feature `FEATURE_POLAR_OFFLINE_RECORDING` must be opted in at the time of Polar BLE SDK instantiation. Once the BLE connection is created to the Polar device the `bleSdkFeatureReady` callback is called by the SDK with feature `FEATURE_POLAR_OFFLINE_RECORDING` indicating the offline recording functionality is available in Polar device and it is ready to be used. From this point onwards the offline recording API functions, exposed in the `PolarOfflineRecordingApi` interface, are available and usable. + +To know which data types are supported in the particular Polar device, the `getAvailableOfflineRecordingDataTypes` function can used to check the availability. + +The API `PolarOfflineRecordingApi` has the basic functions to start `startOfflineRecording` and stop `stopOfflineRecording` offline recording. Status query of API function `getOfflineRecordingStatus` indicates if device is already having active recordings on going. + +The listing of recordings saved in device memory can be done with `listOfflineRecordings`. The listing returns all the entries (`PolarOfflineRecordingEntry`) in the device or empty list if no recordings found. Using the `PolarOfflineRecordingEntry` it is possible to read the record with the `getOfflineRecord` and delete it with `removeOfflineRecord`. + +To know what are the capabilities of each `PolarDeviceDataType` in offline recording, the settings shall be queried by the `requestOfflineRecordingSettings`. The wanted settings are then provided as parameter for `startOfflineRecording`. + +## Advanced usage + +**SDK Mode** + +The offline recording can be used in [SDK mode](SdkModeExplained.md). The SDK mode provides wider range of settings to be used, to know the available settings in SDK mode for offline recording the settings can be queried by the `requestFullOfflineRecordingSettings`. Please note that in SDK Mode, it is not possible to perform operations such as listing offline recordings (`listOfflineRecordings`), reading specific offline recording (`getOfflineRecord`), or deleting offline recordings (`removeOfflineRecord`). + +**Offline recording triggers** + +Triggers are the way to automatically start the offline recording. The options are `TRIGGER_SYSTEM_START` and `TRIGGER_EXERCISE_START`. In case the trigger is set to `TRIGGER_SYSTEM_START` the offline recording is started every time the Polar device is switched on, e.g. when VeritySense device power button is pressed by the user to turn device on. In case the trigger is set to `TRIGER_EXERCISE_START` the offline recording is started every time exercise is started in Polar device. With the VeritySense `TRIGER_EXERCISE_START` will trigger offline recording if either the [exercise](https://support.polar.com/en/how-to-use-polar-verity-sense-in-recording-mode) or [swimming](https://support.polar.com/en/how-to-use-polar-verity-sense-in-swimming-mode) mode is started by the user of VeritySense. + +The API `setOfflineRecordingTrigger` is used to setup the trigger. When the offline recording is automatically started by the trigger the recording will end in two conditions, either recording is stopped by `stopOfflineRecording` or user switch off the device. To disable the trigger the `setOfflineRecordingTrigger` function is called with the option `TRIGGER_DISABLED` + +## Memory management + +The device does not automatically erase offline recordings to make space for new ones. If there is less than 2 MB of memory left when a new recording is started, the device will respond with the `DISK_FULL` error when `startOfflineRecording` is subscribed. Similarly, the same 2 MB memory limit prevents the setting of new triggers with `setOfflineRecordingTrigger`. + +In addition, please note that the device will automatically stop the offline recording when there is less than 300 kB of free space remaining. At this point, all offline recording triggers will also be disabled. + + +## Security + +The offline record saved in device memory can be encrypted by providing the 128bit AES key as parameter for `startOfflineRecording` request. If providing the key with the `startOfflineRecording` request, the exact same key must be provided in `getOfflineRecord` to be able to read out the offline record. Each of the started recoding may be started with different key. The key management is not provided by the SDK, but the application developer shall implement the key management. It is recommended the security option is used, otherwise it might be possible by others to read out recordings in VeritySense. + +## Availability + +| Device | Version onwards | +|:-------------------|:---------------:| +| Polar Verity Sense |2.1.0 | + + +## Considerations + +The online streaming and offline recording do not work same time for the same data type. For example if either accelerometer offline recording or the accelerometer online streaming is started, the attempt to start the online streaming or offline recording at this state will return the error ERROR_ALREADY_IN_STATE. + +The offline recording read `getOfflineRecord` and delete `removeOfflineRecord` can be called while the offline recording is recording, but that is not recommended. It is recommended to stop the offline recording by `stopOfflineRecording` before trying to access the recording with `getOfflineRecord` or `removeOfflineRecord` functions. diff --git a/documentation/SdkModeExplained.md b/documentation/SdkModeExplained.md new file mode 100644 index 00000000..8e3b84a0 --- /dev/null +++ b/documentation/SdkModeExplained.md @@ -0,0 +1,30 @@ +# SDK Mode + +The SDK mode is the mode of the sensor in which the wider range of stream capabilities are offered, i.e higher sampling rates, wider (or narrow) ranges etc. For example, in the SDK mode the accelerometer sampling rate can be chosen from values 26Hz, 52Hz, 104Hz, 208Hz or 416Hz compared to 52Hz available in normal operation mode. + +[Polar Verity Sense](https://www.polar.com/en/products/accessories/polar-verity-sense) (starting from firmware 1.1.5) is the first sensor to support the SDK Mode. + +***How to use SDK Mode in Polar Verity Sense*** +- first of all you need to update the Polar Verity Sense sensor to firmware [1.1.5](https://support.polar.com/en/updates/polar-verity-sense-11-firmware-update). Which can be done by registering the sensor to Polar Flow, see the [help](https://support.polar.com/e_manuals/verity-sense/polar-verity-sense-user-manual-english/firmware-update.htm) +- secondly you will enable or disable SDK Mode using API's provided in Polar BLE SDK library +- once the SDK mode is enabled you may start the data online stream or offline recording as in normal operation mode + +***Good to know about SDK Mode in Polar Verity Sense*** +- you may read the capabilities available in SDK from the device with the `requestFullStreamSettings` or `requestFullOfflineRecordingSettings` function in any operation mode. +- if starting many online streams on high frequency at the same time, it cannot be guaranteed that all the data is sent over the Bluetooth as traffic may get too high +- if the online stream or offline recording is currently running on the device, the SDK Mode cannot be changed. Attempting to change the SDK Mode in will result in an "INVALID STATE" error. +- sample code on how to use SDK mode can seen from [Android](../examples/example-android) and [iOS](../examples/example-ios) examples + +***SDK Mode capabilities in Polar Verity Sense*** + +| Data |Operation mode | Sampling Rate | Range (+-) | Resolution | +|:-----------:|:-----------------:|:-------------------------------:|:----------------------------------------------------:|:----------:| +| Acc | Online streaming | 26Hz, 52Hz, 104Hz, 208Hz, 416Hz | 2g, 4g, 8g, 16g |16 | +| Acc | Offline recording | 26Hz, 52Hz | 2g, 4g, 8g, 16g |16 | +| Gyro | Online streaming | 26Hz, 52Hz, 104Hz, 208Hz, 416Hz | 250 deg/sec, 500 deg/sec, 1000 deg/sec, 2000 deg/sec |16 | +| Gyro | Offline recording | 26Hz, 52Hz | 250 deg/sec, 500 deg/sec, 1000 deg/sec, 2000 deg/sec |16 | +| Magnetometer| Online streaming | 10Hz, 20Hz, 50Hz, 100Hz | 50 Gauss |16 | +| Magnetometer| Offline recording | 10Hz, 20Hz, 50Hz | 50 Gauss |16 | +| PPG | Online streaming | 28Hz, 44Hz, 55Hz, 135Hz, 176Hz | - |22 | +| PPG | Offline recording | 28Hz, 44Hz, 55Hz | - |22 | +| PPI | PPI online stream or offline recording is not supported in SDK MODE | diff --git a/technical_documentation/TimeSystemExplained.md b/documentation/TimeSystemExplained.md similarity index 100% rename from technical_documentation/TimeSystemExplained.md rename to documentation/TimeSystemExplained.md diff --git a/examples/example-android/androidBleSdkTestApp/app/build.gradle b/examples/example-android/androidBleSdkTestApp/app/build.gradle index 2743c6fa..7e51ba5f 100644 --- a/examples/example-android/androidBleSdkTestApp/app/build.gradle +++ b/examples/example-android/androidBleSdkTestApp/app/build.gradle @@ -11,6 +11,7 @@ android { versionCode 1 versionName "1.0" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' + multiDexEnabled true } buildTypes { release { @@ -19,10 +20,6 @@ android { } } - defaultConfig { - multiDexEnabled true - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -30,13 +27,13 @@ android { } dependencies { - implementation 'com.github.polarofficial:polar-ble-sdk:4.0.0' - implementation 'io.reactivex.rxjava3:rxjava:3.1.5' - implementation 'io.reactivex.rxjava3:rxandroid:3.0.0' - implementation 'androidx.appcompat:appcompat:1.6.0' + implementation 'com.github.polarofficial:polar-ble-sdk:5.0.0-beta4' + implementation 'io.reactivex.rxjava3:rxjava:3.1.6' + implementation 'io.reactivex.rxjava3:rxandroid:3.0.2' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation "androidx.core:core-ktx:1.9.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20" - implementation 'com.google.android.material:material:1.7.0' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10" + implementation 'com.google.android.material:material:1.8.0' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' diff --git a/examples/example-android/androidBleSdkTestApp/app/src/main/AndroidManifest.xml b/examples/example-android/androidBleSdkTestApp/app/src/main/AndroidManifest.xml index b96efcb7..07461b4e 100644 --- a/examples/example-android/androidBleSdkTestApp/app/src/main/AndroidManifest.xml +++ b/examples/example-android/androidBleSdkTestApp/app/src/main/AndroidManifest.xml @@ -1,10 +1,12 @@ - + + android:usesPermissionFlags="neverForLocation" + tools:targetApi="s" /> @@ -36,8 +38,8 @@ > = mutableMapOf() + + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) @@ -89,6 +112,7 @@ class MainActivity : AppCompatActivity() { connectButton = findViewById(R.id.connect_button) autoConnectButton = findViewById(R.id.auto_connect_button) scanButton = findViewById(R.id.scan_button) + hrButton = findViewById(R.id.hr_button) ecgButton = findViewById(R.id.ecg_button) accButton = findViewById(R.id.acc_button) gyrButton = findViewById(R.id.gyr_button) @@ -104,9 +128,21 @@ class MainActivity : AppCompatActivity() { setTimeButton = findViewById(R.id.set_time) getTimeButton = findViewById(R.id.get_time) toggleSdkModeButton = findViewById(R.id.toggle_SDK_mode) + //Verity Sense recording buttons + listRecordingsButton = findViewById(R.id.list_recordings) + startRecordingButton = findViewById(R.id.start_recording) + stopRecordingButton = findViewById(R.id.stop_recording) + downloadRecordingButton = findViewById(R.id.download_recording) + deleteRecordingButton = findViewById(R.id.delete_recording) api.setPolarFilter(false) - api.setApiLogger { s: String -> Log.d(API_LOGGER_TAG, s) } + + // If there is need to log what is happening inside the SDK, it can be enabled like this: + val enableSdkLogs = false + if(enableSdkLogs) { + api.setApiLogger { s: String -> Log.d(API_LOGGER_TAG, s) } + } + api.setApiCallback(object : PolarBleApiCallback() { override fun blePowerStateChanged(powered: Boolean) { Log.d(TAG, "BLE power: $powered") @@ -140,17 +176,6 @@ class MainActivity : AppCompatActivity() { toggleButtonUp(toggleSdkModeButton, R.string.enable_sdk_mode) } - override fun streamingFeaturesReady(identifier: String, features: Set) { - for (feature in features) { - Log.d(TAG, "Streaming feature $feature is ready") - } - } - - override fun hrFeatureReady(identifier: String) { - Log.d(TAG, "HR READY: $identifier") - // hr notifications are about to start - } - override fun disInformationReceived(identifier: String, uuid: UUID, value: String) { Log.d(TAG, "DIS INFO uuid: $uuid value: $value") } @@ -159,12 +184,8 @@ class MainActivity : AppCompatActivity() { Log.d(TAG, "BATTERY LEVEL: $level") } - override fun hrNotificationReceived(identifier: String, data: PolarHrData) { - Log.d(TAG, "HR value: ${data.hr} rrsMs: ${data.rrsMs} rr: ${data.rrs} contact: ${data.contactStatus} , ${data.contactStatusSupported}") - } - - override fun polarFtpFeatureReady(identifier: String) { - Log.d(TAG, "FTP ready") + override fun hrNotificationReceived(identifier: String, data: PolarHrData.PolarHrSample) { + // deprecated } }) @@ -242,11 +263,36 @@ class MainActivity : AppCompatActivity() { } } + hrButton.setOnClickListener { + val isDisposed = hrDisposable?.isDisposed ?: true + if (isDisposed) { + toggleButtonDown(hrButton, R.string.stop_hr_stream) + hrDisposable = api.startHrStreaming(deviceId) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe( + { hrData: PolarHrData -> + for (sample in hrData.samples) { + Log.d(TAG, "HR bpm: ${sample.hr} rrs: ${sample.rrsMs} rrAvailable: ${sample.rrAvailable} contactStatus: ${sample.contactStatus} contactStatusSupported: ${sample.contactStatusSupported}") + } + }, + { error: Throwable -> + toggleButtonUp(hrButton, R.string.start_hr_stream) + Log.e(TAG, "HR stream failed. Reason $error") + }, + { Log.d(TAG, "HR stream complete") } + ) + } else { + toggleButtonUp(hrButton, R.string.start_hr_stream) + // NOTE dispose will stop streaming if it is "running" + hrDisposable?.dispose() + } + } + ecgButton.setOnClickListener { val isDisposed = ecgDisposable?.isDisposed ?: true if (isDisposed) { toggleButtonDown(ecgButton, R.string.stop_ecg_stream) - ecgDisposable = requestStreamSettings(deviceId, PolarBleApi.DeviceStreamingFeature.ECG) + ecgDisposable = requestStreamSettings(deviceId, PolarBleApi.PolarDeviceDataType.ECG) .flatMap { settings: PolarSensorSetting -> api.startEcgStreaming(deviceId, settings) } @@ -273,7 +319,7 @@ class MainActivity : AppCompatActivity() { val isDisposed = accDisposable?.isDisposed ?: true if (isDisposed) { toggleButtonDown(accButton, R.string.stop_acc_stream) - accDisposable = requestStreamSettings(deviceId, PolarBleApi.DeviceStreamingFeature.ACC) + accDisposable = requestStreamSettings(deviceId, PolarBleApi.PolarDeviceDataType.ACC) .flatMap { settings: PolarSensorSetting -> api.startAccStreaming(deviceId, settings) } @@ -305,7 +351,7 @@ class MainActivity : AppCompatActivity() { if (isDisposed) { toggleButtonDown(gyrButton, R.string.stop_gyro_stream) gyrDisposable = - requestStreamSettings(deviceId, PolarBleApi.DeviceStreamingFeature.GYRO) + requestStreamSettings(deviceId, PolarBleApi.PolarDeviceDataType.GYRO) .flatMap { settings: PolarSensorSetting -> api.startGyroStreaming(deviceId, settings) } @@ -334,7 +380,7 @@ class MainActivity : AppCompatActivity() { if (isDisposed) { toggleButtonDown(magButton, R.string.stop_mag_stream) magDisposable = - requestStreamSettings(deviceId, PolarBleApi.DeviceStreamingFeature.MAGNETOMETER) + requestStreamSettings(deviceId, PolarBleApi.PolarDeviceDataType.MAGNETOMETER) .flatMap { settings: PolarSensorSetting -> api.startMagnetometerStreaming(deviceId, settings) } @@ -363,14 +409,14 @@ class MainActivity : AppCompatActivity() { if (isDisposed) { toggleButtonDown(ppgButton, R.string.stop_ppg_stream) ppgDisposable = - requestStreamSettings(deviceId, PolarBleApi.DeviceStreamingFeature.PPG) + requestStreamSettings(deviceId, PolarBleApi.PolarDeviceDataType.PPG) .flatMap { settings: PolarSensorSetting -> - api.startOhrStreaming(deviceId, settings) + api.startPpgStreaming(deviceId, settings) } .subscribe( - { polarOhrPPGData: PolarOhrData -> - if (polarOhrPPGData.type == PolarOhrData.OhrDataType.PPG3_AMBIENT1) { - for (data in polarOhrPPGData.samples) { + { polarPpgData: PolarPpgData -> + if (polarPpgData.type == PolarPpgData.PpgDataType.PPG3_AMBIENT1) { + for (data in polarPpgData.samples) { Log.d(TAG, "PPG ppg0: ${data.channelSamples[0]} ppg1: ${data.channelSamples[1]} ppg2: ${data.channelSamples[2]} ambient: ${data.channelSamples[3]} timeStamp: ${data.timeStamp}") } } @@ -392,10 +438,10 @@ class MainActivity : AppCompatActivity() { val isDisposed = ppiDisposable?.isDisposed ?: true if (isDisposed) { toggleButtonDown(ppiButton, R.string.stop_ppi_stream) - ppiDisposable = api.startOhrPPIStreaming(deviceId) + ppiDisposable = api.startPpiStreaming(deviceId) .observeOn(AndroidSchedulers.mainThread()) .subscribe( - { ppiData: PolarOhrPPIData -> + { ppiData: PolarPpiData -> for (sample in ppiData.samples) { Log.d(TAG, "PPI ppi: ${sample.ppi} blocker: ${sample.blockerBit} errorEstimate: ${sample.errorEstimate}") } @@ -511,7 +557,7 @@ class MainActivity : AppCompatActivity() { val isDisposed = recordingStartStopDisposable?.isDisposed ?: true if (isDisposed) { val recordIdentifier = "TEST_APP_ID" - recordingStartStopDisposable = api.startRecording(deviceId, recordIdentifier, PolarBleApi.RecordingInterval.INTERVAL_1S, PolarBleApi.SampleType.HR) + recordingStartStopDisposable = api.startRecording(deviceId, recordIdentifier, PolarH10OfflineExerciseApi.RecordingInterval.INTERVAL_1S, PolarH10OfflineExerciseApi.SampleType.HR) .observeOn(AndroidSchedulers.mainThread()) .subscribe( { @@ -623,6 +669,138 @@ class MainActivity : AppCompatActivity() { ) } + + listRecordingsButton.setOnClickListener { + api.listOfflineRecordings(deviceId) + .observeOn(AndroidSchedulers.mainThread()) + .doOnSubscribe { + entryCache[deviceId] = mutableListOf() + } + .map { + entryCache[deviceId]?.add(it) + it + } + .subscribe( + { polarOfflineRecordingEntry: PolarOfflineRecordingEntry -> + Log.d( + TAG, + "next: ${polarOfflineRecordingEntry.date} path: ${polarOfflineRecordingEntry.path} size: ${polarOfflineRecordingEntry.size}" + ) + }, + { error: Throwable -> Log.e(TAG, "Failed to list recordings: $error") }, + { Log.d(TAG, "list recordings complete") } + ) + } + + startRecordingButton.setOnClickListener { + //Example of starting ACC offline recording + Log.d(TAG, "Starts ACC recording") + val settings: MutableMap = mutableMapOf() + settings[PolarSensorSetting.SettingType.SAMPLE_RATE] = 52 + settings[PolarSensorSetting.SettingType.RESOLUTION] = 16 + settings[PolarSensorSetting.SettingType.RANGE] = 8 + settings[PolarSensorSetting.SettingType.CHANNELS] = 3 + //Using a secret key managed by your own. + // You can use a different key to each start recording calls. + // When using key at start recording, it is also needed for the recording download, otherwise could not be decrypted + val yourSecret = PolarRecordingSecret( + byteArrayOf( + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 + ) + ) + api.startOfflineRecording(deviceId, PolarBleApi.PolarDeviceDataType.ACC, PolarSensorSetting(settings.toMap()), yourSecret) + //Without a secret key + //api.startOfflineRecording(deviceId, PolarBleApi.PolarDeviceDataType.ACC, PolarSensorSetting(settings.toMap())) + .subscribe( + { Log.d(TAG, "start offline recording completed") }, + { throwable: Throwable -> Log.e(TAG, "" + throwable.toString()) } + ) + } + + stopRecordingButton.setOnClickListener { + //Example of stopping ACC offline recording + Log.d(TAG, "Stops ACC recording") + api.stopOfflineRecording(deviceId, PolarBleApi.PolarDeviceDataType.ACC) + .subscribe( + { Log.d(TAG, "stop offline recording completed") }, + { throwable: Throwable -> Log.e(TAG, "" + throwable.toString()) } + ) + } + + downloadRecordingButton.setOnClickListener { + //Example of one offline recording download + //NOTE: For this example you need to click on listRecordingsButton to have files entry (entryCache) up to date + Log.d(TAG, "Searching to recording to download... ") + //Get first entry for testing download + val offlineRecEntry = entryCache[deviceId]?.firstOrNull() + offlineRecEntry?.let { offlineEntry -> + try { + //Using a secret key managed by your own. + // You can use a different key to each start recording calls. + // When using key at start recording, it is also needed for the recording download, otherwise could not be decrypted + val yourSecret = PolarRecordingSecret( + byteArrayOf( + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 + ) + ) + api.getOfflineRecord(deviceId, offlineEntry, yourSecret) + //Not using a secret key + //api.getOfflineRecord(deviceId, offlineEntry) + .subscribe( + { + Log.d(TAG, "Recording ${offlineEntry.path} downloaded. Size: ${offlineEntry.size}") + when (it) { + is PolarOfflineRecordingData.AccOfflineRecording -> { + Log.d(TAG, "ACC Recording started at ${it.startTime}") + for (sample in it.data.samples) { + Log.d(TAG, "ACC data: time: ${sample.timeStamp} X: ${sample.x} Y: ${sample.y} Z: ${sample.z}") + } + } +// is PolarOfflineRecordingData.GyroOfflineRecording -> { } +// is PolarOfflineRecordingData.MagOfflineRecording -> { } +// ... + else -> { + Log.d(TAG, "Recording type is not yet implemented") + } + } + }, + { throwable: Throwable -> Log.e(TAG, "" + throwable.toString()) } + ) + } catch (e: Exception) { + Log.e(TAG, "Get offline recording fetch failed on entry ...", e) + } + } + } + + deleteRecordingButton.setOnClickListener { + //Example of one offline recording deletion + //NOTE: For this example you need to click on listRecordingsButton to have files entry (entryCache) up to date + Log.d(TAG, "Searching to recording to delete... ") + //Get first entry for testing deletion + val offlineRecEntry = entryCache[deviceId]?.firstOrNull() + offlineRecEntry?.let { offlineEntry -> + try { + api.removeOfflineRecord(deviceId, offlineEntry) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe( + { + Log.d(TAG, "Recording file deleted") + }, + { error -> + val errorString = "Recording file deletion failed: $error" + showToast(errorString) + Log.e(TAG, errorString) + } + ) + + } catch (e: Exception) { + Log.e(TAG, "Delete offline recording failed on entry ...", e) + } + } + } + toggleSdkModeButton.setOnClickListener { toggleSdkModeButton.isEnabled = false if (!sdkModeEnabledStatus) { @@ -736,7 +914,7 @@ class MainActivity : AppCompatActivity() { button.background = buttonDrawable } - private fun requestStreamSettings(identifier: String, feature: PolarBleApi.DeviceStreamingFeature): Flowable { + private fun requestStreamSettings(identifier: String, feature: PolarBleApi.PolarDeviceDataType): Flowable { val availableSettings = api.requestStreamSettings(identifier, feature) val allSettings = api.requestFullStreamSettings(identifier, feature) .onErrorReturn { error: Throwable -> @@ -754,15 +932,13 @@ class MainActivity : AppCompatActivity() { } .observeOn(AndroidSchedulers.mainThread()) .toFlowable() - .flatMap( - Function { sensorSettings: android.util.Pair -> - DialogUtility.showAllSettingsDialog( - this@MainActivity, - sensorSettings.first.settings, - sensorSettings.second.settings - ).toFlowable() - } as Function, Flowable> - ) + .flatMap { sensorSettings: android.util.Pair -> + DialogUtility.showAllSettingsDialog( + this@MainActivity, + sensorSettings.first.settings, + sensorSettings.second.settings + ).toFlowable() + } } private fun showToast(message: String) { @@ -806,6 +982,12 @@ class MainActivity : AppCompatActivity() { setTimeButton.isEnabled = false getTimeButton.isEnabled = false toggleSdkModeButton.isEnabled = false + //Verity Sense recording buttons + listRecordingsButton.isEnabled = false + startRecordingButton.isEnabled = false + stopRecordingButton.isEnabled = false + downloadRecordingButton.isEnabled = false + deleteRecordingButton.isEnabled = false } private fun enableAllButtons() { @@ -828,6 +1010,12 @@ class MainActivity : AppCompatActivity() { setTimeButton.isEnabled = true getTimeButton.isEnabled = true toggleSdkModeButton.isEnabled = true + //Verity Sense recording buttons + listRecordingsButton.isEnabled = true + startRecordingButton.isEnabled = true + stopRecordingButton.isEnabled = true + downloadRecordingButton.isEnabled = true + deleteRecordingButton.isEnabled = true } private fun disposeAllStreams() { diff --git a/examples/example-android/androidBleSdkTestApp/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/examples/example-android/androidBleSdkTestApp/app/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index c7bd21db..00000000 --- a/examples/example-android/androidBleSdkTestApp/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/examples/example-android/androidBleSdkTestApp/app/src/main/res/drawable/ic_launcher_background.xml b/examples/example-android/androidBleSdkTestApp/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index d5fccc53..00000000 --- a/examples/example-android/androidBleSdkTestApp/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/example-android/androidBleSdkTestApp/app/src/main/res/layout/activity_main.xml b/examples/example-android/androidBleSdkTestApp/app/src/main/res/layout/activity_main.xml index f7dc07b9..fb0e58cd 100644 --- a/examples/example-android/androidBleSdkTestApp/app/src/main/res/layout/activity_main.xml +++ b/examples/example-android/androidBleSdkTestApp/app/src/main/res/layout/activity_main.xml @@ -53,6 +53,12 @@ android:layout_marginBottom="2dp" android:background="@android:color/white" /> + + + +
+ + + + + + + + + + + + + + + + + + + + +
Modifier and TypeMethodDescription
final String + getName() +
final Integer + getOrdinal() +
+
+
    + +
  • + + +

    Methods inherited from class java.lang.Object

    + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
  • +
+ + + + + + + +
+ +
+ + + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.DeviceStreamingFeature.html b/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.PolarDeviceDataType.html similarity index 91% rename from polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.DeviceStreamingFeature.html rename to polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.PolarDeviceDataType.html index 99d57a69..5412332f 100644 --- a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.DeviceStreamingFeature.html +++ b/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.PolarDeviceDataType.html @@ -1,7 +1,7 @@ - DeviceStreamingFeature + PolarDeviceDataType @@ -89,7 +89,7 @@
Package 
-

Enum PolarBleApi.DeviceStreamingFeature

+

Enum PolarBleApi.PolarDeviceDataType

@@ -376,7 +382,7 @@

getName

>
  • getOrdinal

    -
     final Integer getOrdinal()
    +
     final Integer getOrdinal()
    diff --git a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.html b/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.html index 769e2e62..7ce7abcf 100644 --- a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.html +++ b/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.html @@ -108,6 +108,24 @@

    Class PolarBleApi

    All Implemented Interfaces:
    + com.polar.sdk.api.PolarH10OfflineExerciseApi + + , + + + com.polar.sdk.api.PolarOfflineRecordingApi + + , + + + com.polar.sdk.api.PolarOnlineStreamingApi + + , + + + com.polar.sdk.api.PolarSdkModeApi + +
    @@ -115,7 +133,7 @@

    Class PolarBleApi

     
     public abstract class PolarBleApi
    -
    + implements PolarOnlineStreamingApi, PolarOfflineRecordingApi, PolarH10OfflineExerciseApi, PolarSdkModeApi
                         

    Polar BLE API.

  • @@ -141,39 +159,25 @@

    Nested Class Summary

    Description - - public interface - PolarBleApi.PolarBleApiLogger - -

    Logger interface for logging events from SDK. Shall be used only for tracing and debugging purposes.

    - - - - public enum - PolarBleApi.DeviceStreamingFeature - -

    Device stream features in Polar devices. The device streaming features requires the .FEATURE_POLAR_SENSOR_STREAMING

    - - public enum - PolarBleApi.RecordingInterval + PolarBleApi.PolarBleSdkFeature -

    Recoding intervals for H10 recording start

    +

    Features available in Polar BLE SDK library

    - public enum - PolarBleApi.SampleType + public interface + PolarBleApi.PolarBleApiLogger -

    Sample types for H10 recording start

    +

    Logger interface for logging events from SDK. Shall be used only for tracing and debugging purposes.

    - public class - PolarBleApi.Companion + public enum + PolarBleApi.PolarDeviceDataType - +

    The data types available in Polar devices for online streaming or offline recording.

    @@ -200,8 +204,8 @@

    Field Summary

    - private final Integer - features + private final Set<PolarBleApi.PolarBleSdkFeature> + features @@ -231,7 +235,7 @@

    Constructor Summary

    PolarBleApi(Integer features) + href="#PolarBleApi(Set)">PolarBleApi(Set<PolarBleApi.PolarBleSdkFeature> features) @@ -285,7 +289,7 @@

    Method Summary

    - final Integer + final Set<PolarBleApi.PolarBleSdkFeature> getFeatures() @@ -297,7 +301,7 @@

    Method Summary

    setMtu(@IntRange(from = 70, to = 512) Integer mtu) - set mtu to lower than default(232 is the default for polar devices, minimum for H10 is 70 and for OH1 is 140) to minimize latency + set mtu to lower than default (232 is the default for polar devices, minimum for H10 is 70 and for OH1 is 140) to minimize latency @@ -321,13 +325,13 @@

    Method Summary

    setPolarFilter(Boolean enable) - When enabled only Polar devices are found by the . + When enabled only Polar devices are found by the searchForDevice, if set to false any BLE devices with HR services are returned by the searchForDevice. abstract Boolean - isFeatureReady(String deviceId, Integer feature) + isFeatureReady(String deviceId, PolarBleApi.PolarBleSdkFeature feature) Check if the feature is ready. @@ -335,33 +339,33 @@

    Method Summary

    abstract Unit - backgroundEntered() + foregroundEntered() - enables scan filter while on background + Optionally call when application enters to the foreground. abstract Unit - foregroundEntered() + setApiCallback(PolarBleApiCallbackProvider callback) - Optionally call when application enters to the foreground. + Sets the API callback abstract Unit - setApiCallback(PolarBleApiCallbackProvider callback) + setApiLogger(PolarBleApi.PolarBleApiLogger logger) - Sets the API callback + Sets the API logger - abstract Unit + abstract Flowable<PolarDeviceInfo> - setApiLogger(PolarBleApi.PolarBleApiLogger logger) + searchForDevice() - Sets the API logger + Starts searching for BLE devices when subscribed. @@ -373,38 +377,6 @@

    Method Summary

    - abstract Completable - - setLocalTime(String identifier, Calendar calendar) - - Set time to device affects on sensor data stream(s) timestamps requires feature . - - - - abstract Single<Calendar> - - getLocalTime(String identifier) - - Get current time in device. - - - - abstract Single<PolarSensorSetting> - - requestStreamSettings(String identifier, PolarBleApi.DeviceStreamingFeature feature) - - Request the stream settings available in current operation mode. - - - - abstract Single<PolarSensorSetting> - - requestFullStreamSettings(String identifier, PolarBleApi.DeviceStreamingFeature feature) - - Request full steam settings capabilities. - - - abstract Completable autoConnectToDevice(Integer rssiLimit, String service, Integer timeout, TimeUnit unit, String polarDeviceType) @@ -412,7 +384,7 @@

    Method Summary

    Start connecting to a nearby Polar device. - + abstract Completable autoConnectToDevice(Integer rssiLimit, String service, String polarDeviceType) @@ -420,7 +392,7 @@

    Method Summary

    - + abstract Unit connectToDevice(String identifier) @@ -428,7 +400,7 @@

    Method Summary

    Request a connection to a BLE device. - + abstract Unit disconnectFromDevice(String identifier) @@ -436,63 +408,23 @@

    Method Summary

    Request disconnecting from a BLE device. - - abstract Completable - - startRecording(String identifier, @Size(min = 1, max = 64) String exerciseId, PolarBleApi.RecordingInterval interval, PolarBleApi.SampleType type) - - Request start recording. - - - - abstract Completable - - stopRecording(String identifier) - - Request to stop recording. - - - - abstract Single<Pair<Boolean, String>> - - requestRecordingStatus(String identifier) - - Request current recording status. - - - - abstract Flowable<PolarExerciseEntry> - - listExercises(String identifier) - - List exercises stored in the device Polar H10 device. - - - - abstract Single<PolarExerciseData> - - fetchExercise(String identifier, PolarExerciseEntry entry) - - Api for fetching a single exercise from Polar H10 device. - - - + abstract Completable - removeExercise(String identifier, PolarExerciseEntry entry) + setLocalTime(String identifier, Calendar calendar) - Api for removing single exercise from Polar H10 device. + Set the device time. - - abstract Flowable<PolarDeviceInfo> + + abstract Single<Calendar> - searchForDevice() + getLocalTime(String identifier) - Starts searching for BLE devices when subscribed. + Get current time in device. - + abstract Flowable<PolarHrBroadcastData> startListenForPolarHrBroadcasts(Set<String> deviceIds) @@ -500,75 +432,17 @@

    Method Summary

    Start listening the heart rate from Polar devices when subscribed. - - abstract Flowable<PolarEcgData> - - startEcgStreaming(String identifier, PolarSensorSetting sensorSetting) - - Start the ECG (Electrocardiography) stream. - - - - abstract Flowable<PolarAccelerometerData> - - startAccStreaming(String identifier, PolarSensorSetting sensorSetting) - - Start ACC (Accelerometer) stream. - - - - abstract Flowable<PolarOhrData> - - startOhrStreaming(String identifier, PolarSensorSetting sensorSetting) - - Start OHR (Optical heart rate) PPG (Photoplethysmography) stream. - - - - abstract Flowable<PolarOhrPPIData> - - startOhrPPIStreaming(String identifier) - - Start OHR (Optical heart rate) PPI (Pulse to Pulse interval) stream. - - - - abstract Flowable<PolarMagnetometerData> - - startMagnetometerStreaming(String identifier, PolarSensorSetting sensorSetting) - - Start magnetometer stream. - - - - abstract Flowable<PolarGyroData> - - startGyroStreaming(String identifier, PolarSensorSetting sensorSetting) - - Start Gyro stream. - - - - abstract Completable - - enableSDKMode(String identifier) - - Enables SDK mode. - - - - abstract Completable - - disableSDKMode(String identifier) - - Disables SDK mode. - -
      +
    • + + +

      Methods inherited from class com.polar.sdk.api.PolarBleApi

      + disableSDKMode, enableSDKMode, fetchExercise, getAvailableOfflineRecordingDataTypes, getAvailableOnlineStreamDataTypes, getOfflineRecord, getOfflineRecordingStatus, getOfflineRecordingTriggerSetup, isSDKModeEnabled, listExercises, listOfflineRecordings, removeExercise, removeOfflineRecord, requestFullOfflineRecordingSettings, requestFullStreamSettings, requestOfflineRecordingSettings, requestRecordingStatus, requestStreamSettings, setOfflineRecordingTrigger, startAccStreaming, startEcgStreaming, startGyroStreaming, startHrStreaming, startMagnetometerStreaming, startOfflineRecording, startOhrPPIStreaming, startOhrStreaming, startPpgStreaming, startPpiStreaming, startRecording, stopOfflineRecording, stopRecording
    • +
    • @@ -595,22 +469,13 @@

      Methods inherited from class java.lang.Object

      Constructor Detail

      - + @@ -635,7 +500,7 @@

      Method Detail

      >
    • getFeatures

      -
       final Integer getFeatures()
      +
       final Set<PolarBleApi.PolarBleSdkFeature> getFeatures()
      @@ -651,7 +516,7 @@

      getFeatures

    • setMtu

       abstract Unit setMtu(@IntRange(from = 70, to = 512) Integer mtu)
      -

      set mtu to lower than default(232 is the default for polar devices, minimum for H10 is 70 and for OH1 is 140) to minimize latency

      +

      set mtu to lower than default (232 is the default for polar devices, minimum for H10 is 70 and for OH1 is 140) to minimize latency

      Parameters:
      @@ -705,7 +570,7 @@

      cleanup

    • setPolarFilter

       abstract Unit setPolarFilter(Boolean enable)
      -

      When enabled only Polar devices are found by the .searchForDevice, if set to false any BLE devices with HR services are returned by the .searchForDevice. The default setting for Polar filter is true.

      +

      When enabled only Polar devices are found by the searchForDevice, if set to false any BLE devices with HR services are returned by the searchForDevice. The default setting for Polar filter is true.

      Parameters:
      @@ -720,7 +585,7 @@

      setPolarFilter

    - + - - - -
      -
    • -

      backgroundEntered

      -
      @Deprecated(message = "in release 3.2.8. Move to the background is not relevant information for SDK starting from release 3.2.8") abstract Unit backgroundEntered()
      -

      enables scan filter while on background

      - - -
    • -
    - @@ -826,6 +676,21 @@

    setApiLogger

    + + + +
      +
    • +

      searchForDevice

      +
       abstract Flowable<PolarDeviceInfo> searchForDevice()
      +

      Starts searching for BLE devices when subscribed. Search continues as long as observable is subscribed or error. Each found device is emitted only once. By default searches only for Polar devices, but can be controlled by .setPolarFilter. If .setPolarFilter is false then searches for any BLE heart rate capable devices

      + + +
    • +
    + @@ -850,26 +715,38 @@

    setAutomaticReconnection

    - +
    • -

      setLocalTime

      -
       abstract Completable setLocalTime(String identifier, Calendar calendar)
      -

      Set time to device affects on sensor data stream(s) timestamps requires feature .FEATURE_POLAR_FILE_TRANSFER

      +

      autoConnectToDevice

      +
       abstract Completable autoConnectToDevice(Integer rssiLimit, String service, Integer timeout, TimeUnit unit, String polarDeviceType)
      +

      Start connecting to a nearby Polar device. PolarBleApiCallback.deviceConnected callback is invoked when connection to a nearby device is established.

      Parameters:
      -
      identifier - polar device id or bt address
      +
      rssiLimit - RSSI (Received Signal Strength Indication) value is typically from -40 to -60 (dBm), depends on the used Bluetooth chipset and/or antenna tuning
      -
      calendar - time to set
      +
      service - in hex string format like "180D" PolarInvalidArgument invoked if not in correct format
      + + + +
      timeout - min time to search nearby device default = 2s
      + + + +
      unit - time unit to be used
      + + + +
      polarDeviceType - like H10, OH1 etc...
      @@ -878,22 +755,37 @@

      setLocalTime

    - + + + + + +
      +
    • +

      connectToDevice

      +
       abstract Unit connectToDevice(String identifier)
      +

      Request a connection to a BLE device. Invokes PolarBleApiCallback.deviceConnected callback.

      Parameters:
      -
      identifier - polar device id or bt address
      +
      identifier - Polar device id found printed on the sensor/device (in format "12345678") or bt address (in format "00:11:22:33:44:55")
      @@ -902,26 +794,22 @@

      getLocalTime

    - +
    • -

      requestStreamSettings

      -
       abstract Single<PolarSensorSetting> requestStreamSettings(String identifier, PolarBleApi.DeviceStreamingFeature feature)
      -

      Request the stream settings available in current operation mode. This request shall be used before the stream is started to decide currently available. The available settings depend on the state of the device. For example, if any stream(s) or optical heart rate measurement is already enabled, then the device may limit the offer of possible settings for other stream feature. Requires feature .FEATURE_POLAR_SENSOR_STREAMING

      +

      disconnectFromDevice

      +
       abstract Unit disconnectFromDevice(String identifier)
      +

      Request disconnecting from a BLE device. Invokes PolarBleApiCallback.deviceDisconnected callback.

      Parameters:
      -
      identifier - polar device id or bt address
      - - - -
      feature - the stream feature of interest
      +
      identifier - Polar device id found printed on the sensor/device or bt address (in format "00:11:22:33:44:55")
      @@ -930,16 +818,16 @@

      requestStreamSettings

    - +
    • -

      requestFullStreamSettings

      -
       abstract Single<PolarSensorSetting> requestFullStreamSettings(String identifier, PolarBleApi.DeviceStreamingFeature feature)
      -

      Request full steam settings capabilities. The request returns the all capabilities of the requested streaming feature not limited by the current operation mode. Requires feature .FEATURE_POLAR_SENSOR_STREAMING. This request is supported only by Polar Verity Sense (starting from firmware 1.1.5)

      +

      setLocalTime

      +
       abstract Completable setLocalTime(String identifier, Calendar calendar)
      +

      Set the device time. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_TIME_SETUP

      Parameters:
      @@ -949,7 +837,7 @@

      requestFullStreamSettings

      -
      feature - the stream feature of interest
      +
      calendar - time to set
      @@ -958,265 +846,22 @@

      requestFullStreamSettings

    - +
    • -

      autoConnectToDevice

      -
       abstract Completable autoConnectToDevice(Integer rssiLimit, String service, Integer timeout, TimeUnit unit, String polarDeviceType)
      -

      Start connecting to a nearby Polar device. PolarBleApiCallback.deviceConnected callback is invoked when connection to a nearby device is established.

      +

      getLocalTime

      +
       abstract Single<Calendar> getLocalTime(String identifier)
      +

      Get current time in device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_TIME_SETUP. Note, the H10 is not supporting time read.

      Parameters:
      -
      rssiLimit - RSSI (Received Signal Strength Indication) value is typically from -40 to -60 (dBm), depends on the used Bluetooth chipset and/or antenna tuning
      - - - -
      service - in hex string format like "180D" PolarInvalidArgument invoked if not in correct format
      - - - -
      timeout - min time to search nearby device default = 2s
      - - - -
      unit - time unit to be used
      - - - -
      polarDeviceType - like H10, OH1 etc...
      - - -
      - - -
    • -
    - - - - - - - - - -
      -
    • -

      connectToDevice

      -
       abstract Unit connectToDevice(String identifier)
      -

      Request a connection to a BLE device. Invokes PolarBleApiCallback.deviceConnected callback.

      - -
      -
      Parameters:
      - - -
      identifier - Polar device id found printed on the sensor/device (in format "12345678") or bt address (in format "00:11:22:33:44:55")
      - - -
      - - -
    • -
    - - - - - - - - - -
      -
    • -

      startRecording

      -
       abstract Completable startRecording(String identifier, @Size(min = 1, max = 64) String exerciseId, PolarBleApi.RecordingInterval interval, PolarBleApi.SampleType type)
      -

      Request start recording. Supported only by Polar H10. Requires feature .FEATURE_POLAR_FILE_TRANSFER

      - -
      -
      Parameters:
      - - -
      identifier - polar device id or bt address
      - - - -
      exerciseId - unique id for exercise entry
      - - - -
      interval - recording interval to be used, parameter has no effect if the type parameter is SampleType.
      - - - -
      type - sample type to be used
      - - -
      - - -
    • -
    - - - - -
      -
    • -

      stopRecording

      -
       abstract Completable stopRecording(String identifier)
      -

      Request to stop recording. Supported only by Polar H10. Requires feature .FEATURE_POLAR_FILE_TRANSFER

      - -
      -
      Parameters:
      - - -
      identifier - polar device id or bt address
      - - -
      - - -
    • -
    - - - - -
      -
    • -

      requestRecordingStatus

      -
       abstract Single<Pair<Boolean, String>> requestRecordingStatus(String identifier)
      -

      Request current recording status. Supported only by Polar H10. Requires feature .FEATURE_POLAR_FILE_TRANSFER

      - -
      -
      Parameters:
      - - -
      identifier - polar device id or bt address
      - - -
      - - -
    • -
    - - - - -
      -
    • -

      listExercises

      -
       abstract Flowable<PolarExerciseEntry> listExercises(String identifier)
      -

      List exercises stored in the device Polar H10 device. Requires feature .FEATURE_POLAR_FILE_TRANSFER. This API is working for Polar OH1 and Polar Verity Sense devices too, however in those devices recording of exercise requires that sensor is registered to Polar Flow account.

      - -
      -
      Parameters:
      - - -
      identifier - Polar device id found printed on the sensor/device or bt address
      - - -
      - - -
    • -
    - - - - -
      -
    • -

      fetchExercise

      -
       abstract Single<PolarExerciseData> fetchExercise(String identifier, PolarExerciseEntry entry)
      -

      Api for fetching a single exercise from Polar H10 device. Requires feature .FEATURE_POLAR_FILE_TRANSFER. This API is working for Polar OH1 and Polar Verity Sense devices too, however in those devices recording of exercise requires that sensor is registered to Polar Flow account.

      - -
      -
      Parameters:
      - - -
      identifier - Polar device id found printed on the sensor/device or bt address
      - - - -
      entry - PolarExerciseEntry object
      - - -
      - - -
    • -
    - - - - -
      -
    • -

      removeExercise

      -
       abstract Completable removeExercise(String identifier, PolarExerciseEntry entry)
      -

      Api for removing single exercise from Polar H10 device. Requires feature .FEATURE_POLAR_FILE_TRANSFER. This API is working for Polar OH1 and Polar Verity Sense devices too, however in those devices recording of exercise requires that sensor is registered to Polar Flow account.

      - -
      -
      Parameters:
      - - -
      identifier - Polar device id found printed on the sensor/device or bt address
      - - - -
      entry - entry to be removed
      +
      identifier - polar device id or bt address
      @@ -1225,31 +870,16 @@

      removeExercise

    - - - -
      -
    • -

      searchForDevice

      -
       abstract Flowable<PolarDeviceInfo> searchForDevice()
      -

      Starts searching for BLE devices when subscribed. Search continues as long as observable is subscribed or error. Each found device is emitted only once. By default searches only for Polar devices, but can be controlled by .setPolarFilter. If .setPolarFilter is false then searches for any BLE heart rate capable devices

      - - -
    • -
    -
    • startListenForPolarHrBroadcasts

       abstract Flowable<PolarHrBroadcastData> startListenForPolarHrBroadcasts(Set<String> deviceIds)
      -

      Start listening the heart rate from Polar devices when subscribed. This observable listens BLE broadcast and parses heart rate from BLE broadcast. The BLE device is not connected when using this function.

      +

      Start listening the heart rate from Polar devices when subscribed. This observable listens BLE broadcast and parses heart rate from BLE broadcast. The BLE device don't need to be connected when using this function, the heart rate is parsed from the BLE advertisement

      Parameters:
      @@ -1264,218 +894,6 @@

      startListenForPolarHrBroadcasts

    - - - -
      -
    • -

      startEcgStreaming

      -
       abstract Flowable<PolarEcgData> startEcgStreaming(String identifier, PolarSensorSetting sensorSetting)
      -

      Start the ECG (Electrocardiography) stream. ECG stream is stopped if the connection is closed, error occurs or stream is disposed. Requires feature .FEATURE_POLAR_SENSOR_STREAMING. Before starting the stream it is recommended to query the available settings using .requestStreamSettings

      - -
      -
      Parameters:
      - - -
      identifier - Polar device id found printed on the sensor/device or bt address
      - - - -
      sensorSetting - settings to be used to start streaming
      - - -
      - - -
    • -
    - - - - -
      -
    • -

      startAccStreaming

      -
       abstract Flowable<PolarAccelerometerData> startAccStreaming(String identifier, PolarSensorSetting sensorSetting)
      -

      Start ACC (Accelerometer) stream. ACC stream is stopped if the connection is closed, error occurs or stream is disposed. Requires feature .FEATURE_POLAR_SENSOR_STREAMING. Before starting the stream it is recommended to query the available settings using .requestStreamSettings

      - -
      -
      Parameters:
      - - -
      identifier - Polar device id found printed on the sensor/device or bt address
      - - - -
      sensorSetting - settings to be used to start streaming
      - - -
      - - -
    • -
    - - - - -
      -
    • -

      startOhrStreaming

      -
       abstract Flowable<PolarOhrData> startOhrStreaming(String identifier, PolarSensorSetting sensorSetting)
      -

      Start OHR (Optical heart rate) PPG (Photoplethysmography) stream. PPG stream is stopped if the connection is closed, error occurs or stream is disposed. Requires feature .FEATURE_POLAR_SENSOR_STREAMING. Before starting the stream it is recommended to query the available settings using .requestStreamSettings

      - -
      -
      Parameters:
      - - -
      identifier - Polar device id found printed on the sensor/device or bt address
      - - - -
      sensorSetting - settings to be used to start streaming
      - - -
      - - -
    • -
    - - - - -
      -
    • -

      startOhrPPIStreaming

      -
       abstract Flowable<PolarOhrPPIData> startOhrPPIStreaming(String identifier)
      -

      Start OHR (Optical heart rate) PPI (Pulse to Pulse interval) stream. PPI stream is stopped if the connection is closed, error occurs or stream is disposed. Notice that there is a delay before PPI data stream starts. Requires feature .FEATURE_POLAR_SENSOR_STREAMING.

      - -
      -
      Parameters:
      - - -
      identifier - Polar device id found printed on the sensor/device or bt address
      - - -
      - - -
    • -
    - - - - -
      -
    • -

      startMagnetometerStreaming

      -
       abstract Flowable<PolarMagnetometerData> startMagnetometerStreaming(String identifier, PolarSensorSetting sensorSetting)
      -

      Start magnetometer stream. Magnetometer stream is stopped if the connection is closed, error occurs or stream is disposed. Requires feature .FEATURE_POLAR_SENSOR_STREAMING. Before starting the stream it is recommended to query the available settings using .requestStreamSettings

      - -
      -
      Parameters:
      - - -
      identifier - Polar device id found printed on the sensor/device or bt address
      - - - -
      sensorSetting - settings to be used to start streaming
      - - -
      - - -
    • -
    - - - - -
      -
    • -

      startGyroStreaming

      -
       abstract Flowable<PolarGyroData> startGyroStreaming(String identifier, PolarSensorSetting sensorSetting)
      -

      Start Gyro stream. Gyro stream is stopped if the connection is closed, error occurs during start or stream is disposed. Requires feature .FEATURE_POLAR_SENSOR_STREAMING. Before starting the stream it is recommended to query the available settings using .requestStreamSettings

      - -
      -
      Parameters:
      - - -
      identifier - Polar device id found printed on the sensor/device or bt address
      - - - -
      sensorSetting - settings to be used to start streaming
      - - -
      - - -
    • -
    - - - - -
      -
    • -

      enableSDKMode

      -
       abstract Completable enableSDKMode(String identifier)
      -

      Enables SDK mode. In SDK mode the wider range of capabilities is available for the stream than in normal operation mode. SDK mode is only supported by Polar Verity Sense (starting from firmware 1.1.5). Requires feature .FEATURE_POLAR_SENSOR_STREAMING.

      - -
      -
      Parameters:
      - - -
      identifier - Polar device id found printed on the sensor/device or bt address
      - - -
      - - -
    • -
    - - - - -
      -
    • -

      disableSDKMode

      -
       abstract Completable disableSDKMode(String identifier)
      -

      Disables SDK mode. SDK mode is only supported by Polar Verity Sense (starting from firmware 1.1.5). Requires feature .FEATURE_POLAR_SENSOR_STREAMING.

      - -
      -
      Parameters:
      - - -
      identifier - Polar device id found printed on the sensor/device or bt address
      - - -
      - - -
    • -
    - diff --git a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApiCallback.html b/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApiCallback.html index e4f3cbf3..8c0b613d 100644 --- a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApiCallback.html +++ b/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApiCallback.html @@ -251,7 +251,7 @@

    Method Summary

    blePowerStateChanged(Boolean powered) - + Bluetooth power state of the device where this SDK is running @@ -275,18 +275,26 @@

    Method Summary

    deviceDisconnected(PolarDeviceInfo polarDeviceInfo) - Device is now disconnected, no further action is needed from the application if polar.com.sdk.api.PolarBleApi#disconnectFromPolarDevice is not called. + Device is now disconnected Unit - streamingFeaturesReady(String identifier, Set<PolarBleApi.DeviceStreamingFeature> features) + bleSdkFeatureReady(String identifier, PolarBleApi.PolarBleSdkFeature feature) - Polar device's streaming features ready. + Called when the feature in connected device is available and it is ready. + Unit + + streamingFeaturesReady(String identifier, Set<PolarBleApi.PolarDeviceDataType> features) + + Polar device's streaming features ready. + + + Unit sdkModeFeatureAvailable(String identifier) @@ -294,7 +302,7 @@

    Method Summary

    Polar SDK Mode feature is available in the device. - + Unit hrFeatureReady(String identifier) @@ -302,31 +310,31 @@

    Method Summary

    Polar device HR client is now ready and HR transmission is starting in a moment. - + Unit disInformationReceived(String identifier, UUID uuid, String value) - DIS information received requires feature PolarBleApi#FEATURE_DEVICE_INFO + DIS information received. - + Unit batteryLevelReceived(String identifier, Integer level) - Battery level received requires feature PolarBleApi#FEATURE_BATTERY_INFO + Battery level received. - + Unit - hrNotificationReceived(String identifier, PolarHrData data) + hrNotificationReceived(String identifier, PolarHrData.PolarHrSample data) HR notification data received from device. - + Unit polarFtpFeatureReady(String identifier) @@ -397,7 +405,7 @@

    Method Detail

  • blePowerStateChanged

     Unit blePowerStateChanged(Boolean powered)
    -
    +

    Bluetooth power state of the device where this SDK is running

    Parameters:
    @@ -469,7 +477,7 @@

    deviceConnecting

  • deviceDisconnected

     Unit deviceDisconnected(PolarDeviceInfo polarDeviceInfo)
    -

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

    +

    Device is now disconnected

    Parameters:
    @@ -484,6 +492,34 @@

    deviceDisconnected

  • + + + +
      +
    • +

      bleSdkFeatureReady

      +
       Unit bleSdkFeatureReady(String identifier, PolarBleApi.PolarBleSdkFeature feature)
      +

      Called when the feature in connected device is available and it is ready. Called only for the features which are specified by PolarBleApi instantiation.

      + +
      +
      Parameters:
      + + +
      identifier - Polar device id
      + + + +
      feature - feature is ready
      + + +
      + + +
    • +
    + @@ -492,8 +528,8 @@

    deviceDisconnected

    >
  • streamingFeaturesReady

    -
     Unit streamingFeaturesReady(String identifier, Set<PolarBleApi.DeviceStreamingFeature> features)
    -

    Polar device's streaming features ready. Application may start any stream now if desired. Requires feature PolarBleApi.FEATURE_POLAR_SENSOR_STREAMING to be enabled for the Polar SDK instance.

    +
    @Deprecated(message = "The functionality has changed. Please use the bleSdkFeatureReady to know if onlineStreaming is available and the getAvailableOnlineStreamDataTypes function know which data types are supported") Unit streamingFeaturesReady(String identifier, Set<PolarBleApi.PolarDeviceDataType> features)
    +

    Polar device's streaming features ready. Application may start any stream now if desired. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_ONLINE_STREAMING to be enabled for the Polar SDK instance.

    Parameters:
    @@ -520,8 +556,8 @@

    streamingFeaturesReady

    >
  • sdkModeFeatureAvailable

    -
     Unit sdkModeFeatureAvailable(String identifier)
    -

    Polar SDK Mode feature is available in the device. Application may now enter to SDK mode. Requires feature PolarBleApi#FEATURE_POLAR_SENSOR_STREAMING

    +
    @Deprecated(message = "Information whether SDK Mode is available is provided by bleSdkFeatureReady") Unit sdkModeFeatureAvailable(String identifier)
    +

    Polar SDK Mode feature is available in the device. Application may now enter to SDK mode. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_SDK_MODE

    Parameters:
    @@ -544,7 +580,7 @@

    sdkModeFeatureAvailable

    >
  • hrFeatureReady

    -
     Unit hrFeatureReady(String identifier)
    +
    @Deprecated(message = "Information whether HR feature is available is provided by bleSdkFeatureReady") Unit hrFeatureReady(String identifier)

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

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

    hrFeatureReady

  • disInformationReceived

     Unit disInformationReceived(String identifier, UUID uuid, String value)
    -

    DIS information received requires feature PolarBleApi#FEATURE_DEVICE_INFO

    +

    DIS information received. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_DEVICE_INFO

    Parameters:
    @@ -601,7 +637,7 @@

    disInformationReceived

  • batteryLevelReceived

     Unit batteryLevelReceived(String identifier, Integer level)
    -

    Battery level received requires feature PolarBleApi#FEATURE_BATTERY_INFO

    +

    Battery level received. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_BATTERY_INFO

    Parameters:
    @@ -620,7 +656,7 @@

    batteryLevelReceived

  • - + + + + +
      +
    • +

      bleSdkFeatureReady

      +
       abstract Unit bleSdkFeatureReady(String identifier, PolarBleApi.PolarBleSdkFeature feature)
      +

      The feature is available in this device and it is ready. Called only for the features which are specified in PolarBleApi construction.

      + +
      +
      Parameters:
      + + +
      identifier - Polar device id
      + + + +
      feature - feature is ready
      + + +
      + + +
    • +
    + @@ -473,8 +509,8 @@

    deviceDisconnected

    >
  • streamingFeaturesReady

    -
     abstract Unit streamingFeaturesReady(String identifier, Set<PolarBleApi.DeviceStreamingFeature> features)
    -

    Polar device's streaming features ready. Application may start any stream now if desired. Requires feature PolarBleApi#FEATURE_POLAR_SENSOR_STREAMING

    +
    @Deprecated(message = "The function is renamed. Please use the getAvailableOnlineStreamDataTypes function") abstract Unit streamingFeaturesReady(String identifier, Set<PolarBleApi.PolarDeviceDataType> features)
    +

    Polar device's streaming features ready. Application may start any stream now if desired. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_ONLINE_STREAMING to be enabled for the Polar SDK instance.

    Parameters:
    @@ -501,8 +537,8 @@

    streamingFeaturesReady

    >
  • sdkModeFeatureAvailable

    -
     abstract Unit sdkModeFeatureAvailable(String identifier)
    -

    Polar SDK Mode feature is available in the device. Application may now enter to SDK mode. Requires feature PolarBleApi#FEATURE_POLAR_SENSOR_STREAMING

    +
    @Deprecated(message = "Information whether SDK Mode is available is provided by bleSdkFeatureReady") abstract Unit sdkModeFeatureAvailable(String identifier)
    +

    Polar SDK Mode feature is available in the device. Application may now enter to SDK mode. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_SDK_MODE

    Parameters:
    @@ -525,7 +561,7 @@

    sdkModeFeatureAvailable

    >
  • hrFeatureReady

    -
     abstract Unit hrFeatureReady(String identifier)
    +
    @Deprecated(message = "Information whether HR feature is available is provided by bleSdkFeatureReady") abstract Unit hrFeatureReady(String identifier)

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

    @@ -550,7 +586,7 @@

    hrFeatureReady

  • disInformationReceived

     abstract Unit disInformationReceived(String identifier, UUID uuid, String value)
    -

    DIS information received requires feature PolarBleApi#FEATURE_DEVICE_INFO

    +

    DIS information received. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_DEVICE_INFO

    Parameters:
    @@ -582,7 +618,7 @@

    disInformationReceived

  • batteryLevelReceived

     abstract Unit batteryLevelReceived(String identifier, Integer level)
    -

    Battery level received requires feature PolarBleApi#FEATURE_BATTERY_INFO

    +

    Battery level received. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_BATTERY_INFO

    Parameters:
    @@ -601,7 +637,7 @@

    batteryLevelReceived

  • - +
      batteryLevelReceived >
    • hrNotificationReceived

      -
       abstract Unit hrNotificationReceived(String identifier, PolarHrData data)
      +
      @Deprecated(message = "Please use the startHrStreaming API to get the heart rate data ") abstract Unit hrNotificationReceived(String identifier, PolarHrData.PolarHrSample data)

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

      @@ -637,7 +673,7 @@

      hrNotificationReceived

      >
    • polarFtpFeatureReady

      -
       abstract Unit polarFtpFeatureReady(String identifier)
      +
      @Deprecated(message = "Not supported anymore, won't be ever called. Use the bleSdkFeatureReady") abstract Unit polarFtpFeatureReady(String identifier)

      File transfer ready requires feature PolarBleApi#FEATURE_POLAR_FILE_TRANSFER

      diff --git a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApiDefaultImpl.html b/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApiDefaultImpl.html index a5f5230e..81474637 100644 --- a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApiDefaultImpl.html +++ b/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApiDefaultImpl.html @@ -244,9 +244,9 @@

      Method Summary

      - final static PolarBleApi + final static BDBleApiImpl - defaultImplementation(Context context, Integer features) + defaultImplementation(Context context, Set<PolarBleApi.PolarBleSdkFeature> features) Default implementation constructor for the API. @@ -303,7 +303,7 @@

      Constructor Detail

      Method Detail

      - +
        Method Detail >
      • defaultImplementation

        -
         final static PolarBleApi defaultImplementation(Context context, Integer features)
        +
         final static BDBleApiImpl defaultImplementation(Context context, Set<PolarBleApi.PolarBleSdkFeature> features)

        Default implementation constructor for the API.

        diff --git a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.RecordingInterval.html b/polar-sdk-android/docs/com/polar/sdk/api/PolarH10OfflineExerciseApi.RecordingInterval.html similarity index 93% rename from polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.RecordingInterval.html rename to polar-sdk-android/docs/com/polar/sdk/api/PolarH10OfflineExerciseApi.RecordingInterval.html index 1049bba3..cd508000 100644 --- a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.RecordingInterval.html +++ b/polar-sdk-android/docs/com/polar/sdk/api/PolarH10OfflineExerciseApi.RecordingInterval.html @@ -89,7 +89,7 @@
        Package 
        -

        Enum PolarBleApi.RecordingInterval

        +

        Enum PolarH10OfflineExerciseApi.RecordingInterval

        @@ -366,7 +366,7 @@

        getValue

        >
      • getName

        -
         final String getName()
        +
         final String getName()
        @@ -381,7 +381,7 @@

        getName

        >
      • getOrdinal

        -
         final Integer getOrdinal()
        +
         final Integer getOrdinal()
        diff --git a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.SampleType.html b/polar-sdk-android/docs/com/polar/sdk/api/PolarH10OfflineExerciseApi.SampleType.html similarity index 95% rename from polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.SampleType.html rename to polar-sdk-android/docs/com/polar/sdk/api/PolarH10OfflineExerciseApi.SampleType.html index 460f6d01..ffe2ceb9 100644 --- a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.SampleType.html +++ b/polar-sdk-android/docs/com/polar/sdk/api/PolarH10OfflineExerciseApi.SampleType.html @@ -89,7 +89,7 @@
        Package 
        -

        Enum PolarBleApi.SampleType

        +

        Enum PolarH10OfflineExerciseApi.SampleType

        @@ -352,7 +352,7 @@

        getName

        >
      • getOrdinal

        -
         final Integer getOrdinal()
        +
         final Integer getOrdinal()
        diff --git a/polar-sdk-android/docs/com/polar/sdk/api/PolarH10OfflineExerciseApi.html b/polar-sdk-android/docs/com/polar/sdk/api/PolarH10OfflineExerciseApi.html new file mode 100644 index 00000000..472551e7 --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/PolarH10OfflineExerciseApi.html @@ -0,0 +1,573 @@ + + + + PolarH10OfflineExerciseApi + + + + + + + + + + + + + + + + + +
        + +
        + +
        +
        +
        Package 
        +

        Interface PolarH10OfflineExerciseApi

        +
        +
        + +
        +
          +
        • + +
          +
          All Implemented Interfaces:
          +
          + +
          +
          + +
          +
          +
          +public interface PolarH10OfflineExerciseApi
          +
          +                    
          +

          H10 Exercise recording API.

          H10 Exercise recording makes it possible to record Hr or Rr data to H10 device memory. With H10 Exercise recording the H10 and phone don't need to be connected all the time, as H10 exercise recording continues in Polar device even the BLE disconnects.

          Requires features PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_H10_EXERCISE_RECORDING

          Note, API is working only with Polar H10 device

          +
        • +
        +
        +
        + +
        +
        +
          +
        • + + +
          +
            +
          • + + +

            Constructor Detail

            + +
          • +
          +
          + + + +
          +
            +
          • + + +

            Method Detail

            + + + + + + + + + +
              +
            • +

              stopRecording

              +
               abstract Completable stopRecording(String identifier)
              +

              Request to stop recording.

              + +
              +
              Parameters:
              + + +
              identifier - polar device id or bt address
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              requestRecordingStatus

              +
               abstract Single<Pair<Boolean, String>> requestRecordingStatus(String identifier)
              +

              Request current recording status.

              + +
              +
              Parameters:
              + + +
              identifier - polar device id or bt address
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              listExercises

              +
               abstract Flowable<PolarExerciseEntry> listExercises(String identifier)
              +

              List exercises stored in the device Polar H10 device.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + +
              + + +
            • +
            + + + + + + + + + +
              +
            • +

              removeExercise

              +
               abstract Completable removeExercise(String identifier, PolarExerciseEntry entry)
              +

              Api for removing single exercise from Polar H10 device.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + + +
              entry - entry to be removed
              + + +
              + + +
            • +
            + +
          • +
          +
          + +
        • +
        +
        +
        +
        + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/PolarOfflineRecordingApi.html b/polar-sdk-android/docs/com/polar/sdk/api/PolarOfflineRecordingApi.html new file mode 100644 index 00000000..b189fd2e --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/PolarOfflineRecordingApi.html @@ -0,0 +1,743 @@ + + + + PolarOfflineRecordingApi + + + + + + + + + + + + + + + + + +
        + +
        + +
        +
        +
        Package 
        +

        Interface PolarOfflineRecordingApi

        +
        +
        + +
        + +
        +
        + +
        +
        +
          +
        • + + +
          +
            +
          • + + +

            Constructor Detail

            + +
          • +
          +
          + + + +
          +
            +
          • + + +

            Method Detail

            + + + + + + + + + +
              +
            • +

              requestOfflineRecordingSettings

              +
               abstract Single<PolarSensorSetting> requestOfflineRecordingSettings(String identifier, PolarBleApi.PolarDeviceDataType feature)
              +

              Request the offline recording settings available in current operation mode. This request shall be used before the offline recording is started to decide currently available settings. The available settings depend on the state of the device.

              + +
              +
              Parameters:
              + + +
              identifier - polar device id or bt address
              + + + +
              feature - the stream feature of interest
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              requestFullOfflineRecordingSettings

              +
               abstract Single<PolarSensorSetting> requestFullOfflineRecordingSettings(String identifier, PolarBleApi.PolarDeviceDataType feature)
              +

              Request all the settings available in the device. The request returns the all capabilities of the requested streaming feature not limited by the current operation mode.

              + +
              +
              Parameters:
              + + +
              identifier - polar device id or bt address
              + + + +
              feature - the stream feature of interest
              + + +
              + + +
            • +
            + + + + + + + + + +
              +
            • +

              listOfflineRecordings

              +
               abstract Flowable<PolarOfflineRecordingEntry> listOfflineRecordings(String identifier)
              +

              List offline recordings stored in the device.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + +
              + + +
            • +
            + + + + + + + + + +
              +
            • +

              removeOfflineRecord

              +
               abstract Completable removeOfflineRecord(String identifier, PolarOfflineRecordingEntry entry)
              +

              Removes offline recording from the device

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + + +
              entry - entry to be removed
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              startOfflineRecording

              +
               abstract Completable startOfflineRecording(String identifier, PolarBleApi.PolarDeviceDataType feature, PolarSensorSetting settings, PolarRecordingSecret secret)
              +

              Start offline recording.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + + +
              feature - the feature to be started
              + + + +
              settings - settings for the started offline recording.
              + + + +
              secret - if the secret is provided the offline recordings are encrypted in device
              + + +
              + + +
            • +
            + + + + + + + + + +
              +
            • +

              setOfflineRecordingTrigger

              +
               abstract Completable setOfflineRecordingTrigger(String identifier, PolarOfflineRecordingTrigger trigger, PolarRecordingSecret secret)
              +

              Sets the offline recording triggers for a given Polar device. The offline recording can be started automatically in the device by setting the triggers. The changes to the trigger settings will take effect on the next device startup.

              Automatically started offline recording can be stopped by stopOfflineRecording. Also if user switches off the device power, the offline recording is stopped but starts again once power is switched on and the trigger event happens.

              Trigger functionality can be disabled by setting PolarOfflineRecordingTriggerMode.TRIGGER_DISABLED, the already running offline recording is not stopped by disable.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + + +
              trigger - the type of trigger
              + + + +
              secret - if the secret is provided the offline recordings are encrypted in deviceProduces: <BR></BR> - onComplete offline recording trigger set successfully <BR></BR> - onError offline recording trigger set failed.
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              getOfflineRecordingTriggerSetup

              +
               abstract Single<PolarOfflineRecordingTrigger> getOfflineRecordingTriggerSetup(String identifier)
              +

              Retrieves the current offline recording trigger setup in the device.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt addressProduces: <BR></BR> - onSuccess the offline recording trigger setup in the device <BR></BR> - onError fetch recording request failed
              + + +
              + + +
            • +
            + +
          • +
          +
          + +
        • +
        +
        +
        +
        + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/PolarOnlineStreamingApi.html b/polar-sdk-android/docs/com/polar/sdk/api/PolarOnlineStreamingApi.html new file mode 100644 index 00000000..13a5bfdf --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/PolarOnlineStreamingApi.html @@ -0,0 +1,754 @@ + + + + PolarOnlineStreamingApi + + + + + + + + + + + + + + + + + +
        + +
        + +
        +
        +
        Package 
        +

        Interface PolarOnlineStreamingApi

        +
        +
        + +
        +
          +
        • + +
          +
          All Implemented Interfaces:
          +
          + +
          +
          + +
          +
          +
          +public interface PolarOnlineStreamingApi
          +
          +                    
          +

          Online steaming API.

          Online streaming makes it possible to stream live online data from Polar device.

          Requires features FEATURE_POLAR_ONLINE_STREAMING

          Note, online streaming is supported by VeritySense, H10 and OH1 devices

          +
        • +
        +
        +
        + +
        +
        +
          +
        • + + +
          +
            +
          • + + +

            Constructor Detail

            + +
          • +
          +
          + + + +
          +
            +
          • + + +

            Method Detail

            + + + + + + + + + +
              +
            • +

              requestStreamSettings

              +
               abstract Single<PolarSensorSetting> requestStreamSettings(String identifier, PolarBleApi.PolarDeviceDataType feature)
              +

              Request the online stream settings available in current operation mode. This request shall be used before the stream is started to decide currently available settings. The available settings depend on the state of the device. For example, if any stream(s) or optical heart rate measurement is already enabled, then the device may limit the offer of possible settings for other stream feature.

              + +
              +
              Parameters:
              + + +
              identifier - polar device id or bt address
              + + + +
              feature - the stream feature of interest
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              requestFullStreamSettings

              +
               abstract Single<PolarSensorSetting> requestFullStreamSettings(String identifier, PolarBleApi.PolarDeviceDataType feature)
              +

              Request the settings available in the device. The request returns the all capabilities of the requested streaming feature not limited by the current operation mode.

              Note, This request is supported only by Polar Verity Sense (starting from firmware 1.1.5)

              + +
              +
              Parameters:
              + + +
              identifier - polar device id or bt address
              + + + +
              feature - the stream feature of interest
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              startHrStreaming

              +
               abstract Flowable<PolarHrData> startHrStreaming(String identifier)
              +

              Start heart rate stream. Heart rate stream is stopped if the connection is closed, error occurs or stream is disposed.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              startEcgStreaming

              +
               abstract Flowable<PolarEcgData> startEcgStreaming(String identifier, PolarSensorSetting sensorSetting)
              +

              Start the ECG (Electrocardiography) stream. ECG stream is stopped if the connection is closed, error occurs or stream is disposed.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + + +
              sensorSetting - settings to be used to start streaming
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              startAccStreaming

              +
               abstract Flowable<PolarAccelerometerData> startAccStreaming(String identifier, PolarSensorSetting sensorSetting)
              +

              Start ACC (Accelerometer) stream. ACC stream is stopped if the connection is closed, error occurs or stream is disposed.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + + +
              sensorSetting - settings to be used to start streaming
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              startOhrStreaming

              +
              @Deprecated(message = "API is renamed, please use startPpgStreaming()", replaceWith = @ReplaceWith(imports = {}, expression = "startPpgStreaming")) abstract Flowable<PolarOhrData> startOhrStreaming(String identifier, PolarSensorSetting sensorSetting)
              +

              Start OHR (Optical heart rate) PPG (Photoplethysmography) stream. PPG stream is stopped if the connection is closed, error occurs or stream is disposed.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + + +
              sensorSetting - settings to be used to start streaming
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              startPpgStreaming

              +
               abstract Flowable<PolarPpgData> startPpgStreaming(String identifier, PolarSensorSetting sensorSetting)
              +

              Start optical sensor PPG (Photoplethysmography) stream. PPG stream is stopped if the connection is closed, error occurs or stream is disposed.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + + +
              sensorSetting - settings to be used to start streaming
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              startPpiStreaming

              +
               abstract Flowable<PolarPpiData> startPpiStreaming(String identifier)
              +

              Start PPI (Pulse to Pulse interval) stream. PPI stream is stopped if the connection is closed, error occurs or stream is disposed. Notice that there is a delay before PPI data stream starts.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + +
              + + +
            • +
            + + + + + + + + + +
              +
            • +

              startMagnetometerStreaming

              +
               abstract Flowable<PolarMagnetometerData> startMagnetometerStreaming(String identifier, PolarSensorSetting sensorSetting)
              +

              Start magnetometer stream. Magnetometer stream is stopped if the connection is closed, error occurs or stream is disposed.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + + +
              sensorSetting - settings to be used to start streaming
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              startGyroStreaming

              +
               abstract Flowable<PolarGyroData> startGyroStreaming(String identifier, PolarSensorSetting sensorSetting)
              +

              Start Gyro stream. Gyro stream is stopped if the connection is closed, error occurs during start or stream is disposed.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + + +
              sensorSetting - settings to be used to start streaming
              + + +
              + + +
            • +
            + +
          • +
          +
          + +
        • +
        +
        +
        +
        + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/PolarSdkModeApi.html b/polar-sdk-android/docs/com/polar/sdk/api/PolarSdkModeApi.html new file mode 100644 index 00000000..19b51901 --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/PolarSdkModeApi.html @@ -0,0 +1,443 @@ + + + + PolarSdkModeApi + + + + + + + + + + + + + + + + + +
        + +
        + +
        +
        +
        Package 
        +

        Interface PolarSdkModeApi

        +
        +
        + +
        + +
        +
        +
          +
        • + + +
          +
            +
          • + + +

            Nested Class Summary

            +
            + + + + + + + + +
            Nested Classes 
            Modifier and TypeClassDescription
            +
            +
          • +
          +
          + + + +
          +
            +
          • + + +

            Field Summary

            +
            + + + + + + + + +
            Fields 
            Modifier and TypeFieldDescription
            +
            +
          • +
          +
          + + + +
          +
            +
          • + + +

            Constructor Summary

            +
            + + + + + + + + + + + +
            Constructors 
            ConstructorDescription
            +
            +
          • +
          +
          + + + +
          +
            +
          • + + +

            Enum Constant Summary

            + + + + + + + +
            Enum Constants 
            Enum ConstantDescription
            +
          • +
          +
          + + + +
          +
            +
          • + + +

            Method Summary

            +
            +
            + + +
            +
            + + + + + + + + + + + + + + + + + + + + + + + + + + +
            Modifier and TypeMethodDescription
            abstract Completable + enableSDKMode(String identifier) + Enables SDK mode.
            abstract Completable + disableSDKMode(String identifier) + Disables SDK mode.
            abstract Single<Boolean> + isSDKModeEnabled(String identifier) + Check if SDK mode currently enabled.
            +
            +
              + +
            • + + +

              Methods inherited from class java.lang.Object

              + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
            • +
            +
          • +
          +
          + +
        • +
        +
        +
        +
          +
        • + + +
          +
            +
          • + + +

            Constructor Detail

            + +
          • +
          +
          + + + +
          +
            +
          • + + +

            Method Detail

            + + + + +
              +
            • +

              enableSDKMode

              +
               abstract Completable enableSDKMode(String identifier)
              +

              Enables SDK mode.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              disableSDKMode

              +
               abstract Completable disableSDKMode(String identifier)
              +

              Disables SDK mode.

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + +
              + + +
            • +
            + + + + +
              +
            • +

              isSDKModeEnabled

              +
               abstract Single<Boolean> isSDKModeEnabled(String identifier)
              +

              Check if SDK mode currently enabled.

              Note, SDK status check is supported by VeritySense starting from firmware 2.1.0

              + +
              +
              Parameters:
              + + +
              identifier - Polar device id found printed on the sensor/device or bt address
              + + +
              + + +
            • +
            + +
          • +
          +
          + +
        • +
        +
        +
        +
        + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/errors/PolarOfflineRecordingError.html b/polar-sdk-android/docs/com/polar/sdk/api/errors/PolarOfflineRecordingError.html new file mode 100644 index 00000000..c7aaa224 --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/errors/PolarOfflineRecordingError.html @@ -0,0 +1,430 @@ + + + + PolarOfflineRecordingError + + + + + + + + + + + + + + + + + +
        + +
        + +
        +
        +
        Package 
        +

        Class PolarOfflineRecordingError

        +
        +
        + +
        +
          +
        • + +
          +
          All Implemented Interfaces:
          +
          + + java.io.Serializable + + +
          +
          + +
          +
          +
          +public final class PolarOfflineRecordingError
          +extends Exception
          +                    
          +

          Offline recording general error

          +
        • +
        +
        +
        +
          +
        • + + +
          +
            +
          • + + +

            Nested Class Summary

            +
            + + + + + + + + +
            Nested Classes 
            Modifier and TypeClassDescription
            +
            +
          • +
          +
          + + + +
          +
            +
          • + + +

            Field Summary

            +
            + + + + + + + + + + + + + + + + + + + + +
            Fields 
            Modifier and TypeFieldDescription
            private final Throwablecause
            private final Stringmessage
            +
            +
          • +
          +
          + + + +
          + +
          + + + +
          +
            +
          • + + +

            Enum Constant Summary

            + + + + + + + +
            Enum Constants 
            Enum ConstantDescription
            +
          • +
          +
          + + + +
          +
            +
          • + + +

            Method Summary

            +
            +
            + + +
            +
            + + + + + + + + + + + + + + + + + + + + +
            Modifier and TypeMethodDescription
            Throwable + getCause() +
            String + getMessage() +
            +
            +
              + +
            • + + +

              Methods inherited from class java.lang.Exception

              + addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
            • + +
            • + + +

              Methods inherited from class java.lang.Object

              + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
            • +
            +
          • +
          +
          + +
        • +
        +
        +
        +
          +
        • + + +
          +
            +
          • + + +

            Constructor Detail

            + + +
              +
            • +

              PolarOfflineRecordingError

              +
              PolarOfflineRecordingError(String detailMessage)
              +
              + +
            • +
            + +
          • +
          +
          + + + +
          + +
          + +
        • +
        +
        +
        +
        + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/errors/package-summary.html b/polar-sdk-android/docs/com/polar/sdk/api/errors/package-summary.html index 23c5c526..006414a3 100644 --- a/polar-sdk-android/docs/com/polar/sdk/api/errors/package-summary.html +++ b/polar-sdk-android/docs/com/polar/sdk/api/errors/package-summary.html @@ -129,9 +129,11 @@

        Package com.polar.sdk.api.errors

        PolarNotificationNotEnabledCharacteristic notification is not enabled - PolarOperationNotSupportedRequested operation is not supported + PolarOfflineRecordingErrorOffline recording general error - PolarServiceNotAvailableGATT (Generic attributes) service not available + PolarOperationNotSupportedRequested operation is not supported + + PolarServiceNotAvailableGATT (Generic attributes) service not available diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarHrData.PolarHrSample.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarHrData.PolarHrSample.html new file mode 100644 index 00000000..b076733e --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarHrData.PolarHrSample.html @@ -0,0 +1,508 @@ + + + + PolarHrSample + + + + + + + + + + + + + + + + + +
        + +
        + +
        +
        +
        Package 
        +

        Class PolarHrData.PolarHrSample

        +
        +
        + +
        +
          +
        • + +
          +
          All Implemented Interfaces:
          +
          + +
          +
          + +
          +
          +
          +public final class PolarHrData.PolarHrSample
          +
          +                    
          +

          Polar heart rate sample

          +
        • +
        +
        +
        + +
        +
        + +
        +
        +
        + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarHrData.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarHrData.html index 40b95ad0..e6bdcddc 100644 --- a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarHrData.html +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarHrData.html @@ -117,7 +117,7 @@

        Class PolarHrData

        public final class PolarHrData -

        Polar heart rate data

        +
      @@ -141,6 +141,13 @@

      Nested Class Summary

      Description + + public final class + PolarHrData.PolarHrSample + +

      Polar heart rate sample

      + +
    • @@ -165,38 +172,8 @@

      Field Summary

      - private final List<Integer> - rrsMs - - - - - private final Integer - hr - - - - - private final List<Integer> - rrs - - - - - private final Boolean - contactStatus - - - - - private final Boolean - contactStatusSupported - - - - - private final Boolean - rrAvailable + private final List<PolarHrData.PolarHrSample> + samples @@ -226,7 +203,7 @@

      Constructor Summary

      PolarHrData(Integer hr, List<Integer> rrs, Boolean contactStatus, Boolean contactStatusSupported, Boolean rrAvailable) + href="#PolarHrData(List)">PolarHrData(List<PolarHrData.PolarHrSample> samples) @@ -280,49 +257,9 @@

      Method Summary

      - final List<Integer> - - getRrsMs() - - - - - - final Integer + final List<PolarHrData.PolarHrSample> - getHr() - - - - - - final List<Integer> - - getRrs() - - - - - - final Boolean - - getContactStatus() - - - - - - final Boolean - - getContactStatusSupported() - - - - - - final Boolean - - getRrAvailable() + getSamples() @@ -358,11 +295,11 @@

      Methods inherited from class java.lang.Object

      Constructor Detail

      - +
      • PolarHrData

        -
        PolarHrData(Integer hr, List<Integer> rrs, Boolean contactStatus, Boolean contactStatusSupported, Boolean rrAvailable)
        +
        PolarHrData(List<PolarHrData.PolarHrSample> samples)
      • @@ -381,90 +318,15 @@

        PolarHrData

        Method Detail

        - - - - - - - - - - - - - - - - - - - - - - - - - - +
        • -

          getRrAvailable

          -
           final Boolean getRrAvailable()
          +

          getSamples

          +
           final List<PolarHrData.PolarHrSample> getSamples()
          diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.AccOfflineRecording.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.AccOfflineRecording.html new file mode 100644 index 00000000..7e3fec11 --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.AccOfflineRecording.html @@ -0,0 +1,450 @@ + + + + AccOfflineRecording + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Class PolarOfflineRecordingData.AccOfflineRecording

          +
          +
          + +
          + +
          +
          + +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.GyroOfflineRecording.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.GyroOfflineRecording.html new file mode 100644 index 00000000..e772aded --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.GyroOfflineRecording.html @@ -0,0 +1,450 @@ + + + + GyroOfflineRecording + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Class PolarOfflineRecordingData.GyroOfflineRecording

          +
          +
          + +
          + +
          +
          + +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.HrOfflineRecording.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.HrOfflineRecording.html new file mode 100644 index 00000000..f3cecf60 --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.HrOfflineRecording.html @@ -0,0 +1,450 @@ + + + + HrOfflineRecording + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Class PolarOfflineRecordingData.HrOfflineRecording

          +
          +
          + +
          + +
          +
          + +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.MagOfflineRecording.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.MagOfflineRecording.html new file mode 100644 index 00000000..704bda25 --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.MagOfflineRecording.html @@ -0,0 +1,450 @@ + + + + MagOfflineRecording + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Class PolarOfflineRecordingData.MagOfflineRecording

          +
          +
          + +
          + +
          +
          + +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.PpgOfflineRecording.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.PpgOfflineRecording.html new file mode 100644 index 00000000..c1c6d79a --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.PpgOfflineRecording.html @@ -0,0 +1,450 @@ + + + + PpgOfflineRecording + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Class PolarOfflineRecordingData.PpgOfflineRecording

          +
          +
          + +
          + +
          +
          + +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.PpiOfflineRecording.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.PpiOfflineRecording.html new file mode 100644 index 00000000..4f804fe8 --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.PpiOfflineRecording.html @@ -0,0 +1,450 @@ + + + + PpiOfflineRecording + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Class PolarOfflineRecordingData.PpiOfflineRecording

          +
          +
          + +
          + +
          +
          + +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.html new file mode 100644 index 00000000..0cfed105 --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingData.html @@ -0,0 +1,447 @@ + + + + PolarOfflineRecordingData + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Class PolarOfflineRecordingData

          +
          +
          + +
          +
            +
          • + +
            +
            All Implemented Interfaces:
            +
            + +
            +
            + +
            +
            +
            +public class PolarOfflineRecordingData
            +
            +                    
            +

            Polar Offline recording data

            +
          • +
          +
          +
          + +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingEntry.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingEntry.html new file mode 100644 index 00000000..22f24fdf --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingEntry.html @@ -0,0 +1,387 @@ + + + + PolarOfflineRecordingEntry + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Class PolarOfflineRecordingEntry

          +
          +
          + +
          +
            +
          • + +
            +
            All Implemented Interfaces:
            +
            + +
            +
            + +
            +
            +
            +public final class PolarOfflineRecordingEntry
            +
            +                    
            +

            Polar offline recording entry container.

            +
          • +
          +
          +
          +
            +
          • + + +
            +
              +
            • + + +

              Nested Class Summary

              +
              + + + + + + + + +
              Nested Classes 
              Modifier and TypeClassDescription
              +
              +
            • +
            +
            + + + +
            + +
            + + + +
            + +
            + + + +
            +
              +
            • + + +

              Enum Constant Summary

              + + + + + + + +
              Enum Constants 
              Enum ConstantDescription
              +
            • +
            +
            + + + +
            +
              +
            • + + +

              Method Summary

              +
              +
              + + +
              +
              + + + + + + + + +
              Modifier and TypeMethodDescription
              +
              +
                + +
              • + + +

                Methods inherited from class java.lang.Object

                + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
              • +
              +
            • +
            +
            + +
          • +
          +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingTrigger.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingTrigger.html new file mode 100644 index 00000000..cf014323 --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingTrigger.html @@ -0,0 +1,421 @@ + + + + PolarOfflineRecordingTrigger + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Class PolarOfflineRecordingTrigger

          +
          +
          + +
          +
            +
          • + +
            +
            All Implemented Interfaces:
            +
            + +
            +
            + +
            +
            +
            +public final class PolarOfflineRecordingTrigger
            +
            +                    
            +

            Polar offline recording trigger

            +
          • +
          +
          +
          + +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingTriggerMode.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingTriggerMode.html new file mode 100644 index 00000000..ed6b02ea --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOfflineRecordingTriggerMode.html @@ -0,0 +1,431 @@ + + + + PolarOfflineRecordingTriggerMode + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Enum PolarOfflineRecordingTriggerMode

          +
          +
          + +
          + +
          +
          +
            +
          • + + +
            +
              +
            • + + +

              Nested Class Summary

              +
              + + + + + + + + +
              Nested Classes 
              Modifier and TypeClassDescription
              +
              +
            • +
            +
            + + + +
            +
              +
            • + + +

              Field Summary

              +
              + + + + + + + + + + + + + + + + + + + + +
              Fields 
              Modifier and TypeFieldDescription
              private final Stringname
              private final Integerordinal
              +
              +
            • +
            +
            + + + +
            +
              +
            • + + +

              Constructor Summary

              +
              + + + + + + + + + + + +
              Constructors 
              ConstructorDescription
              +
              +
            • +
            +
            + + + +
            + +
            + + + +
            +
              +
            • + + +

              Method Summary

              +
              +
              + + +
              +
              + + + + + + + + + + + + + + + + + + + + +
              Modifier and TypeMethodDescription
              final String + getName() +
              final Integer + getOrdinal() +
              +
              +
                + +
              • + + +

                Methods inherited from class java.lang.Object

                + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
              • +
              +
            • +
            +
            + +
          • +
          +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOhrData.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOhrData.html index 2152dd23..23300af5 100644 --- a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOhrData.html +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOhrData.html @@ -113,7 +113,7 @@

          Class PolarOhrData


          -
          +@Deprecated(message = "PolarOhrData is renamed to better describe data content, use PolarPpgData", replaceWith = @ReplaceWith(imports = {}, expression = "PolarPpgData")) 
           public final class PolarOhrData
           
                               
          diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOhrPPIData.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOhrPPIData.html index 3ffbf0eb..d809750e 100644 --- a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOhrPPIData.html +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarOhrPPIData.html @@ -113,7 +113,7 @@

          Class PolarOhrPPIData


          -
          +@Deprecated(message = "PolarOhrPPIData is renamed to better describe data content, use PolarPpiData", replaceWith = @ReplaceWith(imports = {}, expression = "PolarPpiData")) 
           public final class PolarOhrPPIData
           
                               
          diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpgData.PolarPpgSample.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpgData.PolarPpgSample.html new file mode 100644 index 00000000..a9e6105f --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpgData.PolarPpgSample.html @@ -0,0 +1,421 @@ + + + + PolarPpgSample + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Class PolarPpgData.PolarPpgSample

          +
          +
          + +
          +
            +
          • + +
            +
            All Implemented Interfaces:
            +
            + +
            +
            + +
            +
            +
            +public final class PolarPpgData.PolarPpgSample
            +
            +                    
            +

            Polar optical sensor raw data sample

            +
          • +
          +
          +
          +
            +
          • + + +
            +
              +
            • + + +

              Nested Class Summary

              +
              + + + + + + + + +
              Nested Classes 
              Modifier and TypeClassDescription
              +
              +
            • +
            +
            + + + +
            + +
            + + + +
            + +
            + + + +
            +
              +
            • + + +

              Enum Constant Summary

              + + + + + + + +
              Enum Constants 
              Enum ConstantDescription
              +
            • +
            +
            + + + +
            +
              +
            • + + +

              Method Summary

              +
              +
              + + +
              +
              + + + + + + + + + + + + + + + + + + + + +
              Modifier and TypeMethodDescription
              final Long + getTimeStamp() +
              final List<Integer> + getChannelSamples() +
              +
              +
                + +
              • + + +

                Methods inherited from class java.lang.Object

                + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
              • +
              +
            • +
            +
            + +
          • +
          +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpgData.PpgDataType.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpgData.PpgDataType.html new file mode 100644 index 00000000..fb8bf278 --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpgData.PpgDataType.html @@ -0,0 +1,425 @@ + + + + PpgDataType + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Enum PolarPpgData.PpgDataType

          +
          +
          + +
          + +
          +
          +
            +
          • + + +
            +
              +
            • + + +

              Nested Class Summary

              +
              + + + + + + + + +
              Nested Classes 
              Modifier and TypeClassDescription
              +
              +
            • +
            +
            + + + +
            +
              +
            • + + +

              Field Summary

              +
              + + + + + + + + + + + + + + + + + + + + +
              Fields 
              Modifier and TypeFieldDescription
              private final Stringname
              private final Integerordinal
              +
              +
            • +
            +
            + + + +
            +
              +
            • + + +

              Constructor Summary

              +
              + + + + + + + + + + + +
              Constructors 
              ConstructorDescription
              +
              +
            • +
            +
            + + + +
            +
              +
            • + + +

              Enum Constant Summary

              + + + + + + + + + + + + + + + + + +
              Enum Constants 
              Enum ConstantDescription
              UNKNOWN
              PPG3_AMBIENT1

              Polar ohr led data containing 3 ppg and 1 ambient channel

              +
            • +
            +
            + + + +
            +
              +
            • + + +

              Method Summary

              +
              +
              + + +
              +
              + + + + + + + + + + + + + + + + + + + + +
              Modifier and TypeMethodDescription
              final String + getName() +
              final Integer + getOrdinal() +
              +
              +
                + +
              • + + +

                Methods inherited from class java.lang.Object

                + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
              • +
              +
            • +
            +
            + +
          • +
          +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpgData.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpgData.html new file mode 100644 index 00000000..f25e0b3b --- /dev/null +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpgData.html @@ -0,0 +1,435 @@ + + + + PolarPpgData + + + + + + + + + + + + + + + + + +
          + +
          + +
          +
          +
          Package 
          +

          Class PolarPpgData

          +
          +
          + +
          +
            +
          • + +
            +
            All Implemented Interfaces:
            +
            + +
            +
            + +
            +
            +
            +public final class PolarPpgData
            +
            +                    
            +

            Polar optical sensor raw data

            +
          • +
          +
          +
          + +
          +
          + +
          +
          +
          + + + + diff --git a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.Companion.html b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpiData.PolarPpiSample.html similarity index 74% rename from polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.Companion.html rename to polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpiData.PolarPpiSample.html index 3c25ea00..e2e9e017 100644 --- a/polar-sdk-android/docs/com/polar/sdk/api/PolarBleApi.Companion.html +++ b/polar-sdk-android/docs/com/polar/sdk/api/model/PolarPpiData.PolarPpiSample.html @@ -1,25 +1,25 @@ - Companion + PolarPpiSample - - - - - - + + + + + + - - - - - - + + + + + +