Bluetooth LE - #inspect 2013 - Brussels, Belgium - 28 March 2013
This was from my talk at the RubyMotion #inspect 2013 conference on using Bluetooth LE from RubyMotion. It was a wonderful conference organized by HipByte and there was amazing beer!
06 07 08 09 10 11 12 13 SIG Form ed Bluetooth 1.0 Headset, U SB Laptop/M ouse G PS, Cam era Bluetooth 1.2 Bluetooth 2.0 4k SIG M em bers 1B Devices TV/Radio 2B Devices Bluetooth 3.0 Bluetooth 4.0 M acM ini/A ir iPhone 5/iPad M ini 18k SIG M em bers 1mb/s 3mb/s 54mb/s ~260kb/s Our focus
advertisementData: data, # Hash RSSI: rssi #Signal strength...distance ) #do something with the discovered peripheral #NOTE: peripheral name/uuid may or may not be set... end
error || !peripheral.services peripheral.services.each do |service| # if service.UUID == CBUUID.UUIDWithString("XXXX") # do something specific # end peripheral.discoverCharacteristics nil, forService:service end end
if error || !service.characteristics service.characteristics.each do |char| if char.UUID == CBUUID.UUIDWithString("XXXX") peripheral.readValueForCharacteristic char end if char.UUID == CBUUID.UUIDWithString("YYYY") peripheral.setNotifyValue(true, forCharacteristic:char) end end end