Sha256: 8b6d9181a352ddf5b8c88cba8f67861cef1752e0c06235b336bda1ae2e226475

Contents?: true

Size: 521 Bytes

Versions: 7

Compression:

Stored size: 521 Bytes

Contents

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

      bit1 :header_type

      bit1 :message_type, :onlyif => :normal?
      bit2 :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

7 entries across 7 versions & 1 rubygems

Version Path
fit_parser-0.0.8 lib/fit_parser/file/record_header.rb
fit_parser-0.0.7 lib/fit_parser/file/record_header.rb
fit_parser-0.0.6 lib/fit_parser/file/record_header.rb
fit_parser-0.0.5 lib/fit_parser/file/record_header.rb
fit_parser-0.0.4 lib/fit_parser/file/record_header.rb
fit_parser-0.0.2 lib/fit_parser/file/record_header.rb
fit_parser-0.0.1 lib/fit_parser/file/record_header.rb