class Pigpio::Serial
Constants
- Baud
- TTY
Attributes
handle[R]
pi[R]
Public Class Methods
new(pi,ser_tty,baud)
click to toggle source
# File lib/pigpio/serial.rb, line 6 def initialize(pi,ser_tty,baud) @pi=pi @handle=IF.serial_open(pi,ser_tty,baud=19200,0) end
Public Instance Methods
byte()
click to toggle source
# File lib/pigpio/serial.rb, line 16 def byte IF.serial_read_byte(@pi,@handle) end
byte=(bVal)
click to toggle source
# File lib/pigpio/serial.rb, line 13 def byte=(bVal) IF.serial_write_byte(@pi,@handle,bVal) end
close()
click to toggle source
# File lib/pigpio/serial.rb, line 10 def close IF.serial_close(@pi,@handle) end
read(count)
click to toggle source
# File lib/pigpio/serial.rb, line 22 def read(count) IF.serial_read(@pi,@handle,count) end
size()
click to toggle source
# File lib/pigpio/serial.rb, line 25 def size IF.serial_data_available(@pi,@handle) end
write(buf)
click to toggle source
# File lib/pigpio/serial.rb, line 19 def write(buf) IF.serial_write(@pi,@handle,buf) end