example/decode.cpp doesn't show developer fields in sample FIT file [noob]

Hi - I'm a newbie learning the FIT SDK and have successfully used java, python, and C++ to decode FIT files.

I found that the C++ decode displays developer fields in examples/DeveloperData.fit but does NOT show developer fields in Customer.fit (attached).

In contrast python works on both, and fitfileviewer.com also shows the developer fields for both.

How do can I get decode.cpp to display the 16 developer data fields in Customer.fit? 

Here is partial output of C++ decode on DeveloperData.fit -- note the developer field doughnuts_earned displayed with "On Mesg:"

% ./decode ~/Downloads/FitSDKRelease_21.101.00/examples/DeveloperData.fit 

FIT Decode Example Application

...

On Mesg:

   New Mesg: record.  It has 5 field(s) and 1 developer field(s).

   Field0 (heart_rate) has 1 value(s)

       Val0: 144 bpm

   Field1 (cadence) has 1 value(s)

       Val0: 92 rpm

   Field2 (distance) has 1 value(s)

       Val0: 3710 m

   Field3 (speed) has 1 value(s)

       Val0: 35.344 m/s

   Field4 (enhanced_speed) has 1 value(s)

       Val0: 35.344 m/s

   Developer Field(doughnuts_earned) has 1 value(s)

       Val0: 3 doughnuts

...

In contrast here is the partial output of C++ decode on Customer.fit -- note that the 1st developer data field (wind_yaw) is displayed once.

Subsequent  "On Mesg" show no developer fields at all.

...

On Mesg:

   New Mesg: record.  It has 10 field(s) and 16 developer field(s).

   Field0 (timestamp) has 1 value(s)

       Val0: 1.02993e+09 s

   Field1 (position_lat) has 1 value(s)

       Val0: 6.25678e+08 semicircles

   Field2 (position_long) has 1 value(s)

       Val0: -2.43235e+07 semicircles

   Field3 (distance) has 1 value(s)

       Val0: 0 m

   Field4 (altitude) has 1 value(s)

       Val0: 120.4 m

   Field5 (speed) has 1 value(s)

       Val0: 0 m/s

   Field6 (power) has 1 value(s)

       Val0: 0 watts

   Field7 (temperature) has 1 value(s)

       Val0: 28 C

   Field8 (enhanced_altitude) has 1 value(s)

       Val0: 120.4 m

   Field9 (enhanced_speed) has 1 value(s)

       Val0: 0 m/s

   Developer Field(wind_yaw) has 1 value(s)

       Val0: 0 Record:

   distance:

      native: 0.000000

   speed:

      native: 0.000000

On Mesg:

...

On Mesg:

Record:

   cadence:

      native: 90.000000

   distance:

      native: 3222.210000

   speed:

      native: 12.251000

On Mesg:

Record:

   cadence:

      native: 89.000000

   distance:

      native: 3232.690000

   speed:

      native: 12.251000

...

Python successfully decodes both DeveloperData.fit and Customer.fit and reports the data in developer_fields. 

python3

>>> from garmin_fit_sdk import Decoder, Stream

>>> stream = Stream.from_file(“~/Downloads/Customer.fit”)

>>> decoder = Decoder(stream)

>>> messages, errors = decoder.read()

>>> messages["record_mesgs"][100]

{'timestamp': datetime.datetime(2022, 8, 20, 13, 4, 24, tzinfo=datetime.timezone.utc), 'position_lat': 625675547, 'position_long': -24321767, 'distance': 822.82, 'accumulated_power': 20896, 'altitude': 122.60000000000002, 'speed': 11.859, 'power': 317, 61: 3113, 66: 824, 'cadence': 88, 'temperature': 28, 'left_right_balance': 176, 'fractional_cadence': 0.0, 'enhanced_speed': 11.859, 'enhanced_altitude': 122.60000000000002, 'developer_fields': {0: 21.20000457763672, 1: 14.341415405273438, 2: 100216.453125, 3: 1.1549999713897705, 4: 288.3000183105469, 5: -201.8100128173828, 6: 0.0, 7: -37.479000091552734, 8: 4.5, 9: 2.299999952316284, 10: 42.5, 11: 0.24379999935626984, 12: 0, 13: 0.24039998650550842, 14: 44.661598205566406, 15: 250}}

I'm not allowed to attach Customer.fit so here is a link 

www.dropbox.com/.../Customer.fit

  • It is probably not anything that you are doing. We will take a look at the C++ SDK and the file sometime this month and see if we can figure what is going on.

  • I ran your file through the example C++ decode example and there were 299 Record messages written out to the console and 290 of them showed the Developer Field(wind_yaw) along with the rest of the developer data in those 290 Record messages. Is there any additional information that you can provide for how to reproduce this?

  • I appreciate you taking a look! Weird that you see developer fields but I do not. 

    Here is how I built and ran the decode example.  

    Did I build or call it incorrectly? I'm running on macos v12.6

    cd ~/Downloads/FitSDKRelease_21.101.00/cpp
    # no makefile so I just compiled everything on my mac 
    /usr/bin/clang++ -std=c++11 -c *.cpp
    /usr/bin/clang++ -I ~/Downloads/FitSDKRelease_21.101.00/cpp -std=c++11 -c examples/decode/decode.cpp
    /usr/bin/clang++ -o decode *.o
    
    # try a simple example
    ./decode ../examples/DeveloperData.fit
    # output looks ok
    ./decode ../examples/DeveloperData.fit > DeveloperData.txt
    
    # try FIT file with 16 developer fields
    ./decode ~/Downloads/Customer.fit
    # developer data names and values missing
    # note https://fitfileview.com shows all developer fields & values
    ./decode ~/Downloads/Customer.fit > Customer.txt 
    

    The output files and screenshot of fitfileviewer.com are in a dropbox directory

    https://www.dropbox.com/scl/fo/6gh9az3mtud4hamswuffv/h?dl=0&rlkey=eme66yejqnc0b83r7057xcvza