|
Saturday, 20 February 2010 06:38 |
// This code i got here from this site...(thanks to jrobertson)is it possible to convert this to float or doubled than 1.0, 2.0, 3.0, etc?
deviceid = '00:12:D1:E6:57:BE'
range = ''
count = 0
while count < 1
# assuming the bt device is already connected get the signal strength value.
range = `hcitool rssi #{deviceid}`.chomp
if range.length > 0
puts range[/\w+$/]
else
puts 'connecting to the bluetooth device ...'
Thread.new{`rfcomm connect 0 #{deviceid}`}
end
sleep 7
end
 Read more: |