Hi everyone,
here is the code I use:
if(What>19&&What<25){
var tmp = getIterator(What-20);
(...)
}
function getIterator(opt){
var what = [:getHeartRateHistory,:getElevationHistory,:getPressureHistory,:getTemperatureHistory,:getOxygenSaturationHistory];
if(Toybox has :SensorHistory && SensHist has what[opt]){
var Num = gHW.toNumber();
var getMethod = new Lang.Method( SensHist, what[opt]);
return getMethod.invoke( {:period=> Num} );
}
return null;
}
So it works nice on lot of devices (only 3.2.x)
but not on MARQ, F6/ F6s (non Pro) as soon as I put what = 24 (pulse Ox)
if I put something else than Pulse Ox, no issue.
here is the issue returned:
Error: Out Of Memory Error
Details: Failed invoking <symbol>
Stack:
on memory usage I have: 22.2/92 - peak = 24.8
when Sys.print test (on device with issue) tmp = object, tmp.next() = null
So I don't get at all what happens, can't test on real devices.