Module: Z4box::BT

Defined in:
lib/z4box.rb

Overview

generic bluetooth wrapper

Class Method Summary collapse

Class Method Details

.availableObject



29
30
31
# File 'lib/z4box.rb', line 29

def self.available
  `bluetoothctl -- devices`.chomp
end

.connect(*d) ⇒ Object



23
24
25
# File 'lib/z4box.rb', line 23

def self.connect *d
  `bluetoothctl -- connect #{d[0] || ENV['BT']}`.chomp
end

.disconnect(*d) ⇒ Object



26
27
28
# File 'lib/z4box.rb', line 26

def self.disconnect *d
  `bluetoothctl -- disconnect #{d[0] || ENV['BT']}`.chomp
end

.pair(*d) ⇒ Object



17
18
19
# File 'lib/z4box.rb', line 17

def self.pair *d
  `bluetoothctl -- pair #{d[0] || ENV['BT']}`.chomp
end

.pairedObject



32
33
34
# File 'lib/z4box.rb', line 32

def self.paired
  `bluetoothctl -- paired-devices`.chomp
end

.trust(*d) ⇒ Object



20
21
22
# File 'lib/z4box.rb', line 20

def self.trust *d
  `bluetoothctl -- trust #{d[0] || ENV['BT']}`.chomp
end