artoo 1.0.0 → 1.1.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTORS.md +14 -10
- data/Gemfile.lock +8 -8
- data/README.md +26 -6
- data/artoo.gemspec +2 -2
- data/bin/artoo +1 -0
- data/lib/artoo/adaptors/adaptor.rb +1 -1
- data/lib/artoo/commands/commands.rb +15 -0
- data/lib/artoo/commands/connect.rb +15 -15
- data/lib/artoo/commands/install.rb +3 -4
- data/lib/artoo/robot.rb +2 -0
- data/lib/artoo/version.rb +1 -1
- data/test/adaptors/adaptor_test.rb +1 -2
- data/test/drivers/driver_test.rb +1 -2
- data/test/test_helper.rb +5 -0
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f305a1606ec83852aff4b8334d5a736c69819da0
|
4
|
+
data.tar.gz: 82916bb9719f1aaa4409ea1cbb4be3ee65708bc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a214bb8e9fcdacf46d28a15421c0e546baa764924a55baa9385d9c2d4242eaac98b5ae6753e400dbce8bcc93db7d90563a6828d641c7677c38119efddc2f093
|
7
|
+
data.tar.gz: 203a70fbc509da52603629cfe8d2e9318e83d1c57776f622be3e68148be99c2fba0cdce721572f1e604bc256d933ea0dfc760f5c76dc20da918546335077c99c
|
data/CONTRIBUTORS.md
CHANGED
@@ -1,15 +1,19 @@
|
|
1
|
+
# Contributors
|
2
|
+
|
1
3
|
Artoo exists thanks to the work of these wonderful individuals:
|
2
4
|
|
3
|
-
- Adrian Zankich (@adzankich)
|
4
|
-
- Andrew Stewart (@stewart)
|
5
|
-
- Ari Lerner (@auser)
|
6
|
-
- Daniel Fischer (@dfischer)
|
7
|
-
- Jake Good (@whoisjake)
|
8
|
-
- Javier Cervantes (@solojavier)
|
9
|
-
- Kurtis Rainbolt-Greene
|
10
|
-
- Mario "Kuroir" Ricalde
|
11
|
-
- Mike Ford (@mikejford)
|
12
|
-
-
|
5
|
+
- Adrian Zankich ([@adzankich](https://github.com/adzankich))
|
6
|
+
- Andrew Stewart ([@stewart](https://github.com/stewart))
|
7
|
+
- Ari Lerner ([@auser](https://github.com/auser))
|
8
|
+
- Daniel Fischer ([@dfischer](https://github.com/dfischer))
|
9
|
+
- Jake Good ([@whoisjake](https://github.com/whoisjake))
|
10
|
+
- Javier Cervantes ([@solojavier](https://github.com/solojavier))
|
11
|
+
- Kurtis Rainbolt-Greene([@krainboltgreene] (https://github.com/krainboltgreene))
|
12
|
+
- Mario "Kuroir" Ricalde([@MarioRicalde] (https://github.com/MarioRicalde))
|
13
|
+
- Mike Ford ([@mikejford](https://github.com/mikejford))
|
14
|
+
- Rafael Magana ([@rafmagana](https://github.com/rafmagana))
|
15
|
+
- Ron Evans ([@deadprogram](https://github.com/deadprogram))
|
16
|
+
- Tim Uruski ([@timuruski](https://github.com/timuruski))
|
13
17
|
|
14
18
|
Thank you!
|
15
19
|
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
artoo (1.0.
|
5
|
-
celluloid (~> 0.
|
6
|
-
celluloid-io (~> 0.
|
4
|
+
artoo (1.1.0.pre)
|
5
|
+
celluloid (~> 0.15.0.pre2)
|
6
|
+
celluloid-io (~> 0.15.0.pre2)
|
7
7
|
multi_json (~> 1.6)
|
8
8
|
pry (~> 0.9)
|
9
9
|
rake (~> 10.0)
|
@@ -15,11 +15,11 @@ GEM
|
|
15
15
|
specs:
|
16
16
|
bootstrap-sass (2.3.2.1)
|
17
17
|
sass (~> 3.2)
|
18
|
-
celluloid (0.
|
18
|
+
celluloid (0.15.0.pre2)
|
19
19
|
timers (>= 1.0.0)
|
20
|
-
celluloid-io (0.
|
21
|
-
celluloid (>= 0.
|
22
|
-
nio4r (>= 0.
|
20
|
+
celluloid-io (0.15.0.pre2)
|
21
|
+
celluloid (>= 0.15.0.pre)
|
22
|
+
nio4r (>= 0.5.0)
|
23
23
|
certified (0.1.1)
|
24
24
|
chunky_png (1.2.8)
|
25
25
|
coderay (1.0.9)
|
@@ -75,7 +75,7 @@ GEM
|
|
75
75
|
mocha (0.14.0)
|
76
76
|
metaclass (~> 0.0.1)
|
77
77
|
multi_json (1.7.7)
|
78
|
-
nio4r (0.
|
78
|
+
nio4r (0.5.0)
|
79
79
|
pry (0.9.12.2)
|
80
80
|
coderay (~> 1.0.5)
|
81
81
|
method_source (~> 0.8)
|
data/README.md
CHANGED
@@ -229,11 +229,11 @@ Artoo makes it a lot easier to connect TCP Socket to Bluetooth and serial port d
|
|
229
229
|
|
230
230
|
```
|
231
231
|
$ artoo connect
|
232
|
-
|
233
|
-
artoo connect bind
|
234
|
-
artoo connect help [COMMAND]
|
235
|
-
artoo connect scan
|
236
|
-
artoo connect
|
232
|
+
connect commands:
|
233
|
+
artoo connect bind [ADDRESS] [NAME] # Binds a Bluetooth device to some connected hardware
|
234
|
+
artoo connect help [COMMAND] # Describe subcommands or one specific subcommand
|
235
|
+
artoo connect scan # Scan for connected devices
|
236
|
+
artoo connect serial [NAME] [PORT] # Connect a serial device to a TCP socket using socat
|
237
237
|
```
|
238
238
|
|
239
239
|
You can scan your computer for paired Bluetooth devices, bind them to unix ports, and connect socket to serial interfaces, easily from the command line!
|
@@ -266,7 +266,27 @@ D, [2013-07-03T17:12:04.414300 #5527] DEBUG -- : Shutdown completed cleanly
|
|
266
266
|
|
267
267
|
### Generator
|
268
268
|
|
269
|
-
Want to integrate a
|
269
|
+
Want to integrate a hardware device we don't have Artoo support for yet? There's a generator for that! You can easily generate a new skeleton Artoo adaptor to help you get started. Simply run the 'artoo generate adaptor' command, and the generator will create a new directory with all of the files in place for your new adaptor gem.
|
270
|
+
|
271
|
+
```
|
272
|
+
$ artoo generate adaptor awesome_device
|
273
|
+
Creating artoo-awesome_device adaptor...
|
274
|
+
create artoo-awesome_device
|
275
|
+
exist artoo-awesome_device
|
276
|
+
create artoo-awesome_device/Gemfile
|
277
|
+
create artoo-awesome_device/LICENSE
|
278
|
+
create artoo-awesome_device/README.md
|
279
|
+
create artoo-awesome_device/Rakefile
|
280
|
+
create artoo-awesome_device/artoo-awesome_device.gemspec
|
281
|
+
create artoo-awesome_device/lib/artoo-awesome_device.rb
|
282
|
+
create artoo-awesome_device/lib/artoo-awesome_device/version.rb
|
283
|
+
create artoo-awesome_device/lib/artoo/adaptors/awesome_device.rb
|
284
|
+
create artoo-awesome_device/lib/artoo/drivers/awesome_device.rb
|
285
|
+
create artoo-awesome_device/test/adaptors/awesome_device_adaptor_test.rb
|
286
|
+
create artoo-awesome_device/test/drivers/awesome_device_driver_test.rb
|
287
|
+
create artoo-awesome_device/test/test_helper.rb
|
288
|
+
Done!
|
289
|
+
```
|
270
290
|
|
271
291
|
## Wiki
|
272
292
|
|
data/artoo.gemspec
CHANGED
@@ -20,8 +20,8 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
21
|
s.require_paths = ["lib"]
|
22
22
|
|
23
|
-
s.add_runtime_dependency 'celluloid', '~> 0.
|
24
|
-
s.add_runtime_dependency 'celluloid-io', '~> 0.
|
23
|
+
s.add_runtime_dependency 'celluloid', '~> 0.15.0.pre2'
|
24
|
+
s.add_runtime_dependency 'celluloid-io', '~> 0.15.0.pre2'
|
25
25
|
s.add_runtime_dependency 'reel', '~> 0.4.0.pre'
|
26
26
|
s.add_runtime_dependency 'multi_json', '~> 1.6'
|
27
27
|
s.add_runtime_dependency 'rake', '~> 10.0'
|
data/bin/artoo
CHANGED
@@ -74,7 +74,7 @@ module Artoo
|
|
74
74
|
# @param stop_bits [int]
|
75
75
|
# @param parity
|
76
76
|
# @return [SerialPort] new connection
|
77
|
-
def connect_to_serial(speed=57600, data_bits=8, stop_bits=1, parity
|
77
|
+
def connect_to_serial(speed=57600, data_bits=8, stop_bits=1, parity=nil)
|
78
78
|
require 'serialport'
|
79
79
|
parity = ::SerialPort::NONE unless parity
|
80
80
|
@sp = ::SerialPort.new(port.port, speed, data_bits, stop_bits, parity)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'thor/group'
|
3
|
+
|
4
|
+
module Artoo
|
5
|
+
module Commands
|
6
|
+
class Commands < Thor
|
7
|
+
include Thor::Actions
|
8
|
+
include Artoo::Utility
|
9
|
+
|
10
|
+
def self.banner(command, namespace = nil, subcommand = false)
|
11
|
+
"#{basename} #{@package_name} #{command.usage}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -3,32 +3,31 @@ require 'thor/group'
|
|
3
3
|
|
4
4
|
module Artoo
|
5
5
|
module Commands
|
6
|
-
class Connect <
|
7
|
-
|
8
|
-
include Artoo::Utility
|
6
|
+
class Connect < Commands
|
7
|
+
package_name "connect"
|
9
8
|
|
10
|
-
desc "scan", "
|
11
|
-
option :type, :default => "bluetooth", :desc => "type of scan [bluetooth, serial]"
|
9
|
+
desc "scan", "Scan for connected devices"
|
10
|
+
option :type, :aliases => "-t", :default => "bluetooth", :desc => "type of scan [bluetooth, serial]"
|
12
11
|
def scan
|
13
12
|
case os
|
14
13
|
when :linux
|
15
14
|
if options[:type] == 'bluetooth'
|
16
15
|
run("hcitool scan")
|
17
16
|
elsif options[:type] == 'serial'
|
18
|
-
run("ls /dev/tty
|
17
|
+
run("ls /dev/tty*")
|
19
18
|
else
|
20
19
|
say "ERROR: scan type '#{options[:type]}' not supported!"
|
21
20
|
end
|
22
21
|
when :macosx
|
23
|
-
run("ls /dev/tty
|
22
|
+
run("ls /dev/tty*")
|
24
23
|
else
|
25
24
|
say "OS not yet supported..."
|
26
25
|
end
|
27
26
|
end
|
28
27
|
|
29
|
-
desc "bind
|
30
|
-
option :comm, :default => 0, :desc => "Comm number"
|
31
|
-
option :radio, :default => "hci0", :desc => "Bluetooth radio address"
|
28
|
+
desc "bind [ADDRESS] [NAME]", "Binds a Bluetooth device to some connected hardware"
|
29
|
+
option :comm, :aliases => "-c", :default => 0, :desc => "Comm number"
|
30
|
+
option :radio, :aliases => "-r", :default => "hci0", :desc => "Bluetooth radio address"
|
32
31
|
def bind(address, name)
|
33
32
|
case os
|
34
33
|
when :linux
|
@@ -41,9 +40,10 @@ module Artoo
|
|
41
40
|
end
|
42
41
|
end
|
43
42
|
|
44
|
-
desc "
|
45
|
-
option :retries, :default => 0, :desc => "Number of times to retry connecting on failure"
|
46
|
-
|
43
|
+
desc "serial [NAME] [PORT]", "Connect a serial device to a TCP socket using socat"
|
44
|
+
option :retries, :aliases => "-r", :default => 0, :desc => "Number of times to retry connecting on failure"
|
45
|
+
option :baudrate, :aliases => "-b", :default => 57600, :desc => "Baud rate to use to connect to the serial device"
|
46
|
+
def serial(name, port)
|
47
47
|
attempts = 1 + options[:retries].to_i
|
48
48
|
|
49
49
|
case os
|
@@ -51,14 +51,14 @@ module Artoo
|
|
51
51
|
run("sudo chmod a+rw /dev/#{name}")
|
52
52
|
|
53
53
|
while(attempts > 0) do
|
54
|
-
run("socat -d -d FILE:/dev/#{name},nonblock,raw,
|
54
|
+
run("socat -d -d FILE:/dev/#{name},nonblock,raw,b#{options[:baudrate]},echo=0 TCP-LISTEN:#{port},fork")
|
55
55
|
break unless $? == 1
|
56
56
|
attempts -= 1
|
57
57
|
end
|
58
58
|
|
59
59
|
when :macosx
|
60
60
|
while(attempts > 0) do
|
61
|
-
run("socat -d -d FILE:/dev/#{name},nonblock,raw,echo=0 TCP-LISTEN:#{port},fork")
|
61
|
+
run("socat -d -d -b#{options[:baudrate]} FILE:/dev/#{name},nonblock,raw,echo=0 TCP-LISTEN:#{port},fork")
|
62
62
|
break unless $? == 1
|
63
63
|
attempts -= 1
|
64
64
|
end
|
@@ -3,11 +3,10 @@ require 'thor/group'
|
|
3
3
|
|
4
4
|
module Artoo
|
5
5
|
module Commands
|
6
|
-
class Install <
|
7
|
-
|
8
|
-
include Artoo::Utility
|
6
|
+
class Install < Commands
|
7
|
+
package_name "install"
|
9
8
|
|
10
|
-
desc "socat", "
|
9
|
+
desc "socat", "Install the socat serial to socket utility program"
|
11
10
|
def socat
|
12
11
|
case os
|
13
12
|
when :linux
|
data/lib/artoo/robot.rb
CHANGED
@@ -7,7 +7,9 @@ require 'artoo/ext/actor'
|
|
7
7
|
require 'artoo/robot_class_methods'
|
8
8
|
require 'artoo/basic'
|
9
9
|
require 'artoo/connection'
|
10
|
+
require 'artoo/adaptors/adaptor'
|
10
11
|
require 'artoo/device'
|
12
|
+
require 'artoo/drivers/driver'
|
11
13
|
require 'artoo/events'
|
12
14
|
require 'artoo/api/api'
|
13
15
|
require 'artoo/master'
|
data/lib/artoo/version.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
|
2
|
-
require 'artoo/adaptors/adaptor'
|
3
2
|
|
4
3
|
describe Artoo::Adaptors::Adaptor do
|
5
4
|
before do
|
@@ -15,4 +14,4 @@ describe Artoo::Adaptors::Adaptor do
|
|
15
14
|
@adaptor.disconnect
|
16
15
|
@adaptor.connected?.must_equal false
|
17
16
|
end
|
18
|
-
end
|
17
|
+
end
|
data/test/drivers/driver_test.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
|
2
|
-
require 'artoo/drivers/driver'
|
3
2
|
|
4
3
|
class Awesome < Artoo::Drivers::Driver
|
5
4
|
COMMANDS = [:awesome].freeze
|
@@ -33,4 +32,4 @@ describe Artoo::Drivers::Driver do
|
|
33
32
|
@awesome_driver.known_command?(:awesome).must_equal true
|
34
33
|
@awesome_driver.known_command?(:crazy).must_equal false
|
35
34
|
end
|
36
|
-
end
|
35
|
+
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.1.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ron Evans
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-08-
|
15
|
+
date: 2013-08-30 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: celluloid
|
@@ -20,28 +20,28 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.
|
23
|
+
version: 0.15.0.pre2
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
28
|
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0.
|
30
|
+
version: 0.15.0.pre2
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: celluloid-io
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.
|
37
|
+
version: 0.15.0.pre2
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: 0.
|
44
|
+
version: 0.15.0.pre2
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: reel
|
47
47
|
requirement: !ruby/object:Gem::Requirement
|
@@ -204,6 +204,7 @@ files:
|
|
204
204
|
- lib/artoo/api/device_event_client.rb
|
205
205
|
- lib/artoo/api/route_helpers.rb
|
206
206
|
- lib/artoo/basic.rb
|
207
|
+
- lib/artoo/commands/commands.rb
|
207
208
|
- lib/artoo/commands/connect.rb
|
208
209
|
- lib/artoo/commands/generate.rb
|
209
210
|
- lib/artoo/commands/install.rb
|
@@ -268,9 +269,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
268
269
|
version: '0'
|
269
270
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
270
271
|
requirements:
|
271
|
-
- - '
|
272
|
+
- - '>'
|
272
273
|
- !ruby/object:Gem::Version
|
273
|
-
version:
|
274
|
+
version: 1.3.1
|
274
275
|
requirements: []
|
275
276
|
rubyforge_project: artoo
|
276
277
|
rubygems_version: 2.0.3
|