artoo-arduino 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/ext/Rakefile +1 -0
- data/lib/artoo-arduino/version.rb +1 -1
- data/lib/artoo/commands/arduino.rb +38 -0
- data/lib/artoo/commands/firmata.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34a20ea820138830b5aa01b4e559cee10d2b10d2
|
4
|
+
data.tar.gz: 7022e24bc2f4ee5a0466d0b4f79293a437a4b4ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b65a4fb5ece3630cecd8a844f38cf2521d40dd08ec1f7afe8227433ce0cfd9217e8f14a32605a476856808fa48d75dd4b63e717d30060739249708695d153b31
|
7
|
+
data.tar.gz: c91d5c144a7c1ad45e3fa1a336afbd7fef05f8aae45eebe1dd86556ca288a3dc8cd105b8dead782e96389577ebd8bf63772ef164572d6d810dd2fd95225c2301
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
artoo-arduino (1.4.
|
4
|
+
artoo-arduino (1.4.2)
|
5
5
|
artoo (>= 1.6.0)
|
6
6
|
artoo-gpio
|
7
7
|
artoo-i2c
|
@@ -17,7 +17,7 @@ GEM
|
|
17
17
|
pry (~> 0.9)
|
18
18
|
rake
|
19
19
|
reel (~> 0.4.0)
|
20
|
-
robeaux (~> 0.0.
|
20
|
+
robeaux (~> 0.0.3)
|
21
21
|
thor (~> 0.18.1)
|
22
22
|
artoo-gpio (0.4.0)
|
23
23
|
artoo (>= 1.6.0)
|
data/ext/Rakefile
CHANGED
@@ -5,5 +5,6 @@ task :default => :install_commands
|
|
5
5
|
task :install_commands do
|
6
6
|
@install = Artoo::Commands::Install.new
|
7
7
|
@install.command(File.expand_path(File.dirname(__FILE__) + "/../lib/artoo/commands/firmata.rb"))
|
8
|
+
@install.command(File.expand_path(File.dirname(__FILE__) + "/../lib/artoo/commands/arduino.rb"))
|
8
9
|
@install.command(File.expand_path(File.dirname(__FILE__) + "/../lib/artoo/commands/hex/StandardFirmata.cpp.hex"))
|
9
10
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Artoo
|
2
|
+
module Commands
|
3
|
+
class Arduino < Artoo::Commands::Firmata
|
4
|
+
package_name "arduino"
|
5
|
+
|
6
|
+
desc "scan", "Scan for connected arduino devices"
|
7
|
+
def scan
|
8
|
+
Artoo::Commands::Scan.new().serial()
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "connect [NAME] [PORT]", "Connect a serial device to a TCP socket using socat"
|
12
|
+
option :retries, :aliases => "-r", :default => 0, :desc => "Number of times to retry connecting on failure"
|
13
|
+
option :baudrate, :aliases => "-b", :default => 57600, :desc => "Baud rate to use to connect to the serial device"
|
14
|
+
def connect(name, port)
|
15
|
+
Artoo::Commands::Socket.new().connect(name, port, options[:retries], options[:baudrate])
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# We need to register the commands in the main artoo CLI so they
|
22
|
+
# can be picked up when this command file is required.
|
23
|
+
# The steps needed to register new CLI commands from outside
|
24
|
+
# artoo are:
|
25
|
+
# 1. External command files (not in artoo main gem) need to be copied to the
|
26
|
+
# artoo installed commands.
|
27
|
+
# 2. We do this with a rake task that is triggered when the gem is installed
|
28
|
+
# (see .gemspec file and look for extensions, ext/Rakefile), in the Rakefile
|
29
|
+
# we defined a new default class that makes use of an artoo helper class/method
|
30
|
+
# Artoo::Commands::Install helper method '.command'; see ext/Rakefile for details.
|
31
|
+
# 3. Finally in our main command file (THIS FILE) we open the artoo CLI::Root class to register
|
32
|
+
# the new commands.
|
33
|
+
module CLI
|
34
|
+
class Root
|
35
|
+
desc "arduino SUBCOMMAND <serial_port>", "Installs avrdude, uploads firmata to the arduino and connects serial to socket"
|
36
|
+
subcommand "arduino", Artoo::Commands::Arduino
|
37
|
+
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artoo-arduino
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ron Evans
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-
|
14
|
+
date: 2014-04-04 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: artoo
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- lib/artoo-arduino.rb
|
149
149
|
- lib/artoo-arduino/version.rb
|
150
150
|
- lib/artoo/adaptors/firmata.rb
|
151
|
+
- lib/artoo/commands/arduino.rb
|
151
152
|
- lib/artoo/commands/firmata.rb
|
152
153
|
- lib/artoo/commands/hex/StandardFirmata.cpp.hex
|
153
154
|
- test/adaptors/firmata_test.rb
|
@@ -177,4 +178,3 @@ signing_key:
|
|
177
178
|
specification_version: 4
|
178
179
|
summary: Artoo adaptor and driver for Arduino
|
179
180
|
test_files: []
|
180
|
-
has_rdoc:
|