hybridgroup-mindset 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mindset.rb +7 -14
  3. metadata +17 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fce0bfce1670cd37613af31635c7e866cf865910
4
- data.tar.gz: dea9314428aca28b7323fd4fc3fa8fb7284ae56a
3
+ metadata.gz: e8c10cbded9460ae81e362a1c41d7e2a879f05b0
4
+ data.tar.gz: 4e007392957355e50e3de8e9e56fccbf6774f85a
5
5
  SHA512:
6
- metadata.gz: ebe19da7017bfd37c12f3830227d7953d2c3de2a9bfa2a79a4bab39f45b0360663c5a958f087de307ac0339a11905d5a9787939423876d36b89a18c5491524b1
7
- data.tar.gz: d1e2b59b142aca966019be8fba67a24535399122e1f6f422ee9f1089c8f41fcb70f490246f883683064739aa724049e5de898030bf0ce06b6db598f0a80ff79b
6
+ metadata.gz: 39d3cc7209b67b4e8172ae07e20cc387985f77a4537a1666953e2f0ce6566120dae7945d0d03f6f89208f3606d87b96e07fccf1ba5dae70e054f38e151ff0b47
7
+ data.tar.gz: 1b58c80d436edd8b46721e392d02cf8b5e96525af6f6aba04ae7548d077dc0f785ea9d45f3d5ef7e427dd5ebf4eebd721c33e7384caad38da39d92c68b1ee237
@@ -1,16 +1,17 @@
1
1
  #!/usr/bin/env ruby
2
2
  # Ruby module for reading data from a Neurosky Mindset.
3
- # (c) Copyright 2013 mkfs@github http://github.com/mkfs/mindset
3
+ # (c) Copyright 2013 mkfs@github http://github.com/mkfs/mindset
4
4
  # License: BSD http://www.freebsd.org/copyright/freebsd-license.html
5
5
 
6
- require 'rubygems' # gem install serialport
6
+ require 'rubygems'
7
7
  require 'json/ext'
8
+ require 'rubyserial'
8
9
 
9
10
  # ----------------------------------------------------------------------
10
11
  module Mindset
11
12
 
12
13
  =begin rdoc
13
- Collection of captured Packet objects. Packets are collected by type. The
14
+ Collection of captured Packet objects. Packets are collected by type. The
14
15
  start and end timestamps are saved.
15
16
  =end
16
17
  class PacketStore < Hash
@@ -141,7 +142,7 @@ packet.
141
142
 
142
143
  # ----------------------------------------------------------------------
143
144
  =begin rdoc
144
- A connection to a Mindset device. This wraps the SerialPort connection to the
145
+ A connection to a Mindset device. This wraps the Serial connection to the
145
146
  device. Device must already be paired and have a serial bluetooth connection
146
147
  established.
147
148
  =end
@@ -156,7 +157,7 @@ established.
156
157
  if device.is_a?(String)
157
158
  initialize_serialport device
158
159
  elsif device.nil?
159
- initialize_serialport SERIAL_PORT
160
+ initialize_serialport SERIAL_PORT
160
161
  else
161
162
  @sp = device
162
163
  end
@@ -166,15 +167,7 @@ established.
166
167
 
167
168
 
168
169
  def initialize_serialport dev
169
- require 'serialport'
170
- @sp = SerialPort.new dev, BAUD_RATE, 8, 1, SerialPort::NONE
171
- if is_windows?
172
- @sp.read_timeout=1000
173
- @sp.write_timeout=0
174
- @sp.initial_byte_offset=5
175
- end
176
- rescue LoadError
177
- puts "Please 'gem install hybridgroup-serialport' for serial port support."
170
+ @sp = Serial.new dev, BAUD_RATE
178
171
  end
179
172
 
180
173
  =begin rdoc
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hybridgroup-mindset
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - mkfs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-07 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2014-07-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubyserial
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
13
27
  description: "This module reads all data transmitted by a Neurosky\nMindset, which
14
28
  must already be paired in Bluetooth and have a Bluetooth serial\n(SPP) socket open.
15
29
  The gem provides the module and a command line utility for\nreading packets and