Monday, April 19, 2010

Bluetooth discovery with Ruby

#!/usr/bin/ruby
#file: whereib.rb

deviceid = '00:0E:6D:29:38:EB'
devicename = 'Nokia 6600'

count = 0
while count <>
if `hcitool name #{deviceid}`.chomp == devicename
puts devicename + ' IN RANGE'
puts Time.now
else
puts devicename + ' OUT OF RANGE'
puts Time.now
end
sleep 7
end

No comments:

Post a Comment