hparra / ruby-serialport

ruby-serialport is a Ruby library that provides a class for using RS-232 serial ports
http://rubygems.org/gems/serialport
GNU General Public License v2.0
246 stars 58 forks source link

Documentation Request SerialPort.available() #38

Open einspunktnull opened 11 years ago

einspunktnull commented 11 years ago

Hi, i was looking for a method equivalent to Arduino's Serial.available(), which returns the amount of bytes received / readable, if there's nothing it returns -1. First, I've looked in the docs, but couldn't find sth. similar. Than i've done a puts Serialport.instance_methods. This gave me a huge amount of methods like the usefull getc which I've not seen in the docs, but I also need. Finally I'm confused how to get full Information about API of SerialPort. When I looked in the Source I couldn't find the getc too. Excuse me Im a ruby-noob, so maybe I've gone the false way.

ghost commented 10 years ago

it inherits from the IO class, so you should also look there for methods.

ghost commented 10 years ago

the documentation is now available online here: http://rubydoc.info/gems/serialport/SerialPort