-
Notifications
You must be signed in to change notification settings - Fork 156
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
requestOfflineRecordingSettings fails passing polar-data-type ppi #528
Comments
Hi, PPI measurement type doesn't expose any settings for our devices as this a computed data type in a fixed format that cannot be configured. You can start the offline measement by passing the start command (0x02) with the measurement type (0x03), but with MSB=1 for offline recording, so 0x02 0x03 for online stream and 0x02 0x83 for offline recording without any other parameters. Requesting the settings for PPI should return no parameters at all in the response |
I don't understand what you mean with the commands, do you mean I should pass a string with "0x02 0x83" to start offline recording for PPI? Trying to pass a string I get type errors since it expects: val feature: PolarBleApi.PolarDeviceDataType! private fun startOfflineRecording(call: MethodCall, result: Result) {
val arguments = call.arguments as List<*>
val identifier = arguments[0] as String
val feature = gson.fromJson(arguments[1] as String, PolarDeviceDataType::class.java)
val settings = gson.fromJson(arguments[2] as String, PolarSensorSetting::class.java)
wrapper.api
.startOfflineRecording(identifier, feature, settings)
.subscribe({
runOnUiThread { result.success(null) }
}, {
runOnUiThread {
result.error("ERROR_STARTING_RECORDING", it.message, null)
}
})
.discard()
} The above is not in sdk-mode, but I might use sdk-mode if the recording time offline becomes to short due to high frequency. Also do I understand correctly that PPI is not supported in sdk-mode, I have to use PPG and calculate PPI myself? |
Oh I see I'm not using raw BLE commands, I want to trigger PPI offline recording using the polar SDK according to the docs. How do I do that? |
I understand now, if a start PPG then since PPI is computed it will probably automatically be calculated if not in sdk mode. The the issue is how do I retrieve the PPI data? I need to pass an entry when calling getOfflineRecord, though I might just change the entrys type to type: PolarDataType.ppi. Didn't work and the path is obviously to a PPG file. |
@jimmyzumthurm please do you have any response on how to retrieve the offline PPI values when not in sdk mode using the android sdk? |
Hi @abbjetmus , sorry for the misunderstanding I thought you were using your own implementation of the SDK. It is correct that PPI data is not available when using SDK Mode. PPI data is not calculated by the device unless explicitly requested from the SDK for either online or offline stream. I'm no SDK expert so I don't really know how to call this function without passing any settings. |
I understand! But someone from Polar needs to know how you start PPI offline recording and retrieve PPI offline recording when NOT in SDK Mode using the native SDKs? Is there someone I can reach out to get this answer... |
@jimmyzumthurm from this issue, the questioner seems to have PPI recording working, I'm eager to understanding how I can get it working using the sdk: |
I managed to get it right, I always tried to assign null to settings, should be an empty map settings instead. 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 your question concerns:
Device:
Description:
Hi!
I'm adding offline recording support to a Flutter library that wraps the polar sdks. And I'm calling requestOfflineRecordingSettings where I want to pass ppi but it is failing, shouldn't I be able to store ppi data offline?
Image from Android docs:
My Flutter code, calling requestOfflineRecordingSettings for acc works but not ppi.
E/flutter (21957): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7)
E/flutter (21957): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
E/flutter (21957):
E/flutter (21957): #2 Polar.requestOfflineRecordingSettings (package:polar/src/polar_base.dart:595:22)
E/flutter (21957):
E/flutter (21957): #3 _PolarListPageState.build.. (package:polar_variety_sense_example/pages/polar_list_page.dart:153:25)
E/flutter (21957):
The text was updated successfully, but these errors were encountered: