-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.IndexOutOfBoundsException when parsing PPI data and starting offline HR recording #532
Comments
Edit: updated to reflect 2 distinct cases of the IndexOutOfBoundsException |
FLOW-61198 |
Hi @orestesgaolin! Not the answer to your question but I'm using Polar Verity Sense myself with Flutter and the polar flutter wrapper. I wonder how are you starting and reading HR and PPI recordings offline, because I can't get it to work? Stuck with his issue: #528 |
I wish I could help you @abbjetmus, but we don't use offline PPI recordings, only HR. When it comes to settings we just pass empty value: private val hrRecordingSettings: PolarSensorSetting by lazy {
PolarSensorSetting(mapOf())
}
// and later
polarBleApi.startOfflineRecording(deviceId, feature, hrRecordingSettings, null) |
Thank you so much, this is actually what I was needing. Both HR and PPI are computed/derived data from PPG so should be the same approach. I never tried passing an empty map to PolarSensorSettings I assinged null to settings. if (!offlineRecordingStatus.contains(PolarDataType.acc)) {
var settingsAcc =
await polar.requestOfflineRecordingSettings(
identifier.value, PolarDataType.acc);
await polar.startOfflineRecording(
identifier.value, PolarDataType.acc,
settings: settingsAcc);
}
if (!offlineRecordingStatus.contains(PolarDataType.ppi)) {
await polar.startOfflineRecording(
identifier.value,
PolarDataType.ppi,
settings: PolarSensorSetting(<PolarSettingType, int>{}),
);
}``` |
Platform on which you observed the bug:
Device on which you observed the bug:
Describe the bug
There are 2 cases where IndexOutOfBoundsException happens
Case 1 - offline recording
When starting offline recording the following exception is sometimes thrown from this
slice
call:polar-ble-sdk/sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/api/ble/model/offlinerecording/OfflineRecordingData.kt
Line 288 in 71191b5
This exception seems to be irrecoverable due to following, and this means the PPI stream stops:
Case 2 - starting PPI stream
The exception is similar but has a different stack trace:
polar-ble-sdk/sources/Android/android-communications/library/src/main/java/com/polar/androidcommunications/common/ble/TypeUtils.kt
Line 37 in 71191b5
How to Reproduce
In case of PPI streaming we just call following API on some phones:
Expected behavior
The
slice
operation should not fail and PPI stream should continue, and the offline recording should be able to startThe text was updated successfully, but these errors were encountered: