Hi folks!
I have troubles with 3 FIT contributions as strings to the summary page:
If I declare "count" = stringLength, I get the error:
Error: System Error Details: setData string too long for allocated space
myebikeenergyField = createField("ebikeenergy", ebikeenergyID, FitContributor.DATA_TYPE_STRING, {:mesgType=>FitContributor.MESG_TYPE_SESSION, :count => 4} ); // l=4 if ( myebikeenergyField != null ) { ebikeEnergy = 99.9f; myebikeenergyField.setData(ebikeEnergy.format("%.1f")); } myriderenergyField = createField("riderenergy", riderenergyID, FitContributor.DATA_TYPE_STRING, {:mesgType=>FitContributor.MESG_TYPE_SESSION, :count => 4} ); // l=4 if ( myriderenergyField != null ) { riderEnergy = 99.9f; myriderenergyField.setData(riderEnergy.format("%.1f")); } myprozenergyField = createField("prozenergy", prozenergyID, FitContributor.DATA_TYPE_STRING, {:mesgType=>FitContributor.MESG_TYPE_SESSION, :count => 7} ); // l=7 if ( myprozenergyField != null ) { prozEnergy = "50 / 50"; myprozenergyField.setData(prozEnergy); }
If I enlarge "count" by stringlength plus 2, it compiles but on the real device (EDGE 1040) crashes sometimes (most times not...).
If I enlarge "count" by a large (secure) amount "count => 15" I'll get another error:
Error: Out Of Memory Error Details: New Field out of memory for FIT data
Why can 3 strings - each 15 characters - be too long for the memory...?
It seems to be a Tightrope walk between "too small" and "too large".
Does there exist any description of using strings in fit contribute?
(PS: if you ask: why using strings for the first 2 contributes? They are floats! Answer: there is a bug in Garmin Connect Web which ignores XML"precision=1" and it's rubbish to show 3 decimals on a value like Wh/km)