Sha256: df7d9d7c502702dbefecb16eb5302c5f803895d2a89c004388b1c7d443c18437

Contents?: true

Size: 568 Bytes

Versions: 10

Compression:

Stored size: 568 Bytes

Contents

module FitParser
  class File
    class RecordHeader < BinData::Record
      hide :reserved_bits

      bit1 :header_type

      bit1 :message_type, :onlyif => :normal?
      bit1 :dev_data_flag, :onlyif => :normal?
      bit1 :reserved_bits, :onlyif => :normal?

      choice :local_message_type, :selection => :header_type do
        bit4 0
        bit2 1
      end

      bit5 :time_offset, :onlyif => :compressed_timestamp?

      def normal?
        header_type == 0
      end

      def compressed_timestamp?
        header_type == 1
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fit_parser-1.0.9 lib/fit_parser/file/record_header.rb
fit_parser-1.0.8 lib/fit_parser/file/record_header.rb
fit_parser-1.0.7 lib/fit_parser/file/record_header.rb
fit_parser-1.0.6 lib/fit_parser/file/record_header.rb
fit_parser-1.0.5 lib/fit_parser/file/record_header.rb
fit_parser-1.0.4 lib/fit_parser/file/record_header.rb
fit_parser-1.0.3 lib/fit_parser/file/record_header.rb
fit_parser-1.0.2 lib/fit_parser/file/record_header.rb
fit_parser-1.0.1 lib/fit_parser/file/record_header.rb
fit_parser-1.0.0 lib/fit_parser/file/record_header.rb