sphero 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f2540435af315c51080f81df94c0578cc1982f2
4
- data.tar.gz: 5806d20195af543acd529a1f219e870c49686e1e
3
+ metadata.gz: 8ee2d8dad7932823ebfff8916a40a98889917fc1
4
+ data.tar.gz: 634330e69fe24d645b915b93d1ead7400f83ff86
5
5
  SHA512:
6
- metadata.gz: 2ea5e1bed3a946fdb37b8b3a6293b29059a80dfe5b126e2890589c7aa5add4aa5ad2b7926f6a1526bf2073de8c22fb7a17e52f4b501175ea10dc2eba93e59f3f
7
- data.tar.gz: 2d4aae14991cda4b4b06b56b27c744005f38947bc8028d42f8c8980c5951654df0f56ae7a3cdc1f92716bedac92903f2d504c3bf4a6f68ddbcf7bcffc529641b
6
+ metadata.gz: 8a9b73bb8eec2b2b8703a0d9537138be284838ef135933c0fa1ffbcac62ecc5eefa6916ffe70b3c9577dc5c395ac4c586249e9971c9b769c751b9c5695c2745a
7
+ data.tar.gz: eaed4963061ac662162c7bd5a409b601059f7c8d535d5132718ff14119cad242b62514b246597f73affc540a84b3245a335811dc5eb4a7b8cd4fe45221797ff1
data/lib/sphero.rb CHANGED
@@ -67,6 +67,7 @@ class Sphero
67
67
  return if @sp.nil? || @sp.closed?
68
68
  begin
69
69
  stop
70
+ sleep 2
70
71
  rescue Exception => e
71
72
  puts e.message
72
73
  ensure
@@ -112,6 +113,10 @@ class Sphero
112
113
  queue_packet Request::SetAutoReconnect.new(@seq, 0, flag(false) )
113
114
  end
114
115
 
116
+ def enable_stop_on_disconnect
117
+ queue_packet Request::SetTempOptionFlags.new(@seq, flag(true))
118
+ end
119
+
115
120
  def power_state
116
121
  queue_packet Request::GetPowerState.new(@seq)
117
122
  end
@@ -453,6 +458,7 @@ class Sphero
453
458
  'plum' => {:r => 221, :g => 160, :b => 221},
454
459
  'powderblue' => {:r => 176, :g => 224, :b => 230},
455
460
  'purple' => {:r => 128, :g => 0, :b => 128},
461
+ 'rebeccapurple' => {:r => 102, :g => 51, :b => 153},
456
462
  'red' => {:r => 255, :g => 0, :b => 0},
457
463
  'rosybrown' => {:r => 188, :g => 143, :b => 143},
458
464
  'royalblue' => {:r => 65, :g => 105, :b => 225},
@@ -133,6 +133,19 @@ class Sphero
133
133
  end
134
134
  end
135
135
 
136
+ class SetTempOptionFlags < Request
137
+ def initialize seq, flag
138
+ super(seq, [flag])
139
+ @cid = 0x37
140
+ @did = 0x02
141
+ end
142
+
143
+ private
144
+ def packet_body
145
+ @data.pack 'N'
146
+ end
147
+ end
148
+
136
149
  GYRO_AXIS_H_FILTERED = 0x0000_0001
137
150
  GYRO_AXIS_M_FILTERED = 0x0000_0002
138
151
  GYRO_AXIS_L_FILTERED = 0x0000_0004
data/sphero.gemspec CHANGED
@@ -11,11 +11,11 @@ Gem::Specification.new do |gem|
11
11
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
12
12
  gem.name = "sphero"
13
13
  gem.require_paths = ["lib"]
14
- gem.version = "1.5.1"
14
+ gem.version = "1.5.2"
15
15
 
16
16
  gem.add_development_dependency "rake", "~>10.0.4"
17
17
  gem.add_development_dependency "mocha", "~>0.13.3"
18
18
  gem.add_development_dependency "minitest", "~>5.0.8"
19
19
 
20
20
  gem.add_runtime_dependency "rubyserial", "~>0.1.1"
21
- end
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sphero
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Hybrid Group
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-04 00:00:00.000000000 Z
11
+ date: 2014-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake