Class: SerialCanBus::Request::AcceptanceCode

Inherits:
BitStruct
  • Object
show all
Defined in:
lib/serial_can_bus/request.rb

Overview

Configure Acceptance Code (ACn register of SJA1000).

Instance Method Summary collapse

Instance Method Details

#code=(code) ⇒ Object


154
155
156
# File 'lib/serial_can_bus/request.rb', line 154

def code=(code)
  self.value = code.to_s(16).rjust(8, '0').upcase
end

#valueObject

:attr_accessor: value acceptance code (String, 8 bytes), receive all frames by default, see code=() for automatic conversion from Bignum


152
# File 'lib/serial_can_bus/request.rb', line 152

string :value, 8*8, 'command', :default => '00000000'