Module: Iot::Characteristic

Included in:
Iot
Defined in:
lib/iot/characteristic.rb

Instance Method Summary collapse

Instance Method Details

#charObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/iot/characteristic.rb', line 7

def char
  yaml = load_yaml_body

  deviceinfo = yaml["deviceinfo"]
  services = deviceinfo["services"]

  char_count = 0
  services.each do |service|
    puts "#{service["name"]}"

    chars = service["chars"]
    chars.each do |char|
      puts "#{char_count += 1}\t#{char["uuid"]}\t#{char["name"]}"
    end

    puts ""
  end
end