Class: ScanBeacon::CoreBluetoothAdvertiser
Instance Attribute Summary
#ad, #advertising, #beacon, #parser
Instance Method Summary
collapse
#beacon=, #parser=, #update_ad
Constructor Details
Returns a new instance of CoreBluetoothAdvertiser.
4
5
6
|
# File 'lib/scan_beacon/core_bluetooth_advertiser.rb', line 4
def initialize(opts = {})
super
end
|
Instance Method Details
#ad=(value) ⇒ Object
8
9
10
11
|
# File 'lib/scan_beacon/core_bluetooth_advertiser.rb', line 8
def ad=(value)
@ad = value
CoreBluetooth.set_advertisement_data @ad
end
|
#inspect ⇒ Object
27
28
29
|
# File 'lib/scan_beacon/core_bluetooth_advertiser.rb', line 27
def inspect
"<CoreBluetoothAdvertiser ad=#{@ad.inspect}>"
end
|
#rotate_addr_and_update_ad ⇒ Object
21
22
23
24
25
|
# File 'lib/scan_beacon/core_bluetooth_advertiser.rb', line 21
def rotate_addr_and_update_ad
self.update_ad
self.stop
self.start(true)
end
|
#start(with_rotation = false) ⇒ Object
13
14
15
|
# File 'lib/scan_beacon/core_bluetooth_advertiser.rb', line 13
def start(with_rotation = false)
CoreBluetooth.start_advertising(with_rotation)
end
|
#stop ⇒ Object
17
18
19
|
# File 'lib/scan_beacon/core_bluetooth_advertiser.rb', line 17
def stop
CoreBluetooth.stop_advertising
end
|