pserialport 1.3.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.
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/serialport/version', __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "pserialport"
6
+ s.license = "GPL-2.0"
7
+ s.version = SerialPort::VERSION
8
+ s.authors = ["Guillaume Pierronnet", "Alan Stern", "Daniel E. Shipton", "Tobin Richard", "Hector Parra", "Ryan C. Payne"]
9
+ s.summary = "Library for using RS-232 serial ports."
10
+ s.description = "Ruby/SerialPort is a Ruby library that provides a class for using RS-232 serial ports."
11
+ s.email = "gems@pololu.com"
12
+ s.homepage = "http://github.com/pololu/pserialport/"
13
+
14
+ s.add_development_dependency "bundler"
15
+ s.add_development_dependency "rake"
16
+ s.add_development_dependency "rake-compiler", ">= 0.4.1"
17
+
18
+ s.require_paths = ["lib"]
19
+ s.files = `git ls-files`.split($\)
20
+ s.extensions = "ext/native/extconf.rb"
21
+ s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
22
+ s.extra_rdoc_files = ["LICENSE", "README.md"]
23
+ end
data/test/miniterm.rb ADDED
@@ -0,0 +1,25 @@
1
+ require "../serialport.so"
2
+
3
+
4
+ if ARGV.size < 4
5
+ STDERR.print <<EOF
6
+ Usage: ruby #{$0} num_port bps nbits stopb
7
+ EOF
8
+ exit(1)
9
+ end
10
+
11
+ sp = SerialPort.new(ARGV[0].to_i, ARGV[1].to_i, ARGV[2].to_i, ARGV[3].to_i, SerialPort::NONE)
12
+
13
+ open("/dev/tty", "r+") { |tty|
14
+ tty.sync = true
15
+ Thread.new {
16
+ while true do
17
+ tty.printf("%c", sp.getc)
18
+ end
19
+ }
20
+ while (l = tty.gets) do
21
+ sp.write(l.sub("\n", "\r"))
22
+ end
23
+ }
24
+
25
+ sp.close
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby
2
+ require "rubygems"
3
+ require "serialport"
4
+
5
+ sp = SerialPort.new("/dev/tty.usbserial", "9600".to_i)
6
+ sp.read_timeout = 100
7
+ sp.close
metadata ADDED
@@ -0,0 +1,112 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pserialport
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.2
5
+ platform: ruby
6
+ authors:
7
+ - Guillaume Pierronnet
8
+ - Alan Stern
9
+ - Daniel E. Shipton
10
+ - Tobin Richard
11
+ - Hector Parra
12
+ - Ryan C. Payne
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+ date: 1980-01-01 00:00:00.000000000 Z
17
+ dependencies:
18
+ - !ruby/object:Gem::Dependency
19
+ name: bundler
20
+ requirement: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: '0'
25
+ type: :development
26
+ prerelease: false
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ - !ruby/object:Gem::Dependency
33
+ name: rake
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ type: :development
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake-compiler
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 0.4.1
53
+ type: :development
54
+ prerelease: false
55
+ version_requirements: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 0.4.1
60
+ description: Ruby/SerialPort is a Ruby library that provides a class for using RS-232
61
+ serial ports.
62
+ email: gems@pololu.com
63
+ executables: []
64
+ extensions:
65
+ - ext/native/extconf.rb
66
+ extra_rdoc_files:
67
+ - LICENSE
68
+ - README.md
69
+ files:
70
+ - ".gitignore"
71
+ - ".travis.yml"
72
+ - CHANGELOG
73
+ - CHECKLIST
74
+ - Gemfile
75
+ - LICENSE
76
+ - MANIFEST
77
+ - README.md
78
+ - Rakefile
79
+ - ext/native/extconf.rb
80
+ - ext/native/posix_serialport_impl.c
81
+ - ext/native/serialport.c
82
+ - ext/native/serialport.h
83
+ - ext/native/win_serialport_impl.c
84
+ - lib/serialport.rb
85
+ - lib/serialport/version.rb
86
+ - serialport.gemspec
87
+ - test/miniterm.rb
88
+ - test/set_readtimeout.rb
89
+ homepage: http://github.com/pololu/pserialport/
90
+ licenses:
91
+ - GPL-2.0
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubygems_version: 3.2.16
109
+ signing_key:
110
+ specification_version: 4
111
+ summary: Library for using RS-232 serial ports.
112
+ test_files: []