bluetooth 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.txt +4 -0
- data/Manifest.txt +21 -0
- data/README.txt +20 -0
- data/Rakefile +28 -0
- data/ext/bluetooth/extconf.rb +30 -0
- data/ext/bluetooth/linux/ruby_bluetooth.c +539 -0
- data/ext/bluetooth/linux/ruby_bluetooth.h +68 -0
- data/ext/bluetooth/macosx/device.m +230 -0
- data/ext/bluetooth/macosx/error.m +269 -0
- data/ext/bluetooth/macosx/host_controller.m +39 -0
- data/ext/bluetooth/macosx/ruby_bluetooth.h +69 -0
- data/ext/bluetooth/macosx/ruby_bluetooth.m +29 -0
- data/ext/bluetooth/macosx/scan.m +87 -0
- data/ext/bluetooth/win32/ruby_bluetooth.cpp +112 -0
- data/ext/bluetooth/win32/ruby_bluetooth.h +24 -0
- data/lib/bluetooth.rb +21 -0
- data/lib/bluetooth/device.rb +79 -0
- data/sample/name.rb +8 -0
- data/sample/pair.rb +15 -0
- data/sample/quality.rb +25 -0
- data/sample/scan.rb +8 -0
- metadata +178 -0
- metadata.gz.sig +0 -0
data/sample/name.rb
ADDED
data/sample/pair.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'bluetooth'
|
2
|
+
|
3
|
+
address = ARGV.shift || abort("#{$0} address pin")
|
4
|
+
|
5
|
+
device = Bluetooth::Device.new address
|
6
|
+
|
7
|
+
device.pair_confirmation do |number|
|
8
|
+
puts "The device should say %06d" % number
|
9
|
+
true
|
10
|
+
end
|
11
|
+
|
12
|
+
paired = device.pair ? "paired" : "didn't pair"
|
13
|
+
|
14
|
+
puts paired
|
15
|
+
|
data/sample/quality.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'bluetooth'
|
2
|
+
|
3
|
+
address = ARGV.shift || abort("#{$0} address # look up a device with scan.rb")
|
4
|
+
|
5
|
+
device = Bluetooth::Device.new address
|
6
|
+
|
7
|
+
begin
|
8
|
+
device.connect do
|
9
|
+
loop do
|
10
|
+
puts 'link quality: %3d RSSI: %4d dB' % [
|
11
|
+
device._link_quality, device._rssi
|
12
|
+
]
|
13
|
+
|
14
|
+
sleep 2
|
15
|
+
end
|
16
|
+
end
|
17
|
+
rescue Interrupt
|
18
|
+
exit
|
19
|
+
rescue Bluetooth::OfflineError
|
20
|
+
abort 'you need to enable bluetooth'
|
21
|
+
rescue Bluetooth::Error
|
22
|
+
puts "#{$!} (#{$!.class})"
|
23
|
+
retry
|
24
|
+
end
|
25
|
+
|
data/sample/scan.rb
ADDED
metadata
ADDED
@@ -0,0 +1,178 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bluetooth
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 15
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
version: "1.0"
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Eric Hodel
|
13
|
+
- Jeremie Castagna
|
14
|
+
- Esteve Fernandez
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain:
|
18
|
+
- |
|
19
|
+
-----BEGIN CERTIFICATE-----
|
20
|
+
MIIDNjCCAh6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBBMRAwDgYDVQQDDAdkcmJy
|
21
|
+
YWluMRgwFgYKCZImiZPyLGQBGRYIc2VnbWVudDcxEzARBgoJkiaJk/IsZAEZFgNu
|
22
|
+
ZXQwHhcNMDcxMjIxMDIwNDE0WhcNMDgxMjIwMDIwNDE0WjBBMRAwDgYDVQQDDAdk
|
23
|
+
cmJyYWluMRgwFgYKCZImiZPyLGQBGRYIc2VnbWVudDcxEzARBgoJkiaJk/IsZAEZ
|
24
|
+
FgNuZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCbbgLrGLGIDE76
|
25
|
+
LV/cvxdEzCuYuS3oG9PrSZnuDweySUfdp/so0cDq+j8bqy6OzZSw07gdjwFMSd6J
|
26
|
+
U5ddZCVywn5nnAQ+Ui7jMW54CYt5/H6f2US6U0hQOjJR6cpfiymgxGdfyTiVcvTm
|
27
|
+
Gj/okWrQl0NjYOYBpDi+9PPmaH2RmLJu0dB/NylsDnW5j6yN1BEI8MfJRR+HRKZY
|
28
|
+
mUtgzBwF1V4KIZQ8EuL6I/nHVu07i6IkrpAgxpXUfdJQJi0oZAqXurAV3yTxkFwd
|
29
|
+
g62YrrW26mDe+pZBzR6bpLE+PmXCzz7UxUq3AE0gPHbiMXie3EFE0oxnsU3lIduh
|
30
|
+
sCANiQ8BAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
31
|
+
BBS5k4Z75VSpdM0AclG2UvzFA/VW5DANBgkqhkiG9w0BAQUFAAOCAQEAHagT4lfX
|
32
|
+
kP/hDaiwGct7XPuVGbrOsKRVD59FF5kETBxEc9UQ1clKWngf8JoVuEoKD774dW19
|
33
|
+
bU0GOVWO+J6FMmT/Cp7nuFJ79egMf/gy4gfUfQMuvfcr6DvZUPIs9P/TlK59iMYF
|
34
|
+
DIOQ3DxdF3rMzztNUCizN4taVscEsjCcgW6WkUJnGdqlu3OHWpQxZBJkBTjPCoc6
|
35
|
+
UW6on70SFPmAy/5Cq0OJNGEWBfgD9q7rrs/X8GGwUWqXb85RXnUVi/P8Up75E0ag
|
36
|
+
14jEc90kN+C7oI/AGCBN0j6JnEtYIEJZibjjDJTSMWlUKKkj30kq7hlUC2CepJ4v
|
37
|
+
x52qPcexcYZR7w==
|
38
|
+
-----END CERTIFICATE-----
|
39
|
+
|
40
|
+
date: 2010-06-30 00:00:00 -07:00
|
41
|
+
default_executable:
|
42
|
+
dependencies:
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: rubyforge
|
45
|
+
prerelease: false
|
46
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
hash: 9
|
52
|
+
segments:
|
53
|
+
- 2
|
54
|
+
- 0
|
55
|
+
- 3
|
56
|
+
version: 2.0.3
|
57
|
+
type: :development
|
58
|
+
version_requirements: *id001
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: gemcutter
|
61
|
+
prerelease: false
|
62
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
hash: 11
|
68
|
+
segments:
|
69
|
+
- 0
|
70
|
+
- 5
|
71
|
+
- 0
|
72
|
+
version: 0.5.0
|
73
|
+
type: :development
|
74
|
+
version_requirements: *id002
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rake-compiler
|
77
|
+
prerelease: false
|
78
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
hash: 7
|
84
|
+
segments:
|
85
|
+
- 0
|
86
|
+
- 6
|
87
|
+
version: "0.6"
|
88
|
+
type: :development
|
89
|
+
version_requirements: *id003
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: hoe
|
92
|
+
prerelease: false
|
93
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
hash: 27
|
99
|
+
segments:
|
100
|
+
- 2
|
101
|
+
- 5
|
102
|
+
- 0
|
103
|
+
version: 2.5.0
|
104
|
+
type: :development
|
105
|
+
version_requirements: *id004
|
106
|
+
description: A bluetooth library for ruby
|
107
|
+
email:
|
108
|
+
- drbrain@segment7.net
|
109
|
+
- ""
|
110
|
+
- ""
|
111
|
+
executables: []
|
112
|
+
|
113
|
+
extensions:
|
114
|
+
- ext/bluetooth/extconf.rb
|
115
|
+
extra_rdoc_files:
|
116
|
+
- History.txt
|
117
|
+
- Manifest.txt
|
118
|
+
- README.txt
|
119
|
+
files:
|
120
|
+
- History.txt
|
121
|
+
- Manifest.txt
|
122
|
+
- README.txt
|
123
|
+
- Rakefile
|
124
|
+
- ext/bluetooth/extconf.rb
|
125
|
+
- ext/bluetooth/linux/ruby_bluetooth.c
|
126
|
+
- ext/bluetooth/linux/ruby_bluetooth.h
|
127
|
+
- ext/bluetooth/macosx/device.m
|
128
|
+
- ext/bluetooth/macosx/error.m
|
129
|
+
- ext/bluetooth/macosx/host_controller.m
|
130
|
+
- ext/bluetooth/macosx/ruby_bluetooth.h
|
131
|
+
- ext/bluetooth/macosx/ruby_bluetooth.m
|
132
|
+
- ext/bluetooth/macosx/scan.m
|
133
|
+
- ext/bluetooth/win32/ruby_bluetooth.cpp
|
134
|
+
- ext/bluetooth/win32/ruby_bluetooth.h
|
135
|
+
- lib/bluetooth.rb
|
136
|
+
- lib/bluetooth/device.rb
|
137
|
+
- sample/name.rb
|
138
|
+
- sample/pair.rb
|
139
|
+
- sample/quality.rb
|
140
|
+
- sample/scan.rb
|
141
|
+
has_rdoc: true
|
142
|
+
homepage: http://github.com/yaksnrainbows/ruby-bluetooth
|
143
|
+
licenses: []
|
144
|
+
|
145
|
+
post_install_message:
|
146
|
+
rdoc_options:
|
147
|
+
- --main
|
148
|
+
- README.txt
|
149
|
+
require_paths:
|
150
|
+
- lib
|
151
|
+
- ext
|
152
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
hash: 3
|
158
|
+
segments:
|
159
|
+
- 0
|
160
|
+
version: "0"
|
161
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
|
+
none: false
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
hash: 3
|
167
|
+
segments:
|
168
|
+
- 0
|
169
|
+
version: "0"
|
170
|
+
requirements: []
|
171
|
+
|
172
|
+
rubyforge_project: bluetooth
|
173
|
+
rubygems_version: 1.3.7
|
174
|
+
signing_key:
|
175
|
+
specification_version: 3
|
176
|
+
summary: A bluetooth library for ruby
|
177
|
+
test_files: []
|
178
|
+
|
metadata.gz.sig
ADDED
Binary file
|