fit-parser 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +0 -0
- data/.rspec +0 -0
- data/.travis.yml +2 -1
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +1 -0
- data/Rakefile +0 -0
- data/fit.gemspec +4 -4
- data/lib/fit/file/data.rb +1 -1
- data/lib/fit/file/definition.rb +7 -1
- data/lib/fit/file/definitions.rb +192 -128
- data/lib/fit/file/header.rb +0 -0
- data/lib/fit/file/record.rb +0 -0
- data/lib/fit/file/record_header.rb +7 -1
- data/lib/fit/file/type.rb +0 -0
- data/lib/fit/file/types.rb +0 -0
- data/lib/fit/file.rb +0 -0
- data/lib/fit/version.rb +1 -1
- data/lib/fit.rb +0 -0
- data/spec/file/data_spec.rb +0 -0
- data/spec/file/definition_spec.rb +7 -7
- data/spec/file/definitions_spec.rb +1 -1
- data/spec/file/header_spec.rb +0 -0
- data/spec/file/record_header_spec.rb +17 -0
- data/spec/file/record_spec.rb +0 -0
- data/spec/file/type_spec.rb +0 -0
- data/spec/file/types_spec.rb +0 -0
- data/spec/file_spec.rb +0 -0
- data/spec/fit_spec.rb +0 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/support/examples/file/full_file_with_wrong_crc.fit +0 -0
- data/spec/support/examples/file/header +0 -0
- data/spec/support/examples/file/header_14b.fit +0 -0
- data/spec/support/examples/record/data_record_2.fit +0 -0
- data/spec/support/examples/record/data_record_2bis.fit +0 -0
- data/spec/support/examples/record/definition_record +0 -0
- data/spec/support/examples/record/definition_record_2.fit +0 -0
- data/spec/support/examples/record/message/data_dynamic_fields.fit +0 -0
- data/spec/support/examples/record/message/data_field_array.fit +0 -0
- data/spec/support/examples/record/message/data_file_capabilities_activities.fit +0 -0
- data/spec/support/examples/record/message/data_file_capabilities_settings.fit +0 -0
- data/spec/support/examples/record/message/data_lap.fit +0 -0
- data/spec/support/examples/record/message/data_session.fit +0 -0
- data/spec/support/examples/record/message/definition +0 -0
- data/spec/support/examples/record/message/definition_dynamic_fields.fit +0 -0
- data/spec/support/examples/record/message/definition_field_array.fit +0 -0
- data/spec/support/examples/record/message/definition_file_capabilities.fit +0 -0
- data/spec/support/examples/record/message/definition_lap.fit +0 -0
- data/spec/support/examples/record/message/definition_session.fit +0 -0
- data/spec/support/examples/record/normal_header +0 -0
- data/spec/support/examples/record/normal_header_with_developer_flag +1 -0
- metadata +13 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: eaba67844201f7eb37ff2dd4c4cf569fe9cb3ae75997562ea2645b0cdd41916f
|
4
|
+
data.tar.gz: a61dd9b8acc4eb82fc53ff31b5b54141019d55256d3bee35e8995aaa6eb56e0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59468f1324e8fa3e5a24b12122697ae81bb2f32dd0db5834b1f6bfdf483ace98440cbb7a8d237261091a891897f374c8a667d0ab9e3cbeeb5c4bbc2ca47972c8
|
7
|
+
data.tar.gz: 1eaf9ab242e1e3358f1d55510218c88ece71acd16225bb253bd2afae1fb7bf7c0e42bdf57435b1548fffcc313521ab3a098ea8ed8b1e3804c79a04f80674cc82
|
data/.gitignore
CHANGED
File without changes
|
data/.rspec
CHANGED
File without changes
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
@@ -18,6 +18,7 @@ records = fit_file.records.select{ |r| r.content.record_type != :definition }.ma
|
|
18
18
|
|
19
19
|
This library has been tested with files coming from the following devices:
|
20
20
|
- Garmin Swim
|
21
|
+
- Garmin Forerunner 35
|
21
22
|
|
22
23
|
|
23
24
|
Please let me know if you have any success with files coming from devices that are not listed here.
|
data/Rakefile
CHANGED
File without changes
|
data/fit.gemspec
CHANGED
@@ -18,12 +18,12 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "bindata", "~> 2.
|
22
|
-
spec.add_dependency "activesupport", "~>
|
21
|
+
spec.add_dependency "bindata", "~> 2.4"
|
22
|
+
spec.add_dependency "activesupport", "~> 6.1"
|
23
23
|
|
24
|
-
spec.add_development_dependency "bundler", "~> 1
|
24
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
25
25
|
spec.add_development_dependency "rake"
|
26
|
-
spec.add_development_dependency "rspec", "~> 3.
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.10"
|
27
27
|
spec.add_development_dependency "rspec-its"
|
28
28
|
spec.add_development_dependency "simplecov"
|
29
29
|
spec.add_development_dependency "pry"
|
data/lib/fit/file/data.rb
CHANGED
data/lib/fit/file/definition.rb
CHANGED
@@ -73,6 +73,12 @@ module Fit
|
|
73
73
|
build_int_type 32, false
|
74
74
|
when 13 # array of bytes
|
75
75
|
build_int_type 8, false
|
76
|
+
when 14 # sint64
|
77
|
+
build_int_type 64, true
|
78
|
+
when 15 # uint64
|
79
|
+
build_int_type 64, false
|
80
|
+
when 16 # uint64z
|
81
|
+
build_int_type 64, false
|
76
82
|
else
|
77
83
|
raise "Can't map base_type_number #{base_type_number} to a data type"
|
78
84
|
end
|
@@ -104,7 +110,7 @@ module Fit
|
|
104
110
|
uint16be 1
|
105
111
|
end
|
106
112
|
bit8 :field_count
|
107
|
-
array :
|
113
|
+
array :fit_fields, :type => Field, :initial_length => :field_count
|
108
114
|
|
109
115
|
def endianness
|
110
116
|
architecture.snapshot == 0 ? :little : :big
|
data/lib/fit/file/definitions.rb
CHANGED
@@ -54,20 +54,7 @@ Fit::File::Definitions.add_field 0, 2, 'garmin_product', :type => :garmin_produc
|
|
54
54
|
Fit::File::Definitions.add_field 0, 3, 'serial_number', :type => :uint32z
|
55
55
|
Fit::File::Definitions.add_field 0, 4, 'time_created', :type => :date_time
|
56
56
|
Fit::File::Definitions.add_field 0, 5, 'number', :type => :uint16
|
57
|
-
|
58
|
-
Fit::File::Definitions.add_name 49, 'file_creator'
|
59
|
-
Fit::File::Definitions.add_field 49, 0, 'software_version', :type => :uint16
|
60
|
-
Fit::File::Definitions.add_field 49, 1, 'hardware_version', :type => :uint8
|
61
|
-
|
62
|
-
Fit::File::Definitions.add_name 35, 'software'
|
63
|
-
Fit::File::Definitions.add_field 35, 254, 'message_index', :type => :message_index
|
64
|
-
Fit::File::Definitions.add_field 35, 3, 'version', :type => :uint16, :scale => 100
|
65
|
-
Fit::File::Definitions.add_field 35, 5, 'part_number', :type => :string
|
66
|
-
|
67
|
-
Fit::File::Definitions.add_name 106, 'slave_device'
|
68
|
-
Fit::File::Definitions.add_field 106, 0, 'manufacturer', :type => :manufacturer
|
69
|
-
Fit::File::Definitions.add_field 106, 1, 'product', :type => :uint16
|
70
|
-
Fit::File::Definitions.add_field 106, 1, 'garmin_product', :type => :garmin_product, :ref_field_name => 'manufacturer', :ref_field_values => [:garmin, :dynastream, :dynastream_oem]
|
57
|
+
Fit::File::Definitions.add_field 0, 8, 'product_name', :type => :string
|
71
58
|
|
72
59
|
Fit::File::Definitions.add_name 1, 'capabilities'
|
73
60
|
Fit::File::Definitions.add_field 1, 0, 'languages', :type => :uint8z
|
@@ -75,31 +62,6 @@ Fit::File::Definitions.add_field 1, 1, 'sports', :type => :sport_bits_0
|
|
75
62
|
Fit::File::Definitions.add_field 1, 21, 'workouts_supported', :type => :workout_capabilities
|
76
63
|
Fit::File::Definitions.add_field 1, 23, 'connectivity_supported', :type => :connectivity_capabilities
|
77
64
|
|
78
|
-
Fit::File::Definitions.add_name 37, 'file_capabilities'
|
79
|
-
Fit::File::Definitions.add_field 37, 254, 'message_index', :type => :message_index
|
80
|
-
Fit::File::Definitions.add_field 37, 0, 'type', :type => :file
|
81
|
-
Fit::File::Definitions.add_field 37, 1, 'flags', :type => :file_flags
|
82
|
-
Fit::File::Definitions.add_field 37, 2, 'directory', :type => :string
|
83
|
-
Fit::File::Definitions.add_field 37, 3, 'max_count', :type => :uint16
|
84
|
-
Fit::File::Definitions.add_field 37, 4, 'max_size', :type => :uint32, :unit => 'bytes'
|
85
|
-
|
86
|
-
Fit::File::Definitions.add_name 38, 'mesg_capabilities'
|
87
|
-
Fit::File::Definitions.add_field 38, 254, 'message_index', :type => :message_index
|
88
|
-
Fit::File::Definitions.add_field 38, 0, 'file', :type => :file
|
89
|
-
Fit::File::Definitions.add_field 38, 1, 'mesg_num', :type => :mesg_num
|
90
|
-
Fit::File::Definitions.add_field 38, 2, 'count_type', :type => :mesg_count
|
91
|
-
Fit::File::Definitions.add_field 38, 3, 'count', :type => :uint16
|
92
|
-
Fit::File::Definitions.add_field 38, 3, 'num_per_file', :type => :uint16, :ref_field_name => 'count_type', :ref_field_values => [:num_per_file]
|
93
|
-
Fit::File::Definitions.add_field 38, 3, 'max_per_file', :type => :uint16, :ref_field_name => 'count_type', :ref_field_values => [:max_per_file]
|
94
|
-
Fit::File::Definitions.add_field 38, 3, 'max_per_file_type', :type => :uint16, :ref_field_name => 'count_type', :ref_field_values => [:max_per_file_type]
|
95
|
-
|
96
|
-
Fit::File::Definitions.add_name 39, 'field_capabilities'
|
97
|
-
Fit::File::Definitions.add_field 39, 254, 'message_index', :type => :message_index
|
98
|
-
Fit::File::Definitions.add_field 39, 0, 'file', :type => :file
|
99
|
-
Fit::File::Definitions.add_field 39, 1, 'mesg_num', :type => :mesg_num
|
100
|
-
Fit::File::Definitions.add_field 39, 2, 'field_num', :type => :uint8
|
101
|
-
Fit::File::Definitions.add_field 39, 3, 'count', :type => :uint16
|
102
|
-
|
103
65
|
Fit::File::Definitions.add_name 2, 'device_settings'
|
104
66
|
Fit::File::Definitions.add_field 2, 0, 'active_time_zone', :type => :uint8, :scale => 1
|
105
67
|
Fit::File::Definitions.add_field 2, 1, 'utc_offset', :type => :uint32
|
@@ -187,26 +149,11 @@ Fit::File::Definitions.add_field 7, 3, 'functional_threshold_power', :type => :u
|
|
187
149
|
Fit::File::Definitions.add_field 7, 5, 'hr_calc_type', :type => :hr_zone_calc, :scale => 1
|
188
150
|
Fit::File::Definitions.add_field 7, 7, 'pwr_calc_type', :type => :pwr_zone_calc, :scale => 1
|
189
151
|
|
190
|
-
Fit::File::Definitions.add_name 12, 'sport'
|
191
|
-
Fit::File::Definitions.add_field 12, 0, 'sport', :type => :sport, :scale => 1
|
192
|
-
Fit::File::Definitions.add_field 12, 1, 'sub_sport', :type => :sub_sport, :scale => 1
|
193
|
-
Fit::File::Definitions.add_field 12, 3, 'name', :type => :string
|
194
|
-
|
195
152
|
Fit::File::Definitions.add_name 8, 'hr_zone'
|
196
153
|
Fit::File::Definitions.add_field 8, 254, 'message_index', :type => :message_index, :scale => 1
|
197
154
|
Fit::File::Definitions.add_field 8, 1, 'high_bpm', :type => :uint8, :scale => 1, :unit => 'bpm'
|
198
155
|
Fit::File::Definitions.add_field 8, 2, 'name', :type => :string, :scale => 1
|
199
156
|
|
200
|
-
Fit::File::Definitions.add_name 53, 'speed_zone'
|
201
|
-
Fit::File::Definitions.add_field 53, 254, 'message_index', :type => :message_index, :scale => 1
|
202
|
-
Fit::File::Definitions.add_field 53, 0, 'high_value', :type => :uint16, :scale => 1000, :unit => 'm/s'
|
203
|
-
Fit::File::Definitions.add_field 53, 1, 'name', :type => :string, :scale => 1
|
204
|
-
|
205
|
-
Fit::File::Definitions.add_name 131, 'cadence_zone'
|
206
|
-
Fit::File::Definitions.add_field 131, 254, 'message_index', :type => :message_index, :scale => 1
|
207
|
-
Fit::File::Definitions.add_field 131, 0, 'high_value', :type => :uint8, :scale => 1, :unit => 'rpm'
|
208
|
-
Fit::File::Definitions.add_field 131, 1, 'name', :type => :string, :scale => 1
|
209
|
-
|
210
157
|
Fit::File::Definitions.add_name 9, 'power_zone'
|
211
158
|
Fit::File::Definitions.add_field 9, 254, 'message_index', :type => :message_index, :scale => 1
|
212
159
|
Fit::File::Definitions.add_field 9, 1, 'high_value', :type => :uint16, :scale => 1, :unit => 'watts'
|
@@ -218,6 +165,11 @@ Fit::File::Definitions.add_field 10, 1, 'high_bpm', :type => :uint8, :scale => 1
|
|
218
165
|
Fit::File::Definitions.add_field 10, 2, 'calories', :type => :uint16, :scale => 10, :unit => 'kcal / min'
|
219
166
|
Fit::File::Definitions.add_field 10, 3, 'fat_calories', :type => :uint8, :scale => 10, :unit => 'kcal / min'
|
220
167
|
|
168
|
+
Fit::File::Definitions.add_name 12, 'sport'
|
169
|
+
Fit::File::Definitions.add_field 12, 0, 'sport', :type => :sport, :scale => 1
|
170
|
+
Fit::File::Definitions.add_field 12, 1, 'sub_sport', :type => :sub_sport, :scale => 1
|
171
|
+
Fit::File::Definitions.add_field 12, 3, 'name', :type => :string
|
172
|
+
|
221
173
|
Fit::File::Definitions.add_name 15, 'goal'
|
222
174
|
Fit::File::Definitions.add_field 15, 254, 'message_index', :type => :message_index, :scale => 1
|
223
175
|
Fit::File::Definitions.add_field 15, 0, 'sport', :type => :sport, :scale => 1
|
@@ -232,16 +184,6 @@ Fit::File::Definitions.add_field 15, 8, 'recurrence', :type => :goal_recurrence,
|
|
232
184
|
Fit::File::Definitions.add_field 15, 9, 'recurrence_value', :type => :uint16, :scale => 1
|
233
185
|
Fit::File::Definitions.add_field 15, 10, 'enabled', :type => :bool, :scale => 1
|
234
186
|
|
235
|
-
Fit::File::Definitions.add_name 34, 'activity'
|
236
|
-
Fit::File::Definitions.add_field 34, 253, 'timestamp', :type => :date_time
|
237
|
-
Fit::File::Definitions.add_field 34, 0, 'total_timer_time', :type => :uint32, :scale => 1000, :unit => 's'
|
238
|
-
Fit::File::Definitions.add_field 34, 1, 'num_sessions', :type => :uint16, :scale => 1
|
239
|
-
Fit::File::Definitions.add_field 34, 2, 'type', :type => :activity
|
240
|
-
Fit::File::Definitions.add_field 34, 3, 'event', :type => :event
|
241
|
-
Fit::File::Definitions.add_field 34, 4, 'event_type', :type => :event_type
|
242
|
-
Fit::File::Definitions.add_field 34, 5, 'local_timestamp', :type => :local_date_time
|
243
|
-
Fit::File::Definitions.add_field 34, 6, 'event_group', :type => :uint8
|
244
|
-
|
245
187
|
Fit::File::Definitions.add_name 18, 'session'
|
246
188
|
Fit::File::Definitions.add_field 18, 254, 'message_index', :type => :message_index, :scale => 1
|
247
189
|
Fit::File::Definitions.add_field 18, 253, 'timestamp', :type => :date_time, :unit => 's'
|
@@ -426,26 +368,6 @@ Fit::File::Definitions.add_field 19, 93, 'avg_left_pedal_smoothness', :type => :
|
|
426
368
|
Fit::File::Definitions.add_field 19, 94, 'avg_right_pedal_smoothness', :type => :uint8, :scale => 2, :unit => 'percent'
|
427
369
|
Fit::File::Definitions.add_field 19, 95, 'avg_combined_pedal_smoothness', :type => :uint8, :scale => 2, :unit => 'percent'
|
428
370
|
|
429
|
-
Fit::File::Definitions.add_name 101, 'length'
|
430
|
-
Fit::File::Definitions.add_field 101, 254, 'message_index', :type => :message_index, :scale => 1
|
431
|
-
Fit::File::Definitions.add_field 101, 253, 'timestamp', :type => :date_time, :scale => 1
|
432
|
-
Fit::File::Definitions.add_field 101, 0, 'event', :type => :event
|
433
|
-
Fit::File::Definitions.add_field 101, 1, 'event_type', :type => :event_type
|
434
|
-
Fit::File::Definitions.add_field 101, 2, 'start_time', :type => :date_time, :scale => 1
|
435
|
-
Fit::File::Definitions.add_field 101, 3, 'total_elapsed_time', :type => :uint32, :scale => 1000, :unit => 's'
|
436
|
-
Fit::File::Definitions.add_field 101, 4, 'total_timer_time', :type => :uint32, :scale => 1000, :unit => 's'
|
437
|
-
Fit::File::Definitions.add_field 101, 5, 'total_strokes', :type => :uint16, :scale => 1, :unit => 'strokes'
|
438
|
-
Fit::File::Definitions.add_field 101, 6, 'avg_speed', :type => :uint16, :scale => 1000, :unit => 'm/s'
|
439
|
-
Fit::File::Definitions.add_field 101, 7, 'swim_stroke', :type => :swim_stroke, :unit => 'swim_stroke'
|
440
|
-
Fit::File::Definitions.add_field 101, 9, 'avg_swimming_cadence', :type => :uint8, :unit => 'strokes/min'
|
441
|
-
Fit::File::Definitions.add_field 101, 10, 'event_group', :type => :uint8
|
442
|
-
Fit::File::Definitions.add_field 101, 11, 'total_calories', :type => :uint16, :unit => 'kcal'
|
443
|
-
Fit::File::Definitions.add_field 101, 12, 'length_type', :type => :length_type
|
444
|
-
Fit::File::Definitions.add_field 101, 18, 'player_score', :type => :uint16
|
445
|
-
Fit::File::Definitions.add_field 101, 19, 'opponent_score', :type => :uint16
|
446
|
-
Fit::File::Definitions.add_field 101, 20, 'stroke_count', :type => :uint16, :unit => 'counts'
|
447
|
-
Fit::File::Definitions.add_field 101, 21, 'zone_count', :type => :uint16, :unit => 'counts'
|
448
|
-
|
449
371
|
Fit::File::Definitions.add_name 20, 'record'
|
450
372
|
Fit::File::Definitions.add_field 20, 253, 'timestamp', :type => :date_time, :scale => 1, :unit => 's'
|
451
373
|
Fit::File::Definitions.add_field 20, 0, 'position_lat', :type => :sint32, :scale => 1, :unit => 'semicircles'
|
@@ -547,32 +469,6 @@ Fit::File::Definitions.add_field 23, 21, 'ant_device_number', :type => :uint16z
|
|
547
469
|
Fit::File::Definitions.add_field 23, 22, 'ant_network', :type => :ant_network
|
548
470
|
Fit::File::Definitions.add_field 23, 25, 'source_type', :type => :source_type
|
549
471
|
|
550
|
-
Fit::File::Definitions.add_name 72, 'training_file'
|
551
|
-
Fit::File::Definitions.add_field 72, 253, 'timestamp', :type => :date_time
|
552
|
-
Fit::File::Definitions.add_field 72, 0, 'type', :type => :file
|
553
|
-
Fit::File::Definitions.add_field 72, 1, 'manufacturer', :type => :manufacturer
|
554
|
-
Fit::File::Definitions.add_field 72, 2, 'product', :type => :uint16
|
555
|
-
Fit::File::Definitions.add_field 72, 2, 'garmin_product', :type => :garmin_product, :ref_field_name => 'manufacturer', :ref_field_values => [:garmin, :dynastream, :dynastream_oem]
|
556
|
-
Fit::File::Definitions.add_field 72, 3, 'serial_number', :type => :uint32z
|
557
|
-
Fit::File::Definitions.add_field 72, 4, 'time_created', :type => :date_time
|
558
|
-
|
559
|
-
Fit::File::Definitions.add_name 78, 'hrv'
|
560
|
-
Fit::File::Definitions.add_field 78, 0, 'time', :type => :uint16, :scale => 1000, :unit => 's'
|
561
|
-
|
562
|
-
Fit::File::Definitions.add_name 31, 'course'
|
563
|
-
Fit::File::Definitions.add_field 31, 4, 'sport', :type => :sport
|
564
|
-
Fit::File::Definitions.add_field 31, 5, 'name', :type => :string
|
565
|
-
Fit::File::Definitions.add_field 31, 6, 'capabilities', :type => :course_capabilities
|
566
|
-
|
567
|
-
Fit::File::Definitions.add_name 32, 'course_point'
|
568
|
-
Fit::File::Definitions.add_field 32, 254, 'message_index', :type => :message_index
|
569
|
-
Fit::File::Definitions.add_field 32, 1, 'timestamp', :type => :date_time, :scale => 1
|
570
|
-
Fit::File::Definitions.add_field 32, 2, 'position_lat', :type => :sint32, :scale => 1, :unit => 'semicircles'
|
571
|
-
Fit::File::Definitions.add_field 32, 3, 'position_long', :type => :sint32, :scale => 1, :unit => 'semicircles'
|
572
|
-
Fit::File::Definitions.add_field 32, 4, 'distance', :type => :uint32, :scale => 100, :unit => 'm'
|
573
|
-
Fit::File::Definitions.add_field 32, 5, 'type', :type => :course_point, :scale => 1
|
574
|
-
Fit::File::Definitions.add_field 32, 6, 'name', :type => :string
|
575
|
-
|
576
472
|
Fit::File::Definitions.add_name 26, 'workout'
|
577
473
|
Fit::File::Definitions.add_field 26, 4, 'sport', :type => :sport, :scale => 1
|
578
474
|
Fit::File::Definitions.add_field 26, 5, 'capabilities', :type => :workout_capabilities
|
@@ -622,17 +518,6 @@ Fit::File::Definitions.add_field 28, 4, 'completed', :type => :bool, :scale => 1
|
|
622
518
|
Fit::File::Definitions.add_field 28, 5, 'type', :type => :schedule, :scale => 1
|
623
519
|
Fit::File::Definitions.add_field 28, 6, 'scheduled_time', :type => :local_date_time
|
624
520
|
|
625
|
-
Fit::File::Definitions.add_name 33, 'totals'
|
626
|
-
Fit::File::Definitions.add_field 33, 254, 'message_index', :type => :message_index
|
627
|
-
Fit::File::Definitions.add_field 33, 253, 'timestamp', :type => :date_time, :unit => 's'
|
628
|
-
Fit::File::Definitions.add_field 33, 0, 'timer_time', :type => :uint32, :unit => 's'
|
629
|
-
Fit::File::Definitions.add_field 33, 1, 'distance', :type => :uint32, :unit => 'm'
|
630
|
-
Fit::File::Definitions.add_field 33, 2, 'calories', :type => :uint32, :unit => 'kcal'
|
631
|
-
Fit::File::Definitions.add_field 33, 3, 'sport', :type => :sport
|
632
|
-
Fit::File::Definitions.add_field 33, 4, 'elapsed_time', :type => :uint32, :unit => 's'
|
633
|
-
Fit::File::Definitions.add_field 33, 5, 'sessions', :type => :uint16
|
634
|
-
Fit::File::Definitions.add_field 33, 6, 'active_time', :type => :uint32, :unit => 's'
|
635
|
-
|
636
521
|
Fit::File::Definitions.add_name 30, 'weight_scale'
|
637
522
|
Fit::File::Definitions.add_field 30, 253, 'timestamp', :type => :date_time, :scale => 1, :unit => 's'
|
638
523
|
Fit::File::Definitions.add_field 30, 0, 'weight', :type => :weight, :scale => 100, :unit => 'kg'
|
@@ -648,6 +533,75 @@ Fit::File::Definitions.add_field 30, 10, 'metabolic_age', :type => :uint8, :scal
|
|
648
533
|
Fit::File::Definitions.add_field 30, 11, 'visceral_fat_rating', :type => :uint8, :scale => 1
|
649
534
|
Fit::File::Definitions.add_field 30, 12, 'user_profile_index', :type => :message_index
|
650
535
|
|
536
|
+
Fit::File::Definitions.add_name 31, 'course'
|
537
|
+
Fit::File::Definitions.add_field 31, 4, 'sport', :type => :sport
|
538
|
+
Fit::File::Definitions.add_field 31, 5, 'name', :type => :string
|
539
|
+
Fit::File::Definitions.add_field 31, 6, 'capabilities', :type => :course_capabilities
|
540
|
+
|
541
|
+
Fit::File::Definitions.add_name 32, 'course_point'
|
542
|
+
Fit::File::Definitions.add_field 32, 254, 'message_index', :type => :message_index
|
543
|
+
Fit::File::Definitions.add_field 32, 1, 'timestamp', :type => :date_time, :scale => 1
|
544
|
+
Fit::File::Definitions.add_field 32, 2, 'position_lat', :type => :sint32, :scale => 1, :unit => 'semicircles'
|
545
|
+
Fit::File::Definitions.add_field 32, 3, 'position_long', :type => :sint32, :scale => 1, :unit => 'semicircles'
|
546
|
+
Fit::File::Definitions.add_field 32, 4, 'distance', :type => :uint32, :scale => 100, :unit => 'm'
|
547
|
+
Fit::File::Definitions.add_field 32, 5, 'type', :type => :course_point, :scale => 1
|
548
|
+
Fit::File::Definitions.add_field 32, 6, 'name', :type => :string
|
549
|
+
|
550
|
+
Fit::File::Definitions.add_name 33, 'totals'
|
551
|
+
Fit::File::Definitions.add_field 33, 254, 'message_index', :type => :message_index
|
552
|
+
Fit::File::Definitions.add_field 33, 253, 'timestamp', :type => :date_time, :unit => 's'
|
553
|
+
Fit::File::Definitions.add_field 33, 0, 'timer_time', :type => :uint32, :unit => 's'
|
554
|
+
Fit::File::Definitions.add_field 33, 1, 'distance', :type => :uint32, :unit => 'm'
|
555
|
+
Fit::File::Definitions.add_field 33, 2, 'calories', :type => :uint32, :unit => 'kcal'
|
556
|
+
Fit::File::Definitions.add_field 33, 3, 'sport', :type => :sport
|
557
|
+
Fit::File::Definitions.add_field 33, 4, 'elapsed_time', :type => :uint32, :unit => 's'
|
558
|
+
Fit::File::Definitions.add_field 33, 5, 'sessions', :type => :uint16
|
559
|
+
Fit::File::Definitions.add_field 33, 6, 'active_time', :type => :uint32, :unit => 's'
|
560
|
+
|
561
|
+
Fit::File::Definitions.add_name 34, 'activity'
|
562
|
+
Fit::File::Definitions.add_field 34, 253, 'timestamp', :type => :date_time
|
563
|
+
Fit::File::Definitions.add_field 34, 0, 'total_timer_time', :type => :uint32, :scale => 1000, :unit => 's'
|
564
|
+
Fit::File::Definitions.add_field 34, 1, 'num_sessions', :type => :uint16, :scale => 1
|
565
|
+
Fit::File::Definitions.add_field 34, 2, 'type', :type => :activity
|
566
|
+
Fit::File::Definitions.add_field 34, 3, 'event', :type => :event
|
567
|
+
Fit::File::Definitions.add_field 34, 4, 'event_type', :type => :event_type
|
568
|
+
Fit::File::Definitions.add_field 34, 5, 'local_timestamp', :type => :local_date_time
|
569
|
+
Fit::File::Definitions.add_field 34, 6, 'event_group', :type => :uint8
|
570
|
+
|
571
|
+
Fit::File::Definitions.add_name 35, 'software'
|
572
|
+
Fit::File::Definitions.add_field 35, 254, 'message_index', :type => :message_index
|
573
|
+
Fit::File::Definitions.add_field 35, 3, 'version', :type => :uint16, :scale => 100
|
574
|
+
Fit::File::Definitions.add_field 35, 5, 'part_number', :type => :string
|
575
|
+
|
576
|
+
Fit::File::Definitions.add_name 37, 'file_capabilities'
|
577
|
+
Fit::File::Definitions.add_field 37, 254, 'message_index', :type => :message_index
|
578
|
+
Fit::File::Definitions.add_field 37, 0, 'type', :type => :file
|
579
|
+
Fit::File::Definitions.add_field 37, 1, 'flags', :type => :file_flags
|
580
|
+
Fit::File::Definitions.add_field 37, 2, 'directory', :type => :string
|
581
|
+
Fit::File::Definitions.add_field 37, 3, 'max_count', :type => :uint16
|
582
|
+
Fit::File::Definitions.add_field 37, 4, 'max_size', :type => :uint32, :unit => 'bytes'
|
583
|
+
|
584
|
+
Fit::File::Definitions.add_name 38, 'mesg_capabilities'
|
585
|
+
Fit::File::Definitions.add_field 38, 254, 'message_index', :type => :message_index
|
586
|
+
Fit::File::Definitions.add_field 38, 0, 'file', :type => :file
|
587
|
+
Fit::File::Definitions.add_field 38, 1, 'mesg_num', :type => :mesg_num
|
588
|
+
Fit::File::Definitions.add_field 38, 2, 'count_type', :type => :mesg_count
|
589
|
+
Fit::File::Definitions.add_field 38, 3, 'count', :type => :uint16
|
590
|
+
Fit::File::Definitions.add_field 38, 3, 'num_per_file', :type => :uint16, :ref_field_name => 'count_type', :ref_field_values => [:num_per_file]
|
591
|
+
Fit::File::Definitions.add_field 38, 3, 'max_per_file', :type => :uint16, :ref_field_name => 'count_type', :ref_field_values => [:max_per_file]
|
592
|
+
Fit::File::Definitions.add_field 38, 3, 'max_per_file_type', :type => :uint16, :ref_field_name => 'count_type', :ref_field_values => [:max_per_file_type]
|
593
|
+
|
594
|
+
Fit::File::Definitions.add_name 39, 'field_capabilities'
|
595
|
+
Fit::File::Definitions.add_field 39, 254, 'message_index', :type => :message_index
|
596
|
+
Fit::File::Definitions.add_field 39, 0, 'file', :type => :file
|
597
|
+
Fit::File::Definitions.add_field 39, 1, 'mesg_num', :type => :mesg_num
|
598
|
+
Fit::File::Definitions.add_field 39, 2, 'field_num', :type => :uint8
|
599
|
+
Fit::File::Definitions.add_field 39, 3, 'count', :type => :uint16
|
600
|
+
|
601
|
+
Fit::File::Definitions.add_name 49, 'file_creator'
|
602
|
+
Fit::File::Definitions.add_field 49, 0, 'software_version', :type => :uint16
|
603
|
+
Fit::File::Definitions.add_field 49, 1, 'hardware_version', :type => :uint8
|
604
|
+
|
651
605
|
Fit::File::Definitions.add_name 51, 'blood_pressure'
|
652
606
|
Fit::File::Definitions.add_field 51, 253, 'timestamp', :type => :date_time, :scale => 1, :unit => 's'
|
653
607
|
Fit::File::Definitions.add_field 51, 0, 'systolic_pressure', :type => :uint16, :scale => 1, :unit => 'mmHg'
|
@@ -661,13 +615,10 @@ Fit::File::Definitions.add_field 51, 7, 'heart_rate_type', :type => :hr_type
|
|
661
615
|
Fit::File::Definitions.add_field 51, 8, 'status', :type => :bp_status
|
662
616
|
Fit::File::Definitions.add_field 51, 9, 'user_profile_index', :type => :message_index
|
663
617
|
|
664
|
-
Fit::File::Definitions.add_name
|
665
|
-
Fit::File::Definitions.add_field
|
666
|
-
Fit::File::Definitions.add_field
|
667
|
-
Fit::File::Definitions.add_field
|
668
|
-
Fit::File::Definitions.add_field 103, 3, 'cycles_to_distance', :type => :uint16, :scale => 5000, :unit => 'm/cycle'
|
669
|
-
Fit::File::Definitions.add_field 103, 4, 'cycles_to_calories', :type => :uint16, :scale => 5000, :unit => 'kcal/cycle'
|
670
|
-
Fit::File::Definitions.add_field 103, 5, 'resting_metabolic_rate', :type => :uint16, :unit => 'kcal / day'
|
618
|
+
Fit::File::Definitions.add_name 53, 'speed_zone'
|
619
|
+
Fit::File::Definitions.add_field 53, 254, 'message_index', :type => :message_index, :scale => 1
|
620
|
+
Fit::File::Definitions.add_field 53, 0, 'high_value', :type => :uint16, :scale => 1000, :unit => 'm/s'
|
621
|
+
Fit::File::Definitions.add_field 53, 1, 'name', :type => :string, :scale => 1
|
671
622
|
|
672
623
|
Fit::File::Definitions.add_name 55, 'monitoring'
|
673
624
|
Fit::File::Definitions.add_field 55, 253, 'timestamp', :type => :date_time, :unit => 's'
|
@@ -698,12 +649,125 @@ Fit::File::Definitions.add_field 55, 28, 'intensity', :type => :uint8, :scale =>
|
|
698
649
|
Fit::File::Definitions.add_field 55, 29, 'duration_min', :type => :uint16, :unit => 'min'
|
699
650
|
Fit::File::Definitions.add_field 55, 30, 'duration', :type => :uint32, :unit => 's'
|
700
651
|
|
652
|
+
Fit::File::Definitions.add_name 72, 'training_file'
|
653
|
+
Fit::File::Definitions.add_field 72, 253, 'timestamp', :type => :date_time
|
654
|
+
Fit::File::Definitions.add_field 72, 0, 'type', :type => :file
|
655
|
+
Fit::File::Definitions.add_field 72, 1, 'manufacturer', :type => :manufacturer
|
656
|
+
Fit::File::Definitions.add_field 72, 2, 'product', :type => :uint16
|
657
|
+
Fit::File::Definitions.add_field 72, 2, 'garmin_product', :type => :garmin_product, :ref_field_name => 'manufacturer', :ref_field_values => [:garmin, :dynastream, :dynastream_oem]
|
658
|
+
Fit::File::Definitions.add_field 72, 3, 'serial_number', :type => :uint32z
|
659
|
+
Fit::File::Definitions.add_field 72, 4, 'time_created', :type => :date_time
|
660
|
+
|
661
|
+
Fit::File::Definitions.add_name 78, 'hrv'
|
662
|
+
Fit::File::Definitions.add_field 78, 0, 'time', :type => :uint16, :scale => 1000, :unit => 's'
|
663
|
+
|
664
|
+
# 80
|
665
|
+
# 81
|
666
|
+
# 82
|
667
|
+
|
668
|
+
Fit::File::Definitions.add_name 101, 'length'
|
669
|
+
Fit::File::Definitions.add_field 101, 254, 'message_index', :type => :message_index, :scale => 1
|
670
|
+
Fit::File::Definitions.add_field 101, 253, 'timestamp', :type => :date_time, :scale => 1
|
671
|
+
Fit::File::Definitions.add_field 101, 0, 'event', :type => :event
|
672
|
+
Fit::File::Definitions.add_field 101, 1, 'event_type', :type => :event_type
|
673
|
+
Fit::File::Definitions.add_field 101, 2, 'start_time', :type => :date_time, :scale => 1
|
674
|
+
Fit::File::Definitions.add_field 101, 3, 'total_elapsed_time', :type => :uint32, :scale => 1000, :unit => 's'
|
675
|
+
Fit::File::Definitions.add_field 101, 4, 'total_timer_time', :type => :uint32, :scale => 1000, :unit => 's'
|
676
|
+
Fit::File::Definitions.add_field 101, 5, 'total_strokes', :type => :uint16, :scale => 1, :unit => 'strokes'
|
677
|
+
Fit::File::Definitions.add_field 101, 6, 'avg_speed', :type => :uint16, :scale => 1000, :unit => 'm/s'
|
678
|
+
Fit::File::Definitions.add_field 101, 7, 'swim_stroke', :type => :swim_stroke, :unit => 'swim_stroke'
|
679
|
+
Fit::File::Definitions.add_field 101, 9, 'avg_swimming_cadence', :type => :uint8, :unit => 'strokes/min'
|
680
|
+
Fit::File::Definitions.add_field 101, 10, 'event_group', :type => :uint8
|
681
|
+
Fit::File::Definitions.add_field 101, 11, 'total_calories', :type => :uint16, :unit => 'kcal'
|
682
|
+
Fit::File::Definitions.add_field 101, 12, 'length_type', :type => :length_type
|
683
|
+
Fit::File::Definitions.add_field 101, 18, 'player_score', :type => :uint16
|
684
|
+
Fit::File::Definitions.add_field 101, 19, 'opponent_score', :type => :uint16
|
685
|
+
Fit::File::Definitions.add_field 101, 20, 'stroke_count', :type => :uint16, :unit => 'counts'
|
686
|
+
Fit::File::Definitions.add_field 101, 21, 'zone_count', :type => :uint16, :unit => 'counts'
|
687
|
+
|
688
|
+
Fit::File::Definitions.add_name 103, 'monitoring_info'
|
689
|
+
Fit::File::Definitions.add_field 103, 253, 'timestamp', :type => :date_time
|
690
|
+
Fit::File::Definitions.add_field 103, 0, 'local_timestamp', :type => :local_date_time
|
691
|
+
Fit::File::Definitions.add_field 103, 1, 'activity_type', :type => :activity_type
|
692
|
+
Fit::File::Definitions.add_field 103, 3, 'cycles_to_distance', :type => :uint16, :scale => 5000, :unit => 'm/cycle'
|
693
|
+
Fit::File::Definitions.add_field 103, 4, 'cycles_to_calories', :type => :uint16, :scale => 5000, :unit => 'kcal/cycle'
|
694
|
+
Fit::File::Definitions.add_field 103, 5, 'resting_metabolic_rate', :type => :uint16, :unit => 'kcal / day'
|
695
|
+
|
696
|
+
# 105
|
697
|
+
|
698
|
+
Fit::File::Definitions.add_name 106, 'slave_device'
|
699
|
+
Fit::File::Definitions.add_field 106, 0, 'manufacturer', :type => :manufacturer
|
700
|
+
Fit::File::Definitions.add_field 106, 1, 'product', :type => :uint16
|
701
|
+
Fit::File::Definitions.add_field 106, 1, 'garmin_product', :type => :garmin_product, :ref_field_name => 'manufacturer', :ref_field_values => [:garmin, :dynastream, :dynastream_oem]
|
702
|
+
|
703
|
+
# 127
|
704
|
+
# 128
|
705
|
+
# 129
|
706
|
+
|
707
|
+
Fit::File::Definitions.add_name 131, 'cadence_zone'
|
708
|
+
Fit::File::Definitions.add_field 131, 254, 'message_index', :type => :message_index, :scale => 1
|
709
|
+
Fit::File::Definitions.add_field 131, 0, 'high_value', :type => :uint8, :scale => 1, :unit => 'rpm'
|
710
|
+
Fit::File::Definitions.add_field 131, 1, 'name', :type => :string, :scale => 1
|
711
|
+
|
712
|
+
# 132
|
713
|
+
# 142
|
714
|
+
|
701
715
|
Fit::File::Definitions.add_name 145, 'memo_glob'
|
702
716
|
Fit::File::Definitions.add_field 145, 250, 'part_index', :type => :uint32
|
703
717
|
Fit::File::Definitions.add_field 145, 0, 'memo', :type => :byte
|
704
718
|
Fit::File::Definitions.add_field 145, 1, 'message_number', :type => :uint16
|
705
719
|
Fit::File::Definitions.add_field 145, 2, 'message_index', :type => :message_index
|
706
720
|
|
721
|
+
# 148
|
722
|
+
# 149
|
723
|
+
# 150
|
724
|
+
# 151
|
725
|
+
# 158
|
726
|
+
# 159
|
727
|
+
# 160
|
728
|
+
# 161
|
729
|
+
# 162
|
730
|
+
# 164
|
731
|
+
# 165
|
732
|
+
# 167
|
733
|
+
# 169
|
734
|
+
# 174
|
735
|
+
# 177
|
736
|
+
# 178
|
737
|
+
# 184
|
738
|
+
# 185
|
739
|
+
# 186
|
740
|
+
# 187
|
741
|
+
# 188
|
742
|
+
# 200
|
743
|
+
# 201
|
744
|
+
# 202
|
745
|
+
|
746
|
+
Fit::File::Definitions.add_name 206, 'field_description'
|
747
|
+
Fit::File::Definitions.add_field 206, 0, 'developer_data_index', :type => :uint8
|
748
|
+
Fit::File::Definitions.add_field 206, 1, 'field_definition_number', :type => :uint8
|
749
|
+
Fit::File::Definitions.add_field 206, 2, 'fit_base_type_id ', :type => :fit_base_type
|
750
|
+
Fit::File::Definitions.add_field 206, 3, 'field_name ', :type => :string
|
751
|
+
Fit::File::Definitions.add_field 206, 4, 'array', :type => :uint8
|
752
|
+
Fit::File::Definitions.add_field 206, 5, 'components ', :type => :string
|
753
|
+
Fit::File::Definitions.add_field 206, 6, 'scale', :type => :uint8
|
754
|
+
Fit::File::Definitions.add_field 206, 7, 'offset ', :type => :sint8
|
755
|
+
Fit::File::Definitions.add_field 206, 8, 'units', :type => :string
|
756
|
+
Fit::File::Definitions.add_field 206, 9, 'bits ', :type => :string
|
757
|
+
Fit::File::Definitions.add_field 206, 10, 'accumulate ', :type => :string
|
758
|
+
Fit::File::Definitions.add_field 206, 13, 'fit_base_unit_id ', :type => :fit_base_unit
|
759
|
+
Fit::File::Definitions.add_field 206, 14, 'native_mesg_num', :type => :mesg_num
|
760
|
+
Fit::File::Definitions.add_field 206, 15, 'native_field_num ', :type => :uint8
|
761
|
+
|
762
|
+
Fit::File::Definitions.add_name 207, 'developer_data_id'
|
763
|
+
Fit::File::Definitions.add_field 207, 0, 'developer_id ', :type => :byte
|
764
|
+
Fit::File::Definitions.add_field 207, 1, 'application_id ', :type => :byte
|
765
|
+
Fit::File::Definitions.add_field 207, 2, 'manufacturer_id', :type => :manufacturer
|
766
|
+
Fit::File::Definitions.add_field 207, 3, 'developer_data_index ', :type => :uint8
|
767
|
+
Fit::File::Definitions.add_field 207, 4, 'application_version', :type => :uint32
|
768
|
+
|
769
|
+
# 208
|
770
|
+
|
707
771
|
# =============================================================================
|
708
772
|
# Warning, the definition below are not part of the official fit format
|
709
773
|
# definition. They have been obtained by deduction from Garmin Swim files
|
data/lib/fit/file/header.rb
CHANGED
File without changes
|
data/lib/fit/file/record.rb
CHANGED
File without changes
|
@@ -1,12 +1,14 @@
|
|
1
1
|
module Fit
|
2
2
|
class File
|
3
3
|
class RecordHeader < BinData::Record
|
4
|
+
# described in section 4.1 Record Header Byte of the FIT Protocol documentation
|
4
5
|
hide :reserved_bits
|
5
6
|
|
6
7
|
bit1 :header_type
|
7
8
|
|
8
9
|
bit1 :message_type, :onlyif => :normal?
|
9
|
-
|
10
|
+
bit1 :message_type_specific, :initial_value => 0, :onlyif => :normal?
|
11
|
+
bit1 :reserved_bits, :onlyif => :normal?
|
10
12
|
|
11
13
|
choice :local_message_type, :selection => :header_type do
|
12
14
|
bit4 0
|
@@ -22,6 +24,10 @@ module Fit
|
|
22
24
|
def compressed_timestamp?
|
23
25
|
header_type == 1
|
24
26
|
end
|
27
|
+
|
28
|
+
def developer_data?
|
29
|
+
message_type_specific == 1
|
30
|
+
end
|
25
31
|
end
|
26
32
|
end
|
27
33
|
end
|
data/lib/fit/file/type.rb
CHANGED
File without changes
|
data/lib/fit/file/types.rb
CHANGED
File without changes
|
data/lib/fit/file.rb
CHANGED
File without changes
|
data/lib/fit/version.rb
CHANGED
data/lib/fit.rb
CHANGED
File without changes
|
data/spec/file/data_spec.rb
CHANGED
File without changes
|
@@ -10,16 +10,16 @@ describe Fit::File::Definition do
|
|
10
10
|
its(:architecture) { should == 0 }
|
11
11
|
its(:global_message_number) { should == 0 }
|
12
12
|
its(:field_count) { should == 6 }
|
13
|
-
it { expect(subject.
|
13
|
+
it { expect(subject.fit_fields.size).to eq(subject.field_count) }
|
14
14
|
|
15
15
|
its(:record_type) { should == :definition }
|
16
16
|
it 'returns the real type for fields' do
|
17
|
-
expect(subject.
|
18
|
-
expect(subject.
|
19
|
-
expect(subject.
|
20
|
-
expect(subject.
|
21
|
-
expect(subject.
|
22
|
-
expect(subject.
|
17
|
+
expect(subject.fit_fields[0].real_type).to be == :uint32z
|
18
|
+
expect(subject.fit_fields[1].real_type).to be == :date_time
|
19
|
+
expect(subject.fit_fields[2].real_type).to be == :manufacturer
|
20
|
+
expect(subject.fit_fields[3].real_type).to be == :uint16 # product
|
21
|
+
expect(subject.fit_fields[4].real_type).to be == :uint16 # number
|
22
|
+
expect(subject.fit_fields[5].real_type).to be == :file
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -28,7 +28,7 @@ describe Fit::File::Definitions do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'raised an error for dynamic field data' do
|
31
|
-
expect { described_class.add_field(999, 999, 'rspec_test_dyn') }.to raise_error
|
31
|
+
expect { described_class.add_field(999, 999, 'rspec_test_dyn') }.to raise_error(RuntimeError)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
data/spec/file/header_spec.rb
CHANGED
File without changes
|
@@ -8,13 +8,30 @@ describe Fit::File::RecordHeader do
|
|
8
8
|
|
9
9
|
its(:header_type) { should == 0 }
|
10
10
|
its(:message_type) { should == 1 }
|
11
|
+
its(:message_type_specific) { should == 0}
|
11
12
|
its(:local_message_type) { should == 0 }
|
12
13
|
|
13
14
|
it { is_expected.to be_normal }
|
14
15
|
it { is_expected.not_to be_a_compressed_timestamp }
|
16
|
+
it { is_expected.not_to be_developer_data }
|
15
17
|
end
|
16
18
|
|
17
19
|
context "given a sample compressed timestamp header" do
|
18
20
|
# TODO
|
19
21
|
end
|
22
|
+
|
23
|
+
context "given a sample normal header with developer flag set" do
|
24
|
+
subject do
|
25
|
+
described_class.read example_file('record/normal_header_with_developer_flag')
|
26
|
+
end
|
27
|
+
|
28
|
+
its(:header_type) { should == 0 }
|
29
|
+
its(:message_type) { should == 1 }
|
30
|
+
its(:message_type_specific) { should == 1}
|
31
|
+
its(:local_message_type) { should == 0 }
|
32
|
+
|
33
|
+
it { is_expected.to be_normal }
|
34
|
+
it { is_expected.not_to be_a_compressed_timestamp }
|
35
|
+
it { is_expected.to be_developer_data }
|
36
|
+
end
|
20
37
|
end
|
data/spec/file/record_spec.rb
CHANGED
File without changes
|
data/spec/file/type_spec.rb
CHANGED
File without changes
|
data/spec/file/types_spec.rb
CHANGED
File without changes
|
data/spec/file_spec.rb
CHANGED
File without changes
|
data/spec/fit_spec.rb
CHANGED
File without changes
|
data/spec/spec_helper.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
`
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fit-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Wallace
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: '2.4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: '2.4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '6.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '6.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1
|
47
|
+
version: '2.1'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1
|
54
|
+
version: '2.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.
|
75
|
+
version: '3.10'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.
|
82
|
+
version: '3.10'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec-its
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,6 +179,7 @@ files:
|
|
179
179
|
- spec/support/examples/record/message/definition_lap.fit
|
180
180
|
- spec/support/examples/record/message/definition_session.fit
|
181
181
|
- spec/support/examples/record/normal_header
|
182
|
+
- spec/support/examples/record/normal_header_with_developer_flag
|
182
183
|
homepage: https://github.com/tjwallace/fit
|
183
184
|
licenses:
|
184
185
|
- MIT
|
@@ -198,8 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
199
|
- !ruby/object:Gem::Version
|
199
200
|
version: '0'
|
200
201
|
requirements: []
|
201
|
-
|
202
|
-
rubygems_version: 2.2.0
|
202
|
+
rubygems_version: 3.2.22
|
203
203
|
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: Ruby gem for reading Garmin FIT files
|
@@ -235,3 +235,4 @@ test_files:
|
|
235
235
|
- spec/support/examples/record/message/definition_lap.fit
|
236
236
|
- spec/support/examples/record/message/definition_session.fit
|
237
237
|
- spec/support/examples/record/normal_header
|
238
|
+
- spec/support/examples/record/normal_header_with_developer_flag
|