Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Using java FitCSVTool to decode DeveloperField

Rank

Total Posts: 1

Joined 2017-11-04

PM

EDIT: This was fixed in Fit SDK v20.43. Thanks! :D
feel free to delete this, i don't know how :/



I created a DeveloperField, using Connect IQ's FitContributor.Field within a watch app on a Garmin 5s. The FitCSVTool.jar throws an exception when it encounters them. Activity files without the apps's sessions decode successfully.

java -jar FitCSVTool.jar -/run/media/GARMIN/GARMIN/ACTIVITY/7AUK4259.FIT ../../explore/activity.csv
FIT CSV Tool 
Protocol 2.0 Profile 20.42 Release
Exception in thread 
"main" java.lang.RuntimeExceptionjava.lang.ClassCastExceptioncom.garmin.fit.DeveloperField cannot be cast to com.gar
min
.fit.Field
        at com
.garmin.fit.csv.CSVTool.run(CSVTool.java:235)
        at com.garmin.fit.csv.CSVTool.main(CSVTool.java:311)
Caused byjava.lang.ClassCastExceptioncom.garmin.fit.DeveloperField cannot be cast to com.garmin.fit.Field
        at com
.garmin.fit.csv.MesgCSVWriterBase.getValueString(MesgCSVWriterBase.java:58)
        at com.garmin.fit.csv.MesgCSVWriter.onMesg(MesgCSVWriter.java:150)
        at com.garmin.fit.csv.MesgFilter.onMesg(MesgFilter.java:109)
        at com.garmin.fit.Decode.resume(Decode.java:397)
        at com.garmin.fit.Decode.read(Decode.java:344)
        at com.garmin.fit.csv.CSVTool.run(CSVTool.java:209)
        ... 1 more 

The following changes to the Fit SDK's com/garmin/fit/csv/MesgCSVWriterBase.java handled the DeveloperFields (perhaps incorrectly) and I could parse the saved values out of the CSV.

It seems I cannot to post source codeI receive a permissions error from the forums.
Is there a preferred way to contribute source code changes

I don't know if those two types -- Profile.Type.fromBaseType & DeveloperField.getType -- match up, but it worked for my files.

Thanks for the excellent platform. Hope this helps.

Versions and Stuff
- Fit SDK Release 20.42.00
- Connect IQ SDK 2.3.5
- Garmin 5s, software version 3.0.0
- https://developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/FitContributor/Field.html