polyvertex / fitdecode

A FIT file parsing and decoding library written in Python3
MIT License
158 stars 34 forks source link

native_field_num is not required in field_description #24

Open stuartlynne opened 2 years ago

stuartlynne commented 2 years ago

Opening this file: FitSDKRelease_21.89.00/examples/DeveloperData.fit

Generates this warning:

UserWarning: 'field "native_field_num" (idx #0) not found in message "field_description"' (local_mesg_num: 0; chunk_offset: 93); adding dummy dev data...
  warnings.warn(msg)

I think that if Garmin is not putting native_field_num in their example then it is not required.

The DeveloperData.csv that is distributed:

Type,Local Number,Message,Field 1,Value 1,Units 1,Field 2,Value 2,Units 2,Field 3,Value 3,Units 3,Field 4,Value 4,Units 4,Field 5,Value 5,Units 5,Field 6,Value 6,Units 6,
Definition,0,file_id,manufacturer,1,,type,1,,product,1,,serial_number,1,,
Data,0,file_id,manufacturer,"15",,type,"4",,garmin_product,"9001",,serial_number,"1701",,
Definition,0,developer_data_id,application_id,16,,developer_data_index,1,,,,,,,,
Data,0,developer_data_id,application_id,"1|1|2|3|5|8|13|21|34|55|89|144|233|121|98|219",,developer_data_index,"0",,,,,,,,
Definition,0,field_description,developer_data_index,1,,field_definition_number,1,,fit_base_type_id,1,,field_name,17,,units,10,,
Data,0,field_description,developer_data_index,"0",,field_definition_number,"0",,fit_base_type_id,"1",,field_name,"doughnuts_earned",,units,"doughnuts",,
Definition,0,record,heart_rate,1,,cadence,1,,distance,1,,speed,1,,doughnuts_earned,1,,
Data,0,record,heart_rate,"140",bpm,cadence,"88",rpm,distance,"510.0",m,speed,"47.488",m/s,enhanced_speed,"47.488",m/s,doughnuts_earned,"1",doughnuts,
Data,0,record,heart_rate,"143",bpm,cadence,"90",rpm,distance,"2080.0",m,speed,"36.416",m/s,enhanced_speed,"36.416",m/s,doughnuts_earned,"2",doughnuts,
Data,0,record,heart_rate,"144",bpm,cadence,"92",rpm,distance,"3710.0",m,speed,"35.344",m/s,enhanced_speed,"35.344",m/s,doughnuts_earned,"3",doughnuts,
martin-ueding commented 9 months ago

I also see these warnings in most of the files that I import. I would also conclude that it is not a mandatory field.