I want to get MSL pressure.
Environment f5, SW 11.58, and all previous, non-beta.
SDK 3.0.5
Buld for 3.0x to side load. The same was for any 2.xx versions.
The same exists on widget I developed, have numerous complaints from customers why MSL on my widget does not match the native system widget.
1)
On CIQ 2.0: it is possible using Activity.getActivityInfo();
Value from it: meanSeaLevelPressure
From my experiments on real device, let it be: 105374.8901
2)
It is possible to get the same using Sensor.getInfo();
Value from it: pressure
Let it be: 105374.890625
3)
It is possible to use SensorHistory
function tryGetPressure() {
if ( Toybox has :SensorHistory ) {
var sensorIter = getIteratorPressure();
if( sensorIter != null ) {
var sample = sensorIter.next();
while( null != sample ) {
if( sample.data != null ) {
return sample.data;
}
else {
sample = sensorIter.next();
}
}
}
}
return null;
}
It will read the latest value from history.
From the experiment let it be: 105065.640625
You see the difference?
4)
Go to device settings and set to mBars units representation.
And now finally go to any activity, like Run, and add one page, with one field - Barometric pressure.
Launch the activity or just open it and go to page with the value:
You will see something like:
1051.
That matches the SensorHistory value, but does not match the others.
5)
Open native pressure widget and you will see the same value, with one decimal point, like 1050.7.
6)
Turn device off. Press and hold DOWN button, then press POWER. After some seconds release and press DOWN few times again (I have no exact algo about this access, just try few times). You will get service menu. Press BACK few times to switch to the pressure page. You will see Local press and Base press lines. Base press is the MSL pressure you need to compare and this value will match the value with the native widget and Run activity data field Barometric pressure value.
Expected: all the values MSL should be the same.
Current results: values do not match.