serialport 1.3.1 → 1.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7c285a09940b43a2a41d00aaf156ad52794b5df2
4
- data.tar.gz: fe69bc91dc9ccee030fd28652a5f477a8bca2a20
2
+ SHA256:
3
+ metadata.gz: 46b308fdb65c3d260d72e40910cab8c92216c80cf0781f2f27635f20acfcf4d6
4
+ data.tar.gz: c4910296a5bd0ef46f9b1506af71965d85895d5196a22d004c03999ab3235457
5
5
  SHA512:
6
- metadata.gz: 42463bdf6563e70568ea2ceaed838a6aad0d38ede6f86e39cfa069cfacd75b74d3f2eaf7de008d07c1ef0198a1db6971e9a0733ced57ec3eb5f61f9cda5ed8e5
7
- data.tar.gz: 1af3cf576b93dd9411ba3e96365c43a56bf46163262997b0d5e09a0e473f2e591150ca5db8e0ba092f9f84bae0ff47a71586b49c7ce707b463868cb1bb910078
6
+ metadata.gz: 9724b16f3729f6f3970d118f847700617587ec5d0d79a583bc3eb4443143a4001b9c9d0a9b86d00ae5cc696b71a14256b7d0fb9450965fbd047bb3fecd3e3376
7
+ data.tar.gz: c9d5c9b32437df4fab958c2a2d7ace91dec7fdaa62b3b1ea4f8e025a7b081873f97d6c195c738051f83c6e89dd9507fd81f7f13b2cb7e4634a6326463afb8352
checksums.yaml.gz.sig ADDED
Binary file
@@ -0,0 +1,97 @@
1
+ name: CI
2
+ on:
3
+ workflow_dispatch:
4
+ schedule:
5
+ - cron: "0 5 * * 3" # At 05:00 on Wednesday # https://crontab.guru/#0_5_*_*_3
6
+ push:
7
+ branches:
8
+ - master
9
+ tags:
10
+ - "*.*.*"
11
+ pull_request:
12
+ types: [opened, synchronize]
13
+ branches:
14
+ - "*"
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ rcd_build:
20
+ name: build gem
21
+
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: "3.4"
29
+
30
+ - name: Build ffi.gem
31
+ run: |
32
+ bundle install
33
+ bundle exec rake gem
34
+
35
+ - name: Upload binary gem
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: gem
39
+ path: pkg/*-*.gem
40
+
41
+ job_test_native:
42
+ name: native test
43
+ needs: rcd_build
44
+ strategy:
45
+ fail-fast: false
46
+ matrix:
47
+ os:
48
+ - windows-latest
49
+ - macos-13
50
+ - macos-latest
51
+ - ubuntu-latest
52
+ - windows-11-arm
53
+ ruby:
54
+ - "head"
55
+ - "3.4"
56
+ - "3.3"
57
+ - "3.2"
58
+ - "3.1"
59
+ - "3.0"
60
+ - "2.7"
61
+ - "2.6"
62
+ - "2.5"
63
+ exclude:
64
+ - os: macos-latest
65
+ ruby: "2.5"
66
+ - os: windows-11-arm
67
+ ruby: "3.3"
68
+ - os: windows-11-arm
69
+ ruby: "3.2"
70
+ - os: windows-11-arm
71
+ ruby: "3.1"
72
+ - os: windows-11-arm
73
+ ruby: "3.0"
74
+ - os: windows-11-arm
75
+ ruby: "2.7"
76
+ - os: windows-11-arm
77
+ ruby: "2.6"
78
+ - os: windows-11-arm
79
+ ruby: "2.5"
80
+
81
+ runs-on: ${{ matrix.os }}
82
+ steps:
83
+ - uses: actions/checkout@v4
84
+ - uses: ruby/setup-ruby@v1
85
+ with:
86
+ ruby-version: ${{ matrix.ruby }}
87
+ - run: ruby --version
88
+ - name: Download gem
89
+ uses: actions/download-artifact@v4
90
+ with:
91
+ name: gem
92
+ - name: Install gem
93
+ run: gem install --local *.gem --verbose
94
+ - name: Run tests
95
+ run: |
96
+ bundle install
97
+ ruby -rserialport -S rake test
data/CHANGELOG CHANGED
@@ -1,3 +1,14 @@
1
+ 1.4.0 => 16-06-2025: [FIXED] Fix compatibility with ruby-3.4. [#79](https://github.com/hparra/ruby-serialport/pull/79)
2
+ [FIXED] Replace ancient K&R function declarations by ANSI style.
3
+ [FIXED] Fixed various compiler warnings.
4
+ [FIXED] Avoid deprecated access to fptr->fd
5
+ [CHANGED] New repository link and add Lars Kanis as new author.
6
+ [CHANGED] Move CI from Travis to Github
7
+ [CHANGED] Use autoload for SerialPort::VERSION
8
+ [REMOVED] Remove compatibility to ruby < 2.5
9
+
10
+ 1.3.2 => 29-09-2021: [FIXED] Remove calls to rb_secure because it is deprecated and removed in Ruby 3.
11
+
1
12
  1.3.1 => 07/26/2014: [FIXED] Ruby 2.2 support
2
13
  [NEW] UNIX MARK/SPACE parity (CMSPAR) support
3
14
 
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source "https://rubygems.org"
2
- source "http://gems.github.com"
2
+
3
3
  gemspec
data/README.md CHANGED
@@ -1,13 +1,11 @@
1
1
  # Ruby/SerialPort
2
2
 
3
- [![Build Status](https://travis-ci.org/hparra/ruby-serialport.png?branch=v1.2.2)](https://travis-ci.org/hparra/ruby-serialport)
3
+ [![CI](https://github.com/larskanis/ruby-serialport/actions/workflows/ci.yml/badge.svg)](https://github.com/larskanis/ruby-serialport/actions/workflows/ci.yml)
4
4
 
5
5
  ## Description
6
6
 
7
7
  Ruby/SerialPort is a Ruby library that provides a class for using RS-232 serial ports. This class also contains low-level functions to check and set the current state of the signals on the line.
8
8
 
9
- The native Windows version of this library supports the Microsoft Visual C++, Borland C++, and MinGW compilers.
10
-
11
9
  There is an alternative gem with MRI, JRuby, and Rubinius support. See below.
12
10
 
13
11
  ## Installation
@@ -41,3 +39,4 @@ GPL
41
39
  * Tobin Richard <tobin.richard@gmail.com>
42
40
  * Hector Parra <hector@hectorparra.com>
43
41
  * Ryan C. Payne <rpayne-oss@bullittsystems.com>
42
+ * Lars Kanis <lars@greiz-reinsdorf.de>
@@ -10,4 +10,7 @@ if !(os == 'mswin' or os == 'bccwin' or os == 'mingw')
10
10
  exit(1) if not have_header("termios.h") or not have_header("unistd.h")
11
11
  end
12
12
 
13
+ have_func("rb_io_descriptor") # ruby-3.1+
14
+ have_func("rb_io_open_descriptor") # ruby-3.3+
15
+
13
16
  create_makefile('serialport')
@@ -61,35 +61,23 @@ static char sTcsetattr[] = "tcsetattr";
61
61
  static char sIoctl[] = "ioctl";
62
62
 
63
63
 
64
- int get_fd_helper(obj)
65
- VALUE obj;
64
+ int get_fd_helper(VALUE io)
66
65
  {
67
- #ifdef HAVE_RUBY_IO_H
68
- rb_io_t *fptr;
66
+ #ifdef HAVE_RB_IO_DESCRIPTOR
67
+ return rb_io_descriptor(io);
69
68
  #else
70
- OpenFile *fptr;
71
- #endif
72
- GetOpenFile(obj, fptr);
73
- #ifdef HAVE_RUBY_IO_H
74
- return (fptr->fd);
75
- #else
76
- return (fileno(fptr->f));
69
+ rb_io_t* fp;
70
+ GetOpenFile(io, fp);
71
+ return fp->fd;
77
72
  #endif
78
73
  }
79
74
 
80
- VALUE sp_create_impl(class, _port)
81
- VALUE class, _port;
75
+ VALUE sp_create_impl(VALUE class, VALUE _port)
82
76
  {
83
- #ifdef HAVE_RUBY_IO_H
84
- rb_io_t *fp;
85
- #else
86
- OpenFile *fp;
87
- #endif
88
-
89
77
  int fd;
90
- int num_port;
91
- char *port;
92
- char *ports[] = {
78
+ long num_port;
79
+ const char *port;
80
+ const char *ports[] = {
93
81
  #if defined(OS_LINUX) || defined(OS_CYGWIN)
94
82
  "/dev/ttyS0", "/dev/ttyS1", "/dev/ttyS2", "/dev/ttyS3",
95
83
  "/dev/ttyS4", "/dev/ttyS5", "/dev/ttyS6", "/dev/ttyS7"
@@ -108,17 +96,13 @@ VALUE sp_create_impl(class, _port)
108
96
  #endif
109
97
  };
110
98
  struct termios params;
111
-
112
- NEWOBJ(sp, struct RFile);
113
- rb_secure(4);
114
- OBJSETUP(sp, class, T_FILE);
115
- MakeOpenFile((VALUE) sp, fp);
99
+ VALUE sp;
116
100
 
117
101
  switch(TYPE(_port))
118
102
  {
119
103
  case T_FIXNUM:
120
- num_port = FIX2INT(_port);
121
- if (num_port < 0 || num_port > sizeof(ports) / sizeof(ports[0]))
104
+ num_port = FIX2LONG(_port);
105
+ if (num_port < 0 || num_port > (long)(sizeof(ports) / sizeof(ports[0])))
122
106
  {
123
107
  rb_raise(rb_eArgError, "illegal port number");
124
108
  }
@@ -167,19 +151,12 @@ VALUE sp_create_impl(class, _port)
167
151
  rb_sys_fail(sTcsetattr);
168
152
  }
169
153
 
170
- #ifdef HAVE_RUBY_IO_H
171
- fp->fd = fd;
172
- #else
173
- fp->f = rb_fdopen(fd, "r+");
174
- #endif
175
- fp->mode = FMODE_READWRITE | FMODE_SYNC;
154
+ sp = rb_io_open_descriptor(class, fd, FMODE_READWRITE | FMODE_SYNC, Qnil, Qnil, NULL);
176
155
 
177
- return (VALUE) sp;
156
+ return sp;
178
157
  }
179
158
 
180
- VALUE sp_set_modem_params_impl(argc, argv, self)
181
- int argc;
182
- VALUE *argv, self;
159
+ VALUE sp_set_modem_params_impl(int argc, VALUE *argv, VALUE self)
183
160
  {
184
161
  int fd;
185
162
  struct termios params;
@@ -400,9 +377,7 @@ VALUE sp_set_modem_params_impl(argc, argv, self)
400
377
  return argv[0];
401
378
  }
402
379
 
403
- void get_modem_params_impl(self, mp)
404
- VALUE self;
405
- struct modem_params *mp;
380
+ void get_modem_params_impl(VALUE self, struct modem_params *mp)
406
381
  {
407
382
  int fd;
408
383
  struct termios params;
@@ -494,8 +469,7 @@ void get_modem_params_impl(self, mp)
494
469
  }
495
470
  }
496
471
 
497
- VALUE sp_set_flow_control_impl(self, val)
498
- VALUE self, val;
472
+ VALUE sp_set_flow_control_impl(VALUE self, VALUE val)
499
473
  {
500
474
  int fd;
501
475
  int flowc;
@@ -541,8 +515,7 @@ VALUE sp_set_flow_control_impl(self, val)
541
515
  return val;
542
516
  }
543
517
 
544
- VALUE sp_get_flow_control_impl(self)
545
- VALUE self;
518
+ VALUE sp_get_flow_control_impl(VALUE self)
546
519
  {
547
520
  int ret;
548
521
  int fd;
@@ -571,8 +544,7 @@ VALUE sp_get_flow_control_impl(self)
571
544
  return INT2FIX(ret);
572
545
  }
573
546
 
574
- VALUE sp_set_read_timeout_impl(self, val)
575
- VALUE self, val;
547
+ VALUE sp_set_read_timeout_impl(VALUE self, VALUE val)
576
548
  {
577
549
  int timeout;
578
550
  int fd;
@@ -611,8 +583,7 @@ VALUE sp_set_read_timeout_impl(self, val)
611
583
  return val;
612
584
  }
613
585
 
614
- VALUE sp_get_read_timeout_impl(self)
615
- VALUE self;
586
+ VALUE sp_get_read_timeout_impl(VALUE self)
616
587
  {
617
588
  int fd;
618
589
  struct termios params;
@@ -631,22 +602,17 @@ VALUE sp_get_read_timeout_impl(self)
631
602
  return INT2FIX(params.c_cc[VTIME] * 100);
632
603
  }
633
604
 
634
- VALUE sp_set_write_timeout_impl(self, val)
635
- VALUE self, val;
605
+ NORETURN(VALUE sp_set_write_timeout_impl(VALUE self, VALUE val))
636
606
  {
637
607
  rb_notimplement();
638
- return self;
639
608
  }
640
609
 
641
- VALUE sp_get_write_timeout_impl(self)
642
- VALUE self;
610
+ NORETURN(VALUE sp_get_write_timeout_impl(VALUE self))
643
611
  {
644
612
  rb_notimplement();
645
- return self;
646
613
  }
647
614
 
648
- VALUE sp_break_impl(self, time)
649
- VALUE self, time;
615
+ VALUE sp_break_impl(VALUE self, VALUE time)
650
616
  {
651
617
  int fd;
652
618
 
@@ -662,9 +628,7 @@ VALUE sp_break_impl(self, time)
662
628
  return Qnil;
663
629
  }
664
630
 
665
- void get_line_signals_helper_impl(obj, ls)
666
- VALUE obj;
667
- struct line_signals *ls;
631
+ void get_line_signals_helper_impl(VALUE obj, struct line_signals *ls)
668
632
  {
669
633
  int fd, status;
670
634
 
@@ -683,9 +647,7 @@ void get_line_signals_helper_impl(obj, ls)
683
647
  ls->ri = (status & TIOCM_RI ? 1 : 0);
684
648
  }
685
649
 
686
- VALUE set_signal_impl(obj, val, sig)
687
- VALUE obj,val;
688
- int sig;
650
+ VALUE set_signal_impl(VALUE obj, VALUE val, int sig)
689
651
  {
690
652
  int status;
691
653
  int fd;
@@ -722,20 +684,17 @@ VALUE set_signal_impl(obj, val, sig)
722
684
  return val;
723
685
  }
724
686
 
725
- VALUE sp_set_rts_impl(self, val)
726
- VALUE self, val;
687
+ VALUE sp_set_rts_impl(VALUE self, VALUE val)
727
688
  {
728
689
  return set_signal_impl(self, val, TIOCM_RTS);
729
690
  }
730
691
 
731
- VALUE sp_set_dtr_impl(self, val)
732
- VALUE self, val;
692
+ VALUE sp_set_dtr_impl(VALUE self, VALUE val)
733
693
  {
734
694
  return set_signal_impl(self, val, TIOCM_DTR);
735
695
  }
736
696
 
737
- VALUE sp_get_rts_impl(self)
738
- VALUE self;
697
+ VALUE sp_get_rts_impl(VALUE self)
739
698
  {
740
699
  struct line_signals ls;
741
700
 
@@ -743,8 +702,7 @@ VALUE sp_get_rts_impl(self)
743
702
  return INT2FIX(ls.rts);
744
703
  }
745
704
 
746
- VALUE sp_get_dtr_impl(self)
747
- VALUE self;
705
+ VALUE sp_get_dtr_impl(VALUE self)
748
706
  {
749
707
  struct line_signals ls;
750
708
 
@@ -753,8 +711,7 @@ VALUE sp_get_dtr_impl(self)
753
711
  return INT2FIX(ls.dtr);
754
712
  }
755
713
 
756
- VALUE sp_flush_input_data_impl(self)
757
- VALUE self;
714
+ VALUE sp_flush_input_data_impl(VALUE self)
758
715
  {
759
716
  int fd;
760
717
  int ret;
@@ -769,8 +726,7 @@ VALUE self;
769
726
  return Qtrue;
770
727
  }
771
728
 
772
- VALUE sp_flush_output_data_impl(self)
773
- VALUE self;
729
+ VALUE sp_flush_output_data_impl(VALUE self)
774
730
  {
775
731
  int fd;
776
732
  int ret;
@@ -20,14 +20,34 @@ VALUE cSerialPort; /* serial port class */
20
20
  VALUE sBaud, sDataBits, sStopBits, sParity; /* strings */
21
21
  VALUE sRts, sDtr, sCts, sDsr, sDcd, sRi;
22
22
 
23
+
24
+ #ifndef HAVE_RB_IO_OPEN_DESCRIPTOR
25
+ VALUE
26
+ io_open_descriptor_fallback(VALUE klass, int descriptor, int mode, VALUE path, VALUE timeout, void *encoding)
27
+ {
28
+ VALUE arguments[2] = {
29
+ (rb_update_max_fd(descriptor), INT2NUM(descriptor)),
30
+ INT2FIX(mode),
31
+ };
32
+
33
+ VALUE self = rb_class_new_instance(2, arguments, klass);
34
+
35
+ rb_io_t *fptr;
36
+ GetOpenFile(self, fptr);
37
+ fptr->pathv = path;
38
+ fptr->mode |= mode;
39
+
40
+ return self;
41
+ }
42
+ #endif
43
+
23
44
  /*
24
45
  * @api private
25
46
  *
26
47
  * @see SerialPort#new
27
48
  * @see SerialPort#open
28
49
  */
29
- static VALUE sp_create(class, _port)
30
- VALUE class, _port;
50
+ static VALUE sp_create(VALUE class, VALUE _port)
31
51
  {
32
52
  return sp_create_impl(class, _port);
33
53
  }
