Connect IQ Fit Contributor creates 'developer_data_id' and 'field_description' messages for MESG_TYPE_RECORD messages in the Activity FIT file, but it fails to create them with MESG_TYPE_SESSION or MESG_TYPE_LAP .
Code - adapted from Module: Toybox::FitContributor
if ($.session == null) { $.session = Record.createSession({ :name => "raceQs", :sport => Record.SPORT_GENERIC}); $.session.start(); bananasEarnedField = $.session.createField( "bananas_earned", 5, Toybox.FitContributor.DATA_TYPE_UINT16, {:mesgType=>Toybox.FitContributor.MESG_TYPE_SESSION, :units=>"B"} ); } totalBananas = 100; bananasEarnedField.setData(totalBananas);
Procedure.
Compile and run an app containing the code in the SDK simulator or a physical device (I used a Fenix5)
Save the Activity to a local file.
Run FitCSVTool.jar from the Fit SDK package on the resulting fit file
Expected result:
To find In the Fit File contains
Definition | 9 | developer_data_id |
Data | 9 | developer_data_id |
Definition | 10 | field_description |
Data | 10 | field_description |
Actual result
No developer_data_id or field_description Definition or Data messages in the output.
Further info
- When I modify the code to generate a MSG_TYPE_RECORD, the expected fields are generated and the developer data is found in the 'record' messages
- when I run with MSG_TYPE_LAP no developer_data_id or field_description Definition or Data messages in the output.
- I have built a Fit file decoding program in PHP to examine session, lap and record messages and to decode developer data by interpreting the developer_data_id and field_description messages. This confirms what I'm finding from FitCSVTool.
[UPDATE]
I have since discovered that when writing a developer field to a MSG_TYPE_LAP message, the data is in fact written to the message, but there are no developer_data_id or field_description messages which explains why FitCSVTool fails to detect the value.