Package: libserialport-ruby1.8
Version: 0.7.0-1
Severity: normal
Tags: upstream patch

Hi,

Reading the CTS and setting the DTR line state is broken:
$ irb1.8
irb(main):001:0> require 'serialport'
=> true
irb(main):002:0> s = SerialPort.new('/dev/ttyUSB0', 19200)
=> #<SerialPort:0xb74eaf7c>
irb(main):003:0> s.dtr = 0
irb: symbol lookup error: /usr/lib/ruby/1.8/i486-linux/serialport.so:
undefined symbol: set_signal
zsh: exit 127

$ irb1.8
irb(main):001:0> require 'serialport'
=> true
irb(main):002:0> s = SerialPort.new('/dev/ttyUSB0', 19200)
=> #<SerialPort:0xb74c8a30>
irb(main):003:0> s.cts
irb: symbol lookup error: /usr/lib/ruby/1.8/i486-linux/serialport.so:
undefined symbol: get_line_signals_helper
zsh: exit 127

The attached patch fixes this problem.  The version is very old, there is a
new upstream version (0.7.2) available:
http://github.com/toholio/ruby-serialport

And even a forked version 1.0.1 (since the original hasn't been modified since
2008) at http://github.com/toholio/ruby-serialport

If you need help, just contact me.  If you aren't interested in maintaining
this package any more, I would gladly take it over.

Cheers,
- Alexander

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libserialport-ruby1.8 depends on:
ii  libc6                        2.11.2-2    Embedded GNU C Library: Shared lib
ii  libruby1.8                   1.8.7.302-2 Libraries necessary to run Ruby 1.

libserialport-ruby1.8 recommends no packages.

libserialport-ruby1.8 suggests no packages.

-- no debconf information
diff --git a/ext/impl/posix_serialport.c b/ext/impl/posix_serialport.c
index 8ed5c2d..71fee84 100644
--- a/ext/impl/posix_serialport.c
+++ b/ext/impl/posix_serialport.c
@@ -631,13 +631,13 @@ static VALUE set_signal_impl(obj, val, sig)
 static VALUE sp_set_rts_impl(self, val)
    VALUE self, val;
 {
-   return set_signal(self, val, TIOCM_RTS);
+   return set_signal_impl(self, val, TIOCM_RTS);
 }
 
 static VALUE sp_set_dtr_impl(self, val)
    VALUE self, val;
 {
-   return set_signal(self, val, TIOCM_DTR);
+   return set_signal_impl(self, val, TIOCM_DTR);
 }
 
 static VALUE sp_get_rts_impl(self)
@@ -645,7 +645,7 @@ static VALUE sp_get_rts_impl(self)
 {
    struct line_signals ls;
 
-   get_line_signals_helper(self, &ls);
+   get_line_signals_helper_impl(self, &ls);
    return INT2FIX(ls.rts);
 }
 
@@ -654,7 +654,7 @@ static VALUE sp_get_dtr_impl(self)
 {
    struct line_signals ls;
 
-   get_line_signals_helper(self, &ls);
+   get_line_signals_helper_impl(self, &ls);
 
    return INT2FIX(ls.dtr);
 }

Attachment: signature.asc
Description: Digital signature

Reply via email to