

command = "gatttool --device=DC:87:CC:18:14:A5  --char-write-req --handle=0x000f --value=0300 --listen"
status = IO.popen(command) do |out|
    out.each do |line|
    	
    	if(line =~ /Notification.*value: (.*)/)
    		puts line.strip + " decimal value: " + $1.strip.to_i(16).to_s
      else
        puts line
    	end
    end
end