@@ -47,7 +67,7 @@ static VALUE sp_create(class, _port)
47
67
  * (baud, data_bits = 8, stop_bits = 1, parity = (previous_databits == 8 ? NONE : EVEN))
48
68
  * A baudrate of nil will keep the old value.
49
69
  * The default parity depends on the number of databits configured before this function call.
50
- *
70
+ *
51
71
  * @overload set_modem_params(baud, data_bits, stop_bits, parity)
52
72
  * @param baud [Integer] the baud rate
53
73
  * @param data_bits [Integer] the number of data bits
@@ -59,9 +79,7 @@ static VALUE sp_create(class, _port)
59
79
  * @return [Hash] the original paramters
60
80
  * @raise [ArgumentError] if values are invalide or unsupported
61
81
  */
62
- static VALUE sp_set_modem_params(argc, argv, self)
63
- int argc;
64
- VALUE *argv, self;
82
+ static VALUE sp_set_modem_params(int argc, VALUE *argv, VALUE self)
65
83
  {
66
84
  return sp_set_modem_params_impl(argc, argv, self);
67
85
  }
@@ -73,20 +91,18 @@ static VALUE sp_set_modem_params(argc, argv, self)
73
91
  * @return [nil]
74
92
  * @note (POSIX) this value is very approximate
75
93
  */
76
- static VALUE sp_break(self, time)
77
- VALUE self, time;
94
+ static VALUE sp_break(VALUE self, VALUE time)
78
95
  {
79
96
  return sp_break_impl(self, time);
80
97
  }
81
98
 
82
99
  /*
83
- * Get the state of the DTR line
100
+ * Get the state of the DTR line
84
101
  *
85
102
  * @note (Windows) DTR is not available
86
103
  * @return [Integer] the state of DTR line, 0 or 1
87
104
  */
88
- static VALUE sp_get_dtr(self)
89
- VALUE self;
105
+ static VALUE sp_get_dtr(VALUE self)
90
106
  {
91
107
  return sp_get_dtr_impl(self);
92
108
  }
@@ -97,8 +113,7 @@ static VALUE sp_get_dtr(self)
97
113
  * @return [Integer] the flow control flag
98
114
  * @see SerialPort#set_flow_control
99
115
  */
100
- static VALUE sp_get_flow_control(self)
101
- VALUE self;
116
+ static VALUE sp_get_flow_control(VALUE self)
102
117
  {
103
118
  return sp_get_flow_control_impl(self);
104
119
  }
@@ -109,8 +124,7 @@ static VALUE sp_get_flow_control(self)
109
124
  * @return [Integer] the read timeout, in milliseconds
110
125
  * @see SerialPort#set_read_timeout
111
126
  */
112
- static VALUE sp_get_read_timeout(self)
113
- VALUE self;
127
+ static VALUE sp_get_read_timeout(VALUE self)
114
128
  {
115
129
  return sp_get_read_timeout_impl(self);
116
130
  }
@@ -121,8 +135,7 @@ static VALUE sp_get_read_timeout(self)
121
135
  * @return [Integer] the state of RTS line, 0 or 1
122
136
  * @note (Windows) RTS is not available
123
137
  */
124
- static VALUE sp_get_rts(self)
125
- VALUE self;
138
+ static VALUE sp_get_rts(VALUE self)
126
139
  {
127
140
  return sp_get_rts_impl(self);
128
141
  }
@@ -133,8 +146,7 @@ static VALUE sp_get_rts(self)
133
146
  * @return [Integer] the write timeout, in milliseconds
134
147
  * @note (POSIX) write timeouts are not implemented
135
148
  */
136
- static VALUE sp_get_write_timeout(self)
137
- VALUE self;
149
+ static VALUE sp_get_write_timeout(VALUE self)
138
150
  {
139
151
  return sp_get_write_timeout_impl(self);
140
152
  }
@@ -145,8 +157,7 @@ static VALUE sp_get_write_timeout(self)
145
157
  * @param val [Integer] the desired state of the DTR line, 0 or 1
146
158
  * @return [Integer] the original +val+ parameter
147
159
  */
148
- static VALUE sp_set_dtr(self, val)
149
- VALUE self, val;
160
+ static VALUE sp_set_dtr(VALUE self, VALUE val)
150
161
  {
151
162
  return sp_set_dtr_impl(self, val);
152
163
  }
@@ -161,8 +172,7 @@ static VALUE sp_set_dtr(self, val)
161
172
  * @note SerialPort::HARD uses RTS/CTS handshaking.
162
173
  * DSR/DTR is not supported.
163
174
  */
164
- static VALUE sp_set_flow_control(self, val)
165
- VALUE self, val;
175
+ static VALUE sp_set_flow_control(VALUE self, VALUE val)
166
176
  {
167
177
  return sp_set_flow_control_impl(self, val);
168
178
  }
@@ -179,8 +189,7 @@ static VALUE sp_set_flow_control(self, val)
179
189
  * @return [Integer] the original +timeout+ parameter
180
190
  * @note Read timeouts don't mix well with multi-threading
181
191
  */
182
- static VALUE sp_set_read_timeout(self, val)
183
- VALUE self, val;
192
+ static VALUE sp_set_read_timeout(VALUE self, VALUE val)
184
193
  {
185
194
  return sp_set_read_timeout_impl(self, val);
186
195
  }
@@ -191,8 +200,7 @@ static VALUE sp_set_read_timeout(self, val)
191
200
  * @param val [Integer] the state of RTS line, 0 or 1
192
201
  * @return [Integer] the original +val+ parameter
193
202
  */
194
- static VALUE sp_set_rts(self, val)
195
- VALUE self, val;
203
+ static VALUE sp_set_rts(VALUE self, VALUE val)
196
204
  {
197
205
  return sp_set_rts_impl(self, val);
198
206
  }
@@ -204,8 +212,7 @@ static VALUE sp_set_rts(self, val)
204
212
  * @return [Integer] the original +val+ parameter
205
213
  * @note (POSIX) write timeouts are not implemented
206
214
  */
207
- static VALUE sp_set_write_timeout(self, val)
208
- VALUE self, val;
215
+ static VALUE sp_set_write_timeout(VALUE self, VALUE val)
209
216
  {
210
217
  return sp_set_write_timeout_impl(self, val);
211
218
  }
@@ -213,9 +220,7 @@ static VALUE sp_set_write_timeout(self, val)
213
220
  /*
214
221
  * @private helper
215
222
  */
216
- static void get_modem_params(self, mp)
217
- VALUE self;
218
- struct modem_params *mp;
223
+ static void get_modem_params(VALUE self, struct modem_params *mp)
219
224
  {
220
225
  get_modem_params_impl(self, mp);
221
226
  }
@@ -227,8 +232,7 @@ static void get_modem_params(self, mp)
227
232
  * @return [Integer] the original +data_rate+ parameter
228
233
  * @see SerialPort#set_modem_params
229
234
  */
230
- static VALUE sp_set_data_rate(self, data_rate)
231
- VALUE self, data_rate;
235
+ static VALUE sp_set_data_rate(VALUE self, VALUE data_rate)
232
236
  {
233
237
  VALUE argv[4];
234
238
 
@@ -246,8 +250,7 @@ static VALUE sp_set_data_rate(self, data_rate)
246
250
  * @return [Integer] the original +data_bits+ parameter
247
251
  * @see SerialPort#set_modem_params
248
252
  */
249
- static VALUE sp_set_data_bits(self, data_bits)
250
- VALUE self, data_bits;
253
+ static VALUE sp_set_data_bits(VALUE self, VALUE data_bits)
251
254
  {
252
255
  VALUE argv[4];
253
256
 
@@ -265,8 +268,7 @@ static VALUE sp_set_data_bits(self, data_bits)
265
268
  * @return [Integer] the original +stop_bits+ parameter
266
269
  * @see SerialPort#set_modem_params
267
270
  */
268
- static VALUE sp_set_stop_bits(self, stop_bits)
269
- VALUE self, stop_bits;
271
+ static VALUE sp_set_stop_bits(VALUE self, VALUE stop_bits)
270
272
  {
271
273
  VALUE argv[4];
272
274
 
@@ -284,8 +286,7 @@ static VALUE sp_set_stop_bits(self, stop_bits)
284
286
  * @return [Integer] the original +parity+ parameter
285
287
  * @see SerialPort#set_modem_params
286
288
  */
287
- static VALUE sp_set_parity(self, parity)
288
- VALUE self, parity;
289
+ static VALUE sp_set_parity(VALUE self, VALUE parity)
289
290
  {
290
291
  VALUE argv[4];
291
292
 
@@ -302,8 +303,7 @@ static VALUE sp_set_parity(self, parity)
302
303
  * @return [Integer] the current baud rate
303
304
  * @see SerialPort#set_modem_params
304
305
  */
305
- static VALUE sp_get_data_rate(self)
306
- VALUE self;
306
+ static VALUE sp_get_data_rate(VALUE self)
307
307
  {
308
308
  struct modem_params mp;
309
309
 
@@ -318,8 +318,7 @@ static VALUE sp_get_data_rate(self)
318
318
  * @return [Integer] the current number of data bits
319
319
  * @see SerialPort#set_modem_params
320
320
  */
321
- static VALUE sp_get_data_bits(self)
322
- VALUE self;
321
+ static VALUE sp_get_data_bits(VALUE self)
323
322
  {
324
323
  struct modem_params mp;
325
324
 
@@ -334,8 +333,7 @@ static VALUE sp_get_data_bits(self)
334
333
  * @return [Integer] the current number of stop bits
335
334
  * @see SerialPort#set_modem_params for details
336
335
  */
337
- static VALUE sp_get_stop_bits(self)
338
- VALUE self;
336
+ static VALUE sp_get_stop_bits(VALUE self)
339
337
  {
340
338
  struct modem_params mp;
341
339
 
@@ -350,8 +348,7 @@ static VALUE sp_get_stop_bits(self)
350
348
  * @return [Integer] the current parity
351
349
  * @see SerialPort#set_modem_params
352
350
  */
353
- static VALUE sp_get_parity(self)
354
- VALUE self;
351
+ static VALUE sp_get_parity(VALUE self)
355
352
  {
356
353
  struct modem_params mp;
357
354
 
@@ -366,8 +363,7 @@ static VALUE sp_get_parity(self)
366
363
  * @return [Hash] the serial port configuration
367
364
  * @see SerialPort#set_modem_params
368
365
  */
369
- static VALUE sp_get_modem_params(self)
370
- VALUE self;
366
+ static VALUE sp_get_modem_params(VALUE self)
371
367
  {
372
368
  struct modem_params mp;
373
369
  VALUE hash;
@@ -387,9 +383,7 @@ static VALUE sp_get_modem_params(self)
387
383
  /*
388
384
  * @api private
389
385
  */
390
- void get_line_signals_helper(obj, ls)
391
- VALUE obj;
392
- struct line_signals *ls;
386
+ void get_line_signals_helper(VALUE obj, struct line_signals *ls)
393
387
  {
394
388
  get_line_signals_helper_impl(obj, ls);
395
389
  }
@@ -400,8 +394,7 @@ void get_line_signals_helper(obj, ls)
400
394
  * @return [Integer] the state of the CTS line, 0 or 1
401
395
  * @see SerialPort#get_signals
402
396
  */
403
- static VALUE sp_get_cts(self)
404
- VALUE self;
397
+ static VALUE sp_get_cts(VALUE self)
405
398
  {
406
399
  struct line_signals ls;
407
400
 
@@ -416,8 +409,7 @@ static VALUE sp_get_cts(self)
416
409
  * @return [Integer] the state of the DSR line, 0 or 1
417
410
  * @see SerialPort#get_signals
418
411
  */
419
- static VALUE sp_get_dsr(self)
420
- VALUE self;
412
+ static VALUE sp_get_dsr(VALUE self)
421
413
  {
422
414
  struct line_signals ls;
423
415
 
@@ -432,8 +424,7 @@ static VALUE sp_get_dsr(self)
432
424
  * @return [Integer] the state of the DCD line, 0 or 1
433
425
  * @see SerialPort#get_signals
434
426
  */
435
- static VALUE sp_get_dcd(self)
436
- VALUE self;
427
+ static VALUE sp_get_dcd(VALUE self)
437
428
  {
438
429
  struct line_signals ls;
439
430
 
@@ -448,8 +439,7 @@ static VALUE sp_get_dcd(self)
448
439
  * @return [Integer] the state of the RI line, 0 or 1
449
440
  * @see SerialPort#get_signals
450
441
  */
451
- static VALUE sp_get_ri(self)
452
- VALUE self;
442
+ static VALUE sp_get_ri(VALUE self)
453
443
  {
454
444
  struct line_signals ls;
455
445
 
@@ -467,8 +457,7 @@ static VALUE sp_get_ri(self)
467
457
  * @note (Windows) the rts and dtr values are not included
468
458
  * @note This method is implemented as both SerialPort#signals and SerialPort#get_signals
469
459
  */
470
- static VALUE sp_signals(self)
471
- VALUE self;
460
+ static VALUE sp_signals(VALUE self)
472
461
  {
473
462
  struct line_signals ls;
474
463
  VALUE hash;
@@ -494,8 +483,7 @@ static VALUE sp_signals(self)
494
483
  *
495
484
  * @return [Boolean] true on success or false if an error occurs.
496
485
  */
497
- static VALUE sp_flush_input_data(self)
498
- VALUE self;
486
+ static VALUE sp_flush_input_data(VALUE self)
499
487
  {
500
488
  return sp_flush_input_data_impl(self);
501
489
  }
@@ -505,14 +493,13 @@ static VALUE sp_flush_input_data(self)
505
493
  *
506
494
  * @return [Boolean] true on success or false if an error occurs.
507
495
  */
508
- static VALUE sp_flush_output_data(self)
509
- VALUE self;
496
+ static VALUE sp_flush_output_data(VALUE self)
510
497
  {
511
498
  return sp_flush_output_data_impl(self);
512
499
  }
513
500
 
514
501
 
515
- void Init_serialport()
502
+ void Init_serialport(void)
516
503
  {
517
504
  sBaud = rb_str_new2("baud");
518
505
  sDataBits = rb_str_new2("data_bits");
@@ -22,10 +22,11 @@
22
22
  #define _RUBY_SERIAL_PORT_H_
23
23
 
24
24
  #include <ruby.h> /* ruby inclusion */
25
- #ifdef HAVE_RUBY_IO_H /* ruby io inclusion */
26
- #include <ruby/io.h>
27
- #else
28
- #include <rubyio.h>
25
+ #include <ruby/io.h>
26
+
27
+ #ifndef HAVE_RB_IO_OPEN_DESCRIPTOR
28
+ VALUE io_open_descriptor_fallback(VALUE klass, int descriptor, int mode, VALUE path, VALUE timeout, void *encoding);
29
+ #define rb_io_open_descriptor io_open_descriptor_fallback
29
30
  #endif
30
31
 
31
32
  struct modem_params
@@ -56,14 +57,7 @@ struct line_signals
56
57
  #define EVEN EVENPARITY
57
58
  #define ODD ODDPARITY
58
59
 
59
- #ifndef RB_SERIAL_EXPORT
60
- #ifndef HAVE_RUBY_IO_H
61
- #define RB_SERIAL_EXPORT __declspec(dllexport)
62
- #else
63
- #define RB_SERIAL_EXPORT
64
- #endif
65
- #endif
66
-
60
+ #define RB_SERIAL_EXPORT
67
61
  #else
68
62
  #define EVEN 1
69
63
  #define ODD 2
@@ -33,53 +33,37 @@ static char sGetCommTimeouts[] = "GetCommTimeouts";
33
33
  static char sSetCommTimeouts[] = "SetCommTimeouts";
34
34
 
35
35
 
36
- static HANDLE get_handle_helper(obj)
37
- VALUE obj;
36
+ static HANDLE get_handle_helper(VALUE io)
38
37
  {
39
- #ifdef HAVE_RUBY_IO_H
40
- rb_io_t *fptr;
38
+ #ifdef HAVE_RB_IO_DESCRIPTOR
39
+ return (HANDLE) _get_osfhandle(rb_io_descriptor(io));
41
40
  #else
42
- OpenFile *fptr;
43
- #endif
44
-
45
- GetOpenFile(obj, fptr);
46
- #ifdef HAVE_RUBY_IO_H
47
- return (HANDLE) _get_osfhandle(fptr->fd);
48
- #else
49
- return (HANDLE) _get_osfhandle(fileno(fptr->f));
41
+ rb_io_t* fp;
42
+ GetOpenFile(io, fp);
43
+ return (HANDLE) _get_osfhandle(fp->fd);
50
44
  #endif
51
45
  }
52
46
 
53
47
  /* hack to work around the fact that Ruby doesn't use GetLastError? */
54
- static void _rb_win32_fail(const char *function_call) {
48
+ static NORETURN( void _rb_win32_fail(const char *function_call) {
55
49
  rb_raise(
56
- rb_eRuntimeError,
57
- "%s failed: GetLastError returns %d",
50
+ rb_eRuntimeError,
51
+ "%s failed: GetLastError returns %lu",
58
52
  function_call, GetLastError( )
59
53
  );
60
- }
54
+ })
61
55
 
62
- VALUE RB_SERIAL_EXPORT sp_create_impl(class, _port)
63
- VALUE class, _port;
56
+ VALUE RB_SERIAL_EXPORT sp_create_impl(VALUE class, VALUE _port)
64
57
  {
65
- #ifdef HAVE_RUBY_IO_H
66
- rb_io_t *fp;
67
- #else
68
- OpenFile *fp;
69
- #endif
70
58
  int fd;
71
59
  HANDLE fh;
72
60
  int num_port;
73
61
  char *str_port;
74
62
  char port[260]; /* Windows XP MAX_PATH. See http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx */
63
+ VALUE sp;
75
64
 
76
65
  DCB dcb;
77
66
 
78
- NEWOBJ(sp, struct RFile);
79
- rb_secure(4);
80
- OBJSETUP(sp, class, T_FILE);
81
- MakeOpenFile((VALUE) sp, fp);
82
-
83
67
  switch(TYPE(_port))
84
68
  {
85
69
  case T_FIXNUM:
@@ -149,18 +133,11 @@ VALUE RB_SERIAL_EXPORT sp_create_impl(class, _port)
149
133
  }
150
134
 
151
135
  errno = 0;
152
- fp->mode = FMODE_READWRITE | FMODE_BINMODE | FMODE_SYNC;
153
- #ifdef HAVE_RUBY_IO_H
154
- fp->fd = fd;
155
- #else
156
- fp->f = fdopen(fd, "rb+");
157
- #endif
158
- return (VALUE) sp;
136
+ sp = rb_io_open_descriptor(class, fd, FMODE_READWRITE | FMODE_BINMODE | FMODE_SYNC, Qnil, Qnil, NULL);
137
+ return sp;
159
138
  }
160
139
 
161
- VALUE RB_SERIAL_EXPORT sp_set_modem_params_impl(argc, argv, self)
162
- int argc;
163
- VALUE *argv, self;
140
+ VALUE RB_SERIAL_EXPORT sp_set_modem_params_impl(int argc, VALUE *argv, VALUE self)
164
141
  {
165
142
  HANDLE fh;
166
143
  DCB dcb;
@@ -295,9 +272,7 @@ VALUE RB_SERIAL_EXPORT sp_set_modem_params_impl(argc, argv, self)
295
272
  return argv[0];
296
273
  }
297
274
 
298
- void RB_SERIAL_EXPORT get_modem_params_impl(self, mp)
299
- VALUE self;
300
- struct modem_params *mp;
275
+ void RB_SERIAL_EXPORT get_modem_params_impl(VALUE self, struct modem_params *mp)
301
276
  {
302
277
  HANDLE fh;
303
278
  DCB dcb;
@@ -315,8 +290,7 @@ void RB_SERIAL_EXPORT get_modem_params_impl(self, mp)
315
290
  mp->parity = dcb.Parity;
316
291
  }
317
292
 
318
- VALUE RB_SERIAL_EXPORT sp_set_flow_control_impl(self, val)
319
- VALUE self, val;
293
+ VALUE RB_SERIAL_EXPORT sp_set_flow_control_impl(VALUE self, VALUE val)
320
294
  {
321
295
  HANDLE fh;
322
296
  int flowc;
@@ -360,8 +334,7 @@ VALUE RB_SERIAL_EXPORT sp_set_flow_control_impl(self, val)
360
334
  return val;
361
335
  }
362
336
 
363
- VALUE RB_SERIAL_EXPORT sp_get_flow_control_impl(self)
364
- VALUE self;
337
+ VALUE RB_SERIAL_EXPORT sp_get_flow_control_impl(VALUE self)
365
338
  {
366
339
  HANDLE fh;
367
340
  int ret;
@@ -388,8 +361,7 @@ VALUE RB_SERIAL_EXPORT sp_get_flow_control_impl(self)
388
361
  return INT2FIX(ret);
389
362
  }
390
363
 
391
- VALUE RB_SERIAL_EXPORT sp_set_read_timeout_impl(self, val)
392
- VALUE self, val;
364
+ VALUE RB_SERIAL_EXPORT sp_set_read_timeout_impl(VALUE self, VALUE val)
393
365
  {
394
366
  int timeout;
395
367
  HANDLE fh;
@@ -431,8 +403,7 @@ VALUE RB_SERIAL_EXPORT sp_set_read_timeout_impl(self, val)
431
403
  return val;
432
404
  }
433
405
 
434
- VALUE RB_SERIAL_EXPORT sp_get_read_timeout_impl(self)
435
- VALUE self;
406
+ VALUE RB_SERIAL_EXPORT sp_get_read_timeout_impl(VALUE self)
436
407
  {
437
408
  HANDLE fh;
438
409
  COMMTIMEOUTS ctout;
@@ -454,8 +425,7 @@ VALUE RB_SERIAL_EXPORT sp_get_read_timeout_impl(self)
454
425
  return INT2FIX(ctout.ReadTotalTimeoutConstant);
455
426
  }
456
427
 
457
- VALUE RB_SERIAL_EXPORT sp_set_write_timeout_impl(self, val)
458
- VALUE self, val;
428
+ VALUE RB_SERIAL_EXPORT sp_set_write_timeout_impl(VALUE self, VALUE val)
459
429
  {
460
430
  int timeout;
461
431
  HANDLE fh;
@@ -489,8 +459,7 @@ VALUE RB_SERIAL_EXPORT sp_set_write_timeout_impl(self, val)
489
459
  return val;
490
460
  }
491
461
 
492
- VALUE RB_SERIAL_EXPORT sp_get_write_timeout_impl(self)
493
- VALUE self;
462
+ VALUE RB_SERIAL_EXPORT sp_get_write_timeout_impl(VALUE self)
494
463
  {
495
464
  HANDLE fh;
496
465
  COMMTIMEOUTS ctout;
@@ -504,8 +473,7 @@ VALUE RB_SERIAL_EXPORT sp_get_write_timeout_impl(self)
504
473
  return INT2FIX(ctout.WriteTotalTimeoutMultiplier);
505
474
  }
506
475
 
507
- static void delay_ms(time)
508
- int time;
476
+ static void delay_ms(int time)
509
477
  {
510
478
  HANDLE ev;
511
479
 
@@ -523,8 +491,7 @@ static void delay_ms(time)
523
491
  CloseHandle(ev);
524
492
  }
525
493
 
526
- VALUE RB_SERIAL_EXPORT sp_break_impl(self, time)
527
- VALUE self, time;
494
+ VALUE RB_SERIAL_EXPORT sp_break_impl(VALUE self, VALUE time)
528
495
  {
529
496
  HANDLE fh;
530
497
 
@@ -542,9 +509,7 @@ VALUE RB_SERIAL_EXPORT sp_break_impl(self, time)
542
509
  return Qnil;
543
510
  }
544
511
 
545
- void RB_SERIAL_EXPORT get_line_signals_helper_impl(obj, ls)
546
- VALUE obj;
547
- struct line_signals *ls;
512
+ void RB_SERIAL_EXPORT get_line_signals_helper_impl(VALUE obj, struct line_signals *ls)
548
513
  {
549
514
  HANDLE fh;
550
515
  unsigned long status; /* DWORD */
@@ -561,9 +526,7 @@ void RB_SERIAL_EXPORT get_line_signals_helper_impl(obj, ls)
561
526
  ls->ri = (status & MS_RING_ON ? 1 : 0);
562
527
  }
563
528
 
564
- static VALUE set_signal(obj, val, sigoff, sigon)
565
- VALUE obj,val;
566
- int sigoff, sigon;
529
+ static VALUE set_signal(VALUE obj, VALUE val, int sigoff, int sigon)
567
530
  {
568
531
  HANDLE fh;
569
532
  int set, sig;
@@ -593,36 +556,35 @@ static VALUE set_signal(obj, val, sigoff, sigon)
593
556
  return val;
594
557
  }
595
558
 
596
- VALUE RB_SERIAL_EXPORT sp_set_rts_impl(self, val)
597
- VALUE self, val;
559
+ VALUE RB_SERIAL_EXPORT sp_set_rts_impl(VALUE self, VALUE val)
598
560
  {
599
561
  return set_signal(self, val, CLRRTS, SETRTS);
600
562
  }
601
563
 
602
- VALUE RB_SERIAL_EXPORT sp_set_dtr_impl(self, val)
603
- VALUE self, val;
564
+ VALUE RB_SERIAL_EXPORT sp_set_dtr_impl(VALUE self, VALUE val)
604
565
  {
605
566
  return set_signal(self, val, CLRDTR, SETDTR);
606
567
  }
607
568
 
608
- VALUE RB_SERIAL_EXPORT sp_get_rts_impl(self)
609
- VALUE self;
569
+ VALUE RB_SERIAL_EXPORT sp_get_rts_impl(VALUE self)
610
570
  {
611
571
  rb_notimplement();
612
572
  return self;
613
573
  }
614
574
 
615
- VALUE RB_SERIAL_EXPORT sp_get_dtr_impl(self)
616
- VALUE self;
575
+ VALUE RB_SERIAL_EXPORT sp_get_dtr_impl(VALUE self)
617
576
  {
618
577
  rb_notimplement();
619
578
  return self;
620
579
  }
621
580
 
581
+ #ifndef PURGE_RXABORT
622
582
  #define PURGE_RXABORT 0x02
583
+ #endif
584
+ #ifndef PURGE_RXCLEAR
623
585
  #define PURGE_RXCLEAR 0x08
624
- VALUE RB_SERIAL_EXPORT sp_flush_input_data_impl(self)
625
- VALUE self;
586
+ #endif
587
+ VALUE RB_SERIAL_EXPORT sp_flush_input_data_impl(VALUE self)
626
588
  {
627
589
  BOOL ret;
628
590
  HANDLE fh;
@@ -636,10 +598,13 @@ VALUE RB_SERIAL_EXPORT sp_flush_input_data_impl(self)
636
598
  return Qtrue;
637
599
  }
638
600
 
601
+ #ifndef PURGE_TXABORT
639
602
  #define PURGE_TXABORT 0x01
603
+ #endif
604
+ #ifndef PURGE_TXCLEAR
640
605
  #define PURGE_TXCLEAR 0x04
641
- VALUE RB_SERIAL_EXPORT sp_flush_output_data_impl(self)
642
- VALUE self;
606
+ #endif
607
+ VALUE RB_SERIAL_EXPORT sp_flush_output_data_impl(VALUE self)
643
608
  {
644
609
  BOOL ret;
645
610
  HANDLE fh;
@@ -1,3 +1,3 @@
1
- class SerialPort
2
- VERSION = "1.3.1"
1
+ class SerialPort < IO
2
+ VERSION = "1.4.0"
3
3
  end
data/lib/serialport.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'serialport.so'
2
- require 'serialport/version'
3
2
 
4
3
 
5
4
  # This class is used for communication over a serial port.
@@ -7,7 +6,9 @@ require 'serialport/version'
7
6
  #
8
7
  # @see http://rubydoc.info/stdlib/core/IO Ruby IO class
9
8
  # @see http://www.cmrr.umn.edu/~strupp/serial.html "Serial Programming Guide for POSIX Operating Systems"
10
- class SerialPort
9
+ class SerialPort < IO
10
+ autoload :VERSION, 'serialport/version'
11
+
11
12
  private_class_method(:create)
12
13
 
13
14
  # Creates a serial port object.
data/serialport.gemspec CHANGED
@@ -1,16 +1,18 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/serialport/version', __FILE__)
2
+ $: << "lib"
3
+ require "serialport/version"
3
4
 
4
5
  Gem::Specification.new do |s|
5
6
  s.name = "serialport"
6
7
  s.license = "GPL-2"
7
8
  s.version = SerialPort::VERSION
8
- s.authors = ["Guillaume Pierronnet", "Alan Stern", "Daniel E. Shipton", "Tobin Richard", "Hector Parra", "Ryan C. Payne"]
9
+ s.authors = ["Guillaume Pierronnet", "Alan Stern", "Daniel E. Shipton", "Tobin Richard", "Hector Parra", "Ryan C. Payne", "Lars Kanis"]
9
10
  s.summary = "Library for using RS-232 serial ports."
10
11
  s.description = "Ruby/SerialPort is a Ruby library that provides a class for using RS-232 serial ports."
11
- s.email = "hector@hectorparra.com"
12
- s.homepage = "http://github.com/hparra/ruby-serialport/"
12
+ s.email = "lars@greiz-reinsdorf.de"
13
+ s.homepage = "http://github.com/larskanis/ruby-serialport/"
13
14
 
15
+ s.required_ruby_version = '>= 2.5'
14
16
  s.add_development_dependency "bundler"
15
17
  s.add_development_dependency "rake"
16
18
  s.add_development_dependency "rake-compiler", ">= 0.4.1"
data.tar.gz.sig ADDED
@@ -0,0 +1,6 @@
1
+ a�\1'��
2
+ ���܎9���5<����<X; ��g^_�L[Ռ�9#����T>���؍he�m�֎�5�`�
3
+ }��zF����4&kDph6C}3&9��B�B1�"���P��Y����6ȿ����鯌�5��
4
+ �6���q�]��ɮ��@��.�
5
+ �&m�����^LQAXW�7Q�kD��
6
+ ���Ӝ�o�x�^g����<�&��kR������8A��e>�
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serialport
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Pierronnet
@@ -10,56 +10,81 @@ authors:
10
10
  - Tobin Richard
11
11
  - Hector Parra
12
12
  - Ryan C. Payne
13
- autorequire:
13
+ - Lars Kanis
14
14
  bindir: bin
15
- cert_chain: []
16
- date: 2014-07-27 00:00:00.000000000 Z
15
+ cert_chain:
16
+ - |
17
+ -----BEGIN CERTIFICATE-----
18
+ MIIEBDCCAmygAwIBAgIBAzANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB1sYXJz
19
+ L0RDPWdyZWl6LXJlaW5zZG9yZi9EQz1kZTAeFw0yNDEyMjkxOTU2NTZaFw0yNTEy
20
+ MjkxOTU2NTZaMCgxJjAkBgNVBAMMHWxhcnMvREM9Z3JlaXotcmVpbnNkb3JmL0RD
21
+ PWRlMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwum6Y1KznfpzXOT/
22
+ mZgJTBbxZuuZF49Fq3K0WA67YBzNlDv95qzSp7V/7Ek3NCcnT7G+2kSuhNo1FhdN
23
+ eSDO/moYebZNAcu3iqLsuzuULXPLuoU0GsMnVMqV9DZPh7cQHE5EBZ7hlzDBK7k/
24
+ 8nBMvR0mHo77kIkapHc26UzVq/G0nKLfDsIHXVylto3PjzOumjG6GhmFN4r3cP6e
25
+ SDfl1FSeRYVpt4kmQULz/zdSaOH3AjAq7PM2Z91iGwQvoUXMANH2v89OWjQO/NHe
26
+ JMNDFsmHK/6Ji4Kk48Z3TyscHQnipAID5GhS1oD21/WePdj7GhmbF5gBzkV5uepd
27
+ eJQPgWGwrQW/Z2oPjRuJrRofzWfrMWqbOahj9uth6WSxhNexUtbjk6P8emmXOJi5
28
+ chQPnWX+N3Gj+jjYxqTFdwT7Mj3pv1VHa+aNUbqSPpvJeDyxRIuo9hvzDaBHb/Cg
29
+ 9qRVcm8a96n4t7y2lrX1oookY6bkBaxWOMtWlqIprq8JZXM9AgMBAAGjOTA3MAkG
30
+ A1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQ4h1tIyvdUWtMI739xMzTR
31
+ 7EfMFzANBgkqhkiG9w0BAQsFAAOCAYEAoZZWzNV2XXaoSmvyamSSN+Wt/Ia+DNrU
32
+ 2pc3kMEqykH6l1WiVPszr6HavQ//2I2UcSRSS5AGDdiSXcfyFmHtMBdtJHhTPcn7
33
+ 4DLliB0szpvwG+ltGD8PI8eWkLaTQeFzs+0QCTavgKV+Zw56Q0J5zZvHHUMrLkUD
34
+ qhwKjdTdkrRTn9Sqi0BrIRRZGTUDdrt8qoWm35aES5arKZzytgrRD/kXfFW2LCg0
35
+ FzgTKibR4/3g8ph94kQLg/D2SMlVPkQ3ECi036mZxDC2n8V6u3rDkG5923wmrRZB
36
+ J6cqz475Q8HYORQCB68OPzkWMfC7mBo3vpSsIqRoNs1FE4FJu4FGwZG8fBSrDC4H
37
+ bZe+GtyS3e2SMjgT65zp35gLO9I7MquzYN9P6V2u1iBpTycchk5z9R1ghxzZSBT8
38
+ DrkJ9tVlPQtJB0LqT0tvBap4upnwT1xYq721b5dwH6AF4Pi6iz/dc5vnq1/MH8bV
39
+ 8VbbBzzeE7MsvgkP3sHlLmY8PtuyViJ8
40
+ -----END CERTIFICATE-----
41
+ date: 2025-06-16 00:00:00.000000000 Z
17
42
  dependencies:
18
43
  - !ruby/object:Gem::Dependency
19
44
  name: bundler
20
45
  requirement: !ruby/object:Gem::Requirement
21
46
  requirements:
22
- - - '>='
47
+ - - ">="
23
48
  - !ruby/object:Gem::Version
24
49
  version: '0'
25
50
  type: :development
26
51
  prerelease: false
27
52
  version_requirements: !ruby/object:Gem::Requirement
28
53
  requirements:
29
- - - '>='
54
+ - - ">="
30
55
  - !ruby/object:Gem::Version
31
56
  version: '0'
32
57
  - !ruby/object:Gem::Dependency
33
58
  name: rake
34
59
  requirement: !ruby/object:Gem::Requirement
35
60
  requirements:
36
- - - '>='
61
+ - - ">="
37
62
  - !ruby/object:Gem::Version
38
63
  version: '0'
39
64
  type: :development
40
65
  prerelease: false
41
66
  version_requirements: !ruby/object:Gem::Requirement
42
67
  requirements:
43
- - - '>='
68
+ - - ">="
44
69
  - !ruby/object:Gem::Version
45
70
  version: '0'
46
71
  - !ruby/object:Gem::Dependency
47
72
  name: rake-compiler
48
73
  requirement: !ruby/object:Gem::Requirement
49
74
  requirements:
50
- - - '>='
75
+ - - ">="
51
76
  - !ruby/object:Gem::Version
52
77
  version: 0.4.1
53
78
  type: :development
54
79
  prerelease: false
55
80
  version_requirements: !ruby/object:Gem::Requirement
56
81
  requirements:
57
- - - '>='
82
+ - - ">="
58
83
  - !ruby/object:Gem::Version
59
84
  version: 0.4.1
60
85
  description: Ruby/SerialPort is a Ruby library that provides a class for using RS-232
61
86
  serial ports.
62
- email: hector@hectorparra.com
87
+ email: lars@greiz-reinsdorf.de
63
88
  executables: []
64
89
  extensions:
65
90
  - ext/native/extconf.rb
@@ -67,13 +92,12 @@ extra_rdoc_files:
67
92
  - LICENSE
68
93
  - README.md
69
94
  files:
70
- - .gitignore
71
- - .travis.yml
95
+ - ".github/workflows/ci.yml"
96
+ - ".gitignore"
72
97
  - CHANGELOG
73
98
  - CHECKLIST
74
99
  - Gemfile
75
100
  - LICENSE
76
- - MANIFEST
77
101
  - README.md
78
102
  - Rakefile
79
103
  - ext/native/extconf.rb
@@ -86,29 +110,25 @@ files:
86
110
  - serialport.gemspec
87
111
  - test/miniterm.rb
88
112
  - test/set_readtimeout.rb
89
- homepage: http://github.com/hparra/ruby-serialport/
113
+ homepage: http://github.com/larskanis/ruby-serialport/
90
114
  licenses:
91
115
  - GPL-2
92
116
  metadata: {}
93
- post_install_message:
94
117
  rdoc_options: []
95
118
  require_paths:
96
119
  - lib
97
120
  required_ruby_version: !ruby/object:Gem::Requirement
98
121
  requirements:
99
- - - '>='
122
+ - - ">="
100
123
  - !ruby/object:Gem::Version
101
- version: '0'
124
+ version: '2.5'
102
125
  required_rubygems_version: !ruby/object:Gem::Requirement
103
126
  requirements:
104
- - - '>='
127
+ - - ">="
105
128
  - !ruby/object:Gem::Version
106
129
  version: '0'
107
130
  requirements: []
108
- rubyforge_project:
109
- rubygems_version: 2.0.14
110
- signing_key:
131
+ rubygems_version: 3.6.2
111
132
  specification_version: 4
112
133
  summary: Library for using RS-232 serial ports.
113
134
  test_files: []
114
- has_rdoc:
metadata.gz.sig ADDED
@@ -0,0 +1,3 @@
1
+ %��I���ݳ���)qV\����K�ə��)��~����7����f����)�X M:c#ف�.P�A��
2
+ ����J�粔7x霔V<( �!�_
3
+ J��gi��aя��7�����Q�� '�hv �e|QM�����W�<
data/.travis.yml DELETED
@@ -1,12 +0,0 @@
1
- language: ruby
2
- script: "bundle exec rake test"
3
- rvm:
4
- - 1.8.7
5
- - 1.9.2
6
- - 1.9.3
7
- - 2.0.0
8
- compiler:
9
- - clang
10
- - gcc
11
- before_script:
12
- - rake compile
data/MANIFEST DELETED
@@ -1,12 +0,0 @@
1
- CHANGELOG
2
- MANIFEST
3
- README.md
4
- Rakefile
5
- serialport.gemspec
6
- ext/native/extconf.rb
7
- ext/native/posix_serialport_impl.c
8
- ext/native/serialport.c
9
- ext/native/serialport.h
10
- ext/native/win_serialport_impl.c
11
- lib/serialport.rb
12
- test/miniterm.rb