class SpheroPwn::Commands::SetDeviceMode

Asks the robot about the versions of its software stack components.

Public Class Methods

new(mode) click to toggle source
Calls superclass method SpheroPwn::Command::new
# File lib/sphero_pwn/commands/set_device_mode.rb, line 3
def initialize(mode)

  mode_byte = case mode
  when :normal
    0x00
  when :user_hack
    0x01
  else
    raise ArgumentError, "Unimplemented mode #{mode.inspect}"
  end

  super 0x02, 0x42, [mode_byte]
end

Public Instance Methods

response_class() click to toggle source

@see {SpheroPwn::Command#response_class}

# File lib/sphero_pwn/commands/set_device_mode.rb, line 18
def response_class
  SpheroPwn::Commands::SetDeviceMode::Response
end