Sha256: fef9ac3ca1de20a806b3ef0d0df093947b5c40284c05fd915f3b8f513285cc62

Contents?: true

Size: 515 Bytes

Versions: 3

Compression:

Stored size: 515 Bytes

Contents

module Fit
  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

3 entries across 3 versions & 2 rubygems

Version Path
fit-parser-0.0.2 lib/fit/file/record_header.rb
fit-parser-0.0.1 lib/fit/file/record_header.rb
garmin-fit-0.0.2 lib/fit/file/record_header.rb