Class: SerialCanBus::ISOTP::Consecutive

Inherits:
BitStruct
  • Object
show all
Defined in:
lib/serial_can_bus/iso-tp.rb

Overview

Subsequent data of a multi-frame packet

Instance Method Summary collapse

Instance Method Details

#dataObject

:attr_accessor: data frame data (binary)


87
# File 'lib/serial_can_bus/iso-tp.rb', line 87

rest     :data

#dindexObject

:attr_accessor: index consecutive packet index (Fixnum, 4 bits)


82
# File 'lib/serial_can_bus/iso-tp.rb', line 82

unsigned :dindex,  4, 'index'

#errorsObject


89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/serial_can_bus/iso-tp.rb', line 89

def errors
  errors = []

  if dindex > 15
    errors << "invalid index (#{dindex} > 15)"
  end

  if data.size > 7
    errors << "excessive data length (#{data.size} > 7)"
  end

  errors
end