Class: GetDeviceInfoReply

Inherits:
Reply show all
Defined in:
lib/telegrams/commands/system/replies/get_device_info_reply.rb

Constant Summary

Constants inherited from Reply

Reply::COMMAND_TYPE, Reply::STATUS_MESSAGES, Reply::SUCCESS

Instance Attribute Summary collapse

Attributes inherited from Reply

#command, #message_bytes, #status, #status_description, #type

Attributes inherited from Telegram

#type

Instance Method Summary collapse

Methods inherited from Reply

#message, #success?

Methods inherited from Telegram

#as_bytes, #max_size_in_bytes

Constructor Details

#initialize(bytes) ⇒ GetDeviceInfoReply

Returns a new instance of GetDeviceInfoReply.

Raises:

  • (ArgumentError)


7
8
9
10
11
12
13
14
15
# File 'lib/telegrams/commands/system/replies/get_device_info_reply.rb', line 7

def initialize(bytes)
  super
  raise ArgumentError, "must be a GetDeviceInfoReply (0x9B)" unless bytes[1] == 0x9B

  @nxt_brick_name = parse_brick_name(bytes)
  @bt_address = parse_bt_address(bytes)
  @signal_strength = parse_signal_strength(bytes)
  @free_user_flash_memory_bytes = parse_free_user_flash_memory(bytes)
end

Instance Attribute Details

#bt_addressObject (readonly)

Returns the value of attribute bt_address.



4
5
6
# File 'lib/telegrams/commands/system/replies/get_device_info_reply.rb', line 4

def bt_address
  @bt_address
end

#free_user_flash_memory_bytesObject (readonly)

Returns the value of attribute free_user_flash_memory_bytes.



4
5
6
# File 'lib/telegrams/commands/system/replies/get_device_info_reply.rb', line 4

def free_user_flash_memory_bytes
  @free_user_flash_memory_bytes
end

#nxt_brick_nameObject (readonly)

Returns the value of attribute nxt_brick_name.



4
5
6
# File 'lib/telegrams/commands/system/replies/get_device_info_reply.rb', line 4

def nxt_brick_name
  @nxt_brick_name
end

#signal_strengthObject (readonly)

Returns the value of attribute signal_strength.



4
5
6
# File 'lib/telegrams/commands/system/replies/get_device_info_reply.rb', line 4

def signal_strength
  @signal_strength
end