Class: Pigpio::BitBangSerial
- Inherits:
-
BitBangSerialTx
- Object
- BitBangSerialTx
- Pigpio::BitBangSerial
- Defined in:
- lib/pigpio/bit_bang_serial.rb
Instance Attribute Summary collapse
-
#rx ⇒ Object
readonly
Returns the value of attribute rx.
Attributes inherited from BitBangSerialTx
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(rx, tx, baud = 9600, data_bits = 8, stop_bits = 1, parity_type = :none) ⇒ BitBangSerial
constructor
A new instance of BitBangSerial.
- #read(bufsize = 1) ⇒ Object
Methods inherited from BitBangSerialTx
#busy?, #stop, #sync, #write, #write_sync
Constructor Details
#initialize(rx, tx, baud = 9600, data_bits = 8, stop_bits = 1, parity_type = :none) ⇒ BitBangSerial
Returns a new instance of BitBangSerial.
7 8 9 10 |
# File 'lib/pigpio/bit_bang_serial.rb', line 7 def initialize(rx, tx, baud = 9600, data_bits = 8, stop_bits = 1, parity_type = :none) super(tx, baud, data_bits, stop_bits) @rx = BitBangSerialRx.new(rx, baud, data_bits) end |
Instance Attribute Details
#rx ⇒ Object (readonly)
Returns the value of attribute rx.
6 7 8 |
# File 'lib/pigpio/bit_bang_serial.rb', line 6 def rx @rx end |
Instance Method Details
#close ⇒ Object
12 13 14 15 |
# File 'lib/pigpio/bit_bang_serial.rb', line 12 def close super @rx.close end |
#read(bufsize = 1) ⇒ Object
17 18 19 |
# File 'lib/pigpio/bit_bang_serial.rb', line 17 def read(bufsize = 1) @rx.read(bufsize) end |